Skip to content

fix: warn agents when background commands cannot wake them - #158884

Merged
VACInc merged 2 commits into
mainfrom
fix/goal-stops-after-progress
Sep 26, 2026
Merged

VACInc merged 2 commits into
mainfrom
fix/goal-stops-after-progress

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

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 poll before ending the turn, unless another continuation is already arranged. The warning reaches both ordinary tool responses and Code Mode's structured followUp result.

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 notifyOnExit value 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

  • Regression through the real exec/process tools and process supervisor, with only child execution controlled by a deferred adapter: the notification-disabled case failed on unchanged production code because the warning was absent; all 6 tests pass with the repair. The enabled setting remains a passing control, and the returned process handle can collect the terminal result.
  • Test cost (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 job checks-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 was scoped-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.
  • Flake triage: the expected pre-fix assertion failure reproduced the missing warning; no intermittent failure observed across the focused and sibling runs.
  • Selected check:changed lint/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 on e4df63fce1d59c01b372a69195e327802c75b298, with both required openclaw/ci-gate results successful. ClawSweeper reviewed that same head with no actionable or security findings and nothing listed before merge.
  • No live-model adherence claim, UI appearance change, Gateway restart, or deployment.

Reported by @VACInc.

Work sessions

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 26, 2026 12:39
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: S labels Sep 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 9:13 AM ET / 13:13 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: e4df63fce1d59c01b372a69195e327802c75b298

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair has policy controls, a useful regression, documentation, and reported exact-head CI success.
Proof confidence 🌊 off-meta tidepool Not applicable: The bot-authored PR is exempt from the contributor real-setup proof gate. Its regression exercises the production exec and process tools with a controlled child adapter and reports the warning after the fix; it does not claim live-model adherence. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The bot-authored PR is exempt from the contributor real-setup proof gate. Its regression exercises the production exec and process tools with a controlled child adapter and reports the warning after the fix; it does not claim live-model adherence. No stored-data contract changes.
Evidence reviewed 7 items Introduced behavior: The PR uses the effective notifyOnExit value to select guidance, then places it in both the visible running result and structured followUp field.
Current-main gap: Current main uses the same generic follow-up text for the running result and followUp field regardless of the disabled notification setting.
Notification owner: The existing completion path suppresses a wake when the process session has notifyOnExit disabled.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +3, Tests +44, Docs +1. Total +48 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 2 +3
Tests 1 44 0 +44
Docs 1 2 1 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 51 3 +48

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The change addresses a bounded background-command handoff failure under a non-default notification setting.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The bot-authored PR is exempt from the contributor real-setup proof gate. Its regression exercises the production exec and process tools with a controlled child adapter and reports the warning after the fix; it does not claim live-model adherence. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RoboClaw: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-26T12:53:30.851Z sha e4df63f :: needs maintainer review before merge. :: none

@VACInc
VACInc merged commit 5c351c4 into main Sep 26, 2026
209 of 211 checks passed
@VACInc
VACInc deleted the fix/goal-stops-after-progress branch September 26, 2026 13:35
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants