Repository navigation
fix: warn agents when background commands cannot wake them - #158884
Conversation
Co-authored-by: VACInc <[email protected]>
|
🦞👀 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. |
Co-authored-by: VACInc <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 9:13 AM ET / 13:13 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch adds a notification-policy warning to background command results and structured follow-up guidance, with documentation and regression coverage. Merge readiness✅ Ready for maintainer review Current main still omits the disabled-wake warning. The related open PR addresses a different background-command handoff case, and this review found no blocking defect in the current patch. Priority: P2 Review scores
Verification
How this fits togetherThe exec tool returns a process handle when an agent's command continues in the background. Its result reaches the agent as text or Code Mode details, and the process tool can later collect the outcome. flowchart LR
A[Agent command] --> B[Exec tool]
C[Completion wake setting] --> D{Wake enabled?}
B --> D
D -->|No| E[Poll warning]
D -->|Yes| F[Normal follow-up]
E --> G[Text and structured result]
F --> G
B --> H[Process session]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +3, Tests +44, Docs +1. Total +48 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the policy-specific guidance at the exec result producer and preserve the existing notification and polling behavior. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows that a background exec with notifyOnExit disabled returns generic guidance in both result surfaces; the PR reports a regression assertion failing before the fix. This review did not execute the test. Is this the best way to solve the issue? Yes. The exec result producer already knows the effective notification setting and owns both result surfaces, so the warning fits there without another scheduler or configuration path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 380a77a86f6a. LabelsLabel changes: No label changes. Label 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)
|
…158884) * fix(exec): explain disabled completion wake in background results Co-authored-by: VACInc <[email protected]> * fix(exec): keep disabled-wake guidance tool-alias neutral Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: VACInc <[email protected]>
Related: #120414
What Problem This Solves
Fixes a missing handoff warning when an agent backgrounds a command with
tools.exec.notifyOnExit=false: the result previously gave the same generic follow-up instructions as notification-enabled execution, so an unfinished task could stop after a progress-only final with no event to resume it.User Impact
Agents now receive an explicit no-wake warning and instructions to collect required results with a bounded
process pollbefore ending the turn, unless another continuation is already arranged. The warning reaches both ordinary tool responses and Code Mode's structuredfollowUpresult.This is a model-facing handoff repair, not a guarantee of model compliance or a new automatic goal scheduler. Notification settings, process lifetime, approval policy, quiet-success behavior, and goal state are unchanged. No operator configuration change is required.
Why This Change Was Made
Use the same effective
notifyOnExitvalue that controls command completion notifications to select the follow-up guidance. Keep the guidance in the existing result rather than adding global prompt instructions, another tool, or a scheduler. A persisted active goal is not itself a continuation source. The appended warning refers to the poll action, leaving the existing follow-up prefix free to name a runtime-specific tool alias.The related PR improves general visible running-state wording; this change specifically exposes the disabled-notification policy in structured results as well.
Evidence
pnpm test src/agents/bash-tools.exec-liveness.test.ts --maxWorkers=1): 38.91 s before / 26.59 s final wall time, including fresh worker compilation (27.17 s / 20.54 s). Test bodies totaled approximately 170 ms / 169 ms; the new cases take 10 ms combined after the fix. These are cold compilation measurements, not a claimed performance improvement. The regression adds no real sleeps, polling loops, processes, Gateway boots, or worker configuration. On exact-head CI jobchecks-node-changed-compact-large-3, the six test bodies took 0.194 s total; the two new cases took 0.007 s combined.$test-audit: the new cases protect the effective-policy warning on both tool-result surfaces and an actionable collection handle; no new production test seam or duplicate helper-only proof.$deslop: inspected all changed hunks; no behavior-neutral cleanup or unresolved slop finding.$autoreview: initial independent P3 review wasscoped-clean; the final candidate review identified an index-only hard-coded tool name and explicitly verified the working-tree correction. That reviewed correction is now committed; no unresolved finding remains.check:changedlint/typecheck/guard checks passed, including core and all 25 selected core-test typecheck graphs; 19/19 background-exec follow-up, liveness, and notification-policy tests passed. The final alias-neutral wording was rechecked with the 6/6 liveness/regression tests and targeted lint; unchanged type/guard and sibling proof was retained. Exact-head CI run 36243101583 completed successfully one4df63fce1d59c01b372a69195e327802c75b298, with both requiredopenclaw/ci-gateresults successful. ClawSweeper reviewed that same head with no actionable or security findings and nothing listed before merge.Reported by @VACInc.
Work sessions