fix: elevated exec defaults across approval followups#76845
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. by source inspection, but not by a live run in this review. Current main drops Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the internal token propagation after the contributor adds redacted full-flow runtime proof and the targeted checks remain green. Do we have a high-confidence way to reproduce the issue? Yes by source inspection, but not by a live run in this review. Current main drops Is this the best way to solve the issue? Yes for the code direction: the session-bound one-use internal token preserves the existing Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c919702b8fdc. |
1d04275 to
99b0719
Compare
Real behavior proof
|
18c77d3 to
963da01
Compare
79d1d8e to
9cab83b
Compare
|
Landed via temp rebase onto
Thanks @bitloi. |
Summary
agentschema field, no approval policy changes, no new dependencies.Change Type
Scope
Linked Issue/PR
Real behavior proof (required for external PRs)
/root/74/openclawon branchfix/issue-75832-elevated-followup, commit47b4c76679, Nodev24.11.0, using production OpenClaw source modules throughnode --import tsx.PATH=/tmp/node-v24.11.0-linux-x64/bin:$PATH node --import tsx --input-type=module -e "import { buildExecApprovalFollowupIdempotencyKey, consumeExecApprovalFollowupElevatedDefaultsFromIdempotencyKey, registerExecApprovalFollowupElevatedDefaults, resetExecApprovalFollowupElevatedDefaultsForTests } from \"./src/agents/bash-tools.exec-approval-followup-state.ts\"; /* register same-session elevated defaults, consume wrong session, consume same session, try reuse */"elevated is not available right now (runtime=sandboxed)instead of requesting a fresh approval.Root Cause
bashElevated, so later elevated exec calls failed the elevated-defaults gate.Regression Test Plan
src/agents/bash-tools.exec-approval-followup.test.ts,src/agents/bash-tools.exec-host-shared.test.ts,src/agents/command/attempt-execution.cli.test.ts,src/gateway/server-methods/agent.test.tsUser-visible / Behavior Changes
Approved elevated exec follow-ups can request approval for subsequent elevated commands instead of reporting elevated as unavailable.
Diagram
Security Impact (required)
No)No)No)Yes)No)Yes, explain risk + mitigation: the command execution surface only preserves already-authorized elevated availability across the same follow-up session. The token is random, short-lived, session-scoped, one-use, internal-only, and does not carry an approval decision forward; subsequent elevated commands still go through approval policy.Repro + Verification
Environment
node --import tsx{ enabled: true, allowed: true, defaultLevel: "on" }Steps
agent:main:telegram:direct:redacted-owner.Expected
Actual