fix(gateway): dedupe exec followup continuations#82717
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Real behavior proof Next step before merge Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 842e6f16437c. |
da50bd0 to
0f05565
Compare
|
Proof for the rewritten fix:
The first raw Crabbox attempt lacked Node and was setup-only ( |
0f05565 to
cc5fff0
Compare
02ec834 to
1eaac9f
Compare
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Co-authored-by: Miya <miya@Miyas-Mac-mini.local>
Summary
expectFinalpath with explicitagent.waithandling for accepted gateway runs, avoiding direct fallback duplicates while the agent continuation is still running.Verification
pnpm -s format -- src/gateway/server-methods/agent.ts src/gateway/server-methods/agent.test.ts src/gateway/server-maintenance.ts src/gateway/server-maintenance.test.ts src/agents/bash-tools.exec-approval-followup.ts src/agents/bash-tools.exec-approval-followup.test.tsgit diff --check origin/main...HEADnode scripts/run-vitest.mjs src/agents/bash-tools.exec-approval-followup.test.ts src/gateway/server-methods/agent.test.ts src/gateway/server-maintenance.test.ts -- --reporter=verbose/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode branch --base origin/main-> clean, no accepted/actionable findings reported.Real behavior proof
Behavior addressed: Duplicate async exec approval follow-up continuations when approval retries use different nonce idempotency keys.
Real environment tested: AWS Crabbox Linux lease synced from this PR branch after Node 22 runtime setup; provider=aws, leaseId=cbx_43f0ff1be053, slug=silver-lobster, run=run_c59813d12220.
Exact steps or command run after this patch: On the AWS Crabbox lease, ran the approval follow-up scenario command with
env CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 node scripts/run-vitest.mjs src/agents/bash-tools.exec-approval-followup.test.ts src/gateway/server-methods/agent.test.ts src/gateway/server-maintenance.test.ts -- --reporter=verbose.Evidence after fix: Terminal output from AWS Crabbox run
run_c59813d12220:Observed result after fix: The approval follow-up path now waits on accepted gateway runs instead of falling through to direct delivery; overlapping retries with a fresh nonce reuse the stable approval-id reservation and do not start a second agent command; failed pre-run reservations are cleared so a retry can start normally.
What was not tested: Live Telegram/Discord user approval with real channel credentials.