Skip to content

fix(client-runtime): Skip env-setup eval segments in command labels - #156

Draft
mwolson wants to merge 1 commit into
contrib/antigravity-background-command-visibilityfrom
contrib/command-label-eval-env-setup
Draft

mwolson wants to merge 1 commit into
contrib/antigravity-background-command-visibilityfrom
contrib/command-label-eval-env-setup

Conversation

@mwolson

@mwolson mwolson commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Problem

Shell pipelines that initialize a version manager or environment with eval "$(...)" — such as cd /path/to/repo && eval "$(fnm env --shell zsh)" && fnm use 26.13.1 && git commit ..., direnv, brew shellenv, pyenv init, or mise activate — fall back to a bare Running command activity label. commandProgramName skips cd, then hits eval, which is in both NON_DESCRIPTIVE_SHELL_PROGRAMS and TERMINAL_SHELL_PROGRAMS, so it stops scanning instead of advancing to the real command.

Change

Allow commandProgramName to advance past a single command-substitution eval segment ($(...) or backticks, with optional -- and redirections) when the inner command is a known environment-setup invocation (fnm env, direnv export|hook, brew shellenv, pyenv init|virtualenv-init, mise/rtx, rbenv/nodenv/goenv/jenv, conda shell.*, micromamba shell, opam, atuin/starship/zoxide, ssh-agent, keychain), while keeping standalone or arbitrary eval segments conservative (null).

Scope

Single focused fix in packages/client-runtime/src/work-log/commandLabel.ts and commandLabel.test.ts, sparked by @DASungta's observation on pingdotgg/t3code#40687. Planned as an independent upstream PR once #40687 lands.

Verification

  • vp test run src/work-log/commandLabel.test.ts src/work-log/presentation.test.ts passes (96 tests), covering fnm env, brew shellenv, direnv export, pyenv init, mise activate, backtick eval, plus negative cases for standalone, multi-command, and non-env-setup eval.
  • scripts/t3code-gates passes (check, typecheck, mobile-typecheck, knip, context-budget).

Shell pipelines that initialize a version manager or environment via eval "$(...)" (such as fnm env, direnv, brew shellenv, pyenv init, or mise activate) stopped commandProgramName at eval because eval is in TERMINAL_SHELL_PROGRAMS, falling back to a bare "Running command" label.

Allow commandProgramName to advance past a single command-substitution eval segment when the inner command is a known environment-setup invocation, while keeping standalone or arbitrary eval segments conservative.
@mwolson
mwolson removed this pull request from stack #157 November 23, 2026 19:20
@mwolson
mwolson force-pushed the contrib/command-label-eval-env-setup branch from 84033dd to a8adfb6 Compare November 23, 2026 19:21
@mwolson
mwolson added this pull request to stack #159 November 23, 2026 19:22
@mwolson
mwolson removed this pull request from stack #159 November 24, 2026 17:26
@mwolson
mwolson added this pull request to stack #161 November 24, 2026 17:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant