Repository navigation
refactor(node-host): share execution policy result fields - #140446
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 5:18 PM ET / 21:18 UTC. ClawSweeper reviewWhat this changesShares common node-host execution decision fields and consolidates durable-approval success while preserving command permissions and denial messages. Merge readiness✅ Ready for maintainer review Keep open as a useful, behavior-preserving cleanup. No actionable correctness or security findings remain; current main still contains the duplication, and the maintainer-authored PR is protected from automatic closure. Priority: P3 Review scores
Verification
How this fits togetherThe node host evaluates command requests against execution policy, allowlist analysis, and approval facts. Its decision feeds the command invocation pipeline, which either reports a denial or continues through execution safeguards. flowchart TD
A[Command request] --> B[Node host invocation]
C[Execution policy and approval facts] --> D[Policy evaluation]
B --> D
D --> E{Command allowed?}
E -->|No| F[Denial reason and message]
E -->|Yes| G[Execution safeguards and command run]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -20. Total -20 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one shared decision context and one success return while retaining the existing approval precedence, diagnostics, and consumer safeguards. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR reports duplicated implementation rather than a runtime defect; the duplication is directly visible on current main. Is this the best way to solve the issue? Yes. A local shared result object and equivalent denial predicate remove repetition without introducing another API or changing the execution contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 59294ea45379. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* commit '294df333c58f2da104eccffc623ccb3c4d43d4d8': (1802 commits) fix: clear stale diagnostics after Gateway changes (#140426) fix: keep plugin catalogs intact after discovery timeouts (#140441) perf(tui): prepare session picker rows once per overlay (#140462) refactor(config): reuse environment substitution for write-back (#140460) refactor(discord): remove retired auto-presence templates (#140463) fix(ui): finish roster refreshes during session activity (#140459) fix(setup): match prepared credentials to the model provider (#140461) fix: keep MiniMax discovery on the selected credential (#140438) refactor(tests): remove unused parent context cache reset (#140456) fix: avoid repeated xAI OAuth refresh during discovery (#140434) perf(routing): reuse prepared event session targets (#140454) fix(media): keep deferred audio and extraction providers discoverable (#139231) refactor(codex): remove redundant app-server forwarding (#140451) fix(test): avoid false native polling timeouts (#140119) test(gateway): retain saved source in reload fixtures (#140453) fix(gateway): reduce repeated model work when listing sessions (#140414) fix(feishu): fall back to post mode over table limit (#136382) fix: use the bundle-compatible Proxyline runtime under Bun (#140411) refactor(trace): reuse the canonical usage counter type (#140444) refactor(node-host): share execution policy result fields (#140446) ...
What Problem This Solves
Node-host execution policy repeats the same decision facts in four result branches and carries a separate success return for durable approval. Keeping those projections in sync adds maintenance work to the execution gate.
Why This Change Was Made
Construct the common result fields once and use the existing success return for durable approval. Explicit deny still short-circuits approval evaluation; mandatory approval, Windows shell-wrapper handling, denial reasons, and result fields remain unchanged.
invoke-system-run.tsis the only production consumer, at the initial decision and approved re-evaluation.This removes duplicated implementation, not a compatibility contract.
git log -S durableApprovalSatisfied -- src/node-host/exec-policy.tsconfirms the durable-approval branch's history; its behavior remains covered and unchanged. Follow-up deletion work for #135868. Production +28/−48, net −20; tests/tooling/docs unchanged.User Impact
No intended behavior change. Node-host commands keep the same execution permissions and diagnostic results.
Evidence
src/node-host/exec-policy.test.ts:52(deny),:68(ask-always despite durable trust),:96(unapproved allowlist miss),:113(Windows guidance), andsrc/node-host/invoke-system-run.test.ts:3101(durable trust rerun).node scripts/check-changed.mjs: exit 0, including typechecks, lint, dead exports, import cycles, and repository guards.8875e438d6b7c795423da21e516936c16120d481: no findings, security concerns, or requested rank-up changes. Maintainer source review agrees.