fix(exec): keep pending approval warnings truthful#101561
Conversation
Co-authored-by: Vincent Koc <[email protected]>
…ec-approval-warning # Conflicts: # CHANGELOG.md
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(exec): keep pending approval warnings truthful This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Land-ready proof on exact head
Behavior proof covers all four relevant states: pending gateway and node approvals omit the foreground-only warning; actual gateway and node inline execution retain it. Documentation now distinguishes inline native-gateway approvals from asynchronous node/non-native approval delivery. |
|
Merged via squash.
|
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Related: #78184
What Problem This Solves
Fixes an issue where users requesting background or yielded exec while the
processtool was unavailable would see “running synchronously” inside a gateway or node approval-pending prompt, even though the command had not started.Why This Change Was Made
This is a maintainer replay of the useful runtime portion of #78184. It keeps foreground-only warnings separate from approval-time warnings, adds them only once execution will actually run inline, and makes node completion rendering preserve the same warnings as gateway completion rendering.
The replay deliberately excludes the original Doctor repair that added
process/editgrants to restricted profiles; that would silently broaden existing authorization policy. It also replaces the original blanket approval docs with the current contract: native gateway approval can wait inline, while node and non-native gateway approvals return pending and complete asynchronously.User Impact
Pending approval cards now describe only the approval state and no longer imply that a command is already executing. If an approved or unguarded command truly falls back to foreground execution, the user still sees the background-disabled warning. No config, migration, protocol, or approval-authority surface changes.
Evidence
tbx_01kwy0fhy32t821vwnbe3exev3:pnpm test src/agents/bash-tools.exec.approval-id.test.ts src/agents/bash-tools.exec-foreground-failures.test.ts src/agents/bash-tools.exec-host-node.test.ts— 3 files, 95 tests passed.pnpm check:changed— selectedcore,coreTests, anddocs; production/test typechecks, lint (0 warnings/errors), docs/policy guards, and import-cycle checks passed.pnpm format:check— all 8 changed files correctly formatted.git diff --checkpassed at commitae9f9e72f5f041fce5c7525b3f1dca8080a35b72.