Make exec command highlighting optional#79348
Conversation
|
Codex review: passed. Summary Reproducibility: not applicable. this is a feature/config PR rather than a bug report. The behavior is source-verifiable in the PR head and covered by focused exec approval/config tests. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land through the opted-in automerge path after exact-head CI and mergeability are green, assuming maintainers accept the default-off exec approval highlighting policy. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature/config PR rather than a bug report. The behavior is source-verifiable in the PR head and covered by focused exec approval/config tests. Is this the best way to solve the issue? Yes: the narrow config gate keeps command highlighting default-off and gates both agent-side span generation and gateway propagation while preserving sanitizer and unsupported-shell guards. The remaining question is policy/merge readiness rather than a code repair. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against efc864139340. Re-review progress:
|
There was a problem hiding this comment.
Pull request overview
This PR makes exec approval command highlighting opt-in by introducing tools.exec.commandHighlighting (default: false) and gating both command-span generation (agent side) and command-span propagation (gateway side) on that setting.
Changes:
- Add
tools.exec.commandHighlightingto config types, runtime schema, labels/help metadata, generated docs baseline, and changelog. - Skip generating command spans for exec approval requests unless highlighting is explicitly enabled.
- Skip including
commandSpansin gateway exec approval request broadcasts unless highlighting is enabled (global or per-agent).
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/gateway/server-methods/server-methods.test.ts | Extends exec approval handler tests to cover default-off and explicit enable/disable behavior for command spans. |
| src/gateway/server-methods/exec-approval.ts | Gates commandSpans normalization/propagation behind resolved commandHighlighting from runtime config. |
| src/config/zod-schema.agent-runtime.ts | Adds tools.exec.commandHighlighting to the runtime zod schema. |
| src/config/types.tools.ts | Adds commandHighlighting?: boolean to ExecToolConfig with default-off docs. |
| src/config/schema.test.ts | Validates schema acceptance of tools.exec.commandHighlighting in global and agent scopes. |
| src/config/schema.labels.ts | Adds a UI label for tools.exec.commandHighlighting. |
| src/config/schema.help.ts | Adds help text clarifying highlighting is presentation-only and default-off. |
| src/config/schema.help.quality.test.ts | Adds tools.exec.commandHighlighting to help-quality key coverage. |
| src/config/exec-command-highlighting.ts | Introduces resolver for effective command-highlighting enablement (global + per-agent). |
| src/agents/pi-tools.ts | Threads resolved exec commandHighlighting into exec tool defaults and overrides. |
| src/agents/bash-tools.exec.ts | Passes commandHighlighting through to node/gateway approval request paths. |
| src/agents/bash-tools.exec-types.ts | Extends ExecToolDefaults with commandHighlighting?: boolean. |
| src/agents/bash-tools.exec-host-node.types.ts | Extends node-host exec params with commandHighlighting?: boolean. |
| src/agents/bash-tools.exec-host-node.ts | Forwards commandHighlighting into the gateway approval request context. |
| src/agents/bash-tools.exec-host-gateway.ts | Forwards commandHighlighting into gateway allowlist approval registration. |
| src/agents/bash-tools.exec-approval-request.ts | Avoids loading/generating command spans unless commandHighlighting === true. |
| src/agents/bash-tools.exec-approval-request.test.ts | Adds coverage to ensure spans are generated only when highlighting is enabled. |
| docs/tools/exec.md | Documents tools.exec.commandHighlighting in exec tool notes. |
| docs/tools/exec-approvals.md | Adds a dedicated section describing tools.exec.commandHighlighting semantics/scope. |
| docs/gateway/config-tools.md | Updates the config example to include commandHighlighting: false. |
| docs/.generated/config-baseline.sha256 | Updates generated config baseline hashes to reflect the new field. |
| CHANGELOG.md | Records the addition of tools.exec.commandHighlighting. |
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
2 similar comments
|
/clawsweeper re-review |
|
/clawsweeper re-review |
|
/clawsweeper automerge |
|
🦞👀 Source: I left the PR open for the remaining gate instead of bypassing it. Automerge progress:
|
0a44e7f to
132ab7a
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
132ab7a to
2c6c605
Compare
|
🦞✅ Source: I added |
2c6c605 to
cfd1433
Compare
|
/clawsweeper automerge |
cfd1433 to
3b30b44
Compare
|
🦞✅ Source: I added |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3b30b44 to
6f3df30
Compare
dd386dd to
48e1ea1
Compare
48e1ea1 to
f625052
Compare
Summary
tools.exec.commandHighlighting, disabled by default, with global and per-agent opt-in support.Verification
PATH="/opt/homebrew/bin:$PATH" pnpm test src/agents/bash-tools.exec-approval-request.test.ts src/config/schema.test.ts src/config/schema.help.quality.test.ts src/gateway/server-methods/server-methods.test.tsPATH="/opt/homebrew/bin:$PATH" pnpm config:schema:checkPATH="/opt/homebrew/bin:$PATH" pnpm config:docs:checkPATH="/opt/homebrew/bin:$PATH" pnpm docs:check-mdxPATH="/opt/homebrew/bin:$PATH" pnpm check:changedgit diff --check