Repository navigation
refactor(agents): unify exec approval decisions - #125503
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 10:01 PM ET / August 18, 2026, 02:01 UTC. ClawSweeper reviewWhat this changesThe PR moves Gateway and node exec approval decision ordering into one shared resolver and removes the prior duplicated low-level helpers. Merge readinessNo discrete defect was identified in the available PR-head code and supplied diff: both hosts now use the same timeout and strict-approval ordering. This maintainer-labeled exec-authorization refactor should remain open for owner review and exact-head CI completion; the local checkout cannot supply a current-main merge comparison. Priority: P2 Review scores
Verification
How this fits togetherGateway and node exec hosts create or await command approvals, then decide whether a command may run. The shared resolver combines an explicit decision, timeout fallback, and human-only requirements before each host performs its own dispatch and follow-up handling. flowchart LR
A[Command execution request] --> B[Gateway or node exec host]
B --> C[Approval request and policy refresh]
C --> D[Shared approval decision]
D --> E{Approved?}
E -->|Yes| F[Dispatch command]
E -->|No| G[Return denial or follow-up]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -6, Tests +86, Docs 0. Total +80 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical approval resolver, retain host-specific policy refresh and dispatch checks, and merge only after an owner confirms the exact-head validation result. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-neutral refactor review, and the relevant approval ordering is source-traceable through the shared resolver and both host call sites. Is this the best way to solve the issue? Yes, provisionally: centralizing the duplicated decision state machine preserves host-specific policy and dispatch ownership; current-main comparison remains unavailable locally. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 26353983f36e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* refactor(agents): unify exec approval decisions * docs(plan): update runner deletion status
What Problem This Solves
Gateway-hosted and node-hosted exec approvals independently combined explicit decisions, timeout fallback policy, and strict human-only review rules. The duplicated orchestration made approval behavior easier to drift as either host evolved.
Why This Change Was Made
This introduces one shared approval-decision owner that resolves explicit approval, current timeout fallback, and strict human-review boundaries. Gateway and node hosts retain their own policy refresh, security events, mutable-file checks, dispatch, and follow-up delivery; only the duplicated decision state machine moves into the shared owner. A no-op argument-copy helper and the old exported low-level decision helpers are removed.
User Impact
No intended user-visible behavior change. Gateway and node exec approvals now apply the same decision ordering by construction, reducing the chance that timeout fallback or strict inline-eval/auto-review behavior diverges between hosts.
Production LOC: +138 / -144 (net -6). Tests: +154 / -68.
AI-assisted: yes. I understand and reviewed the resulting approval ownership boundary.
Evidence
node scripts/run-vitest.mjs src/agents/bash-tools.exec-host-shared.test.ts src/agents/bash-tools.exec-host-gateway.test.ts src/agents/bash-tools.exec-host-node.test.ts— 204 tests passed on the rebased head.node scripts/check-changed.mjs— passed, including core/test typechecks, lint, dead-export scans, import-cycle checks, and auth/storage guards.pnpm tsgoandpnpm tsgo:core:test— passed.pnpm docs:check-links— 6,520 internal links checked, 0 broken.