Repository navigation
fix(agents): avoid yield failures in automation turns - #185445
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 691f47a563
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs changes before merge. What this changesThis PR lets automation turns end through sessions_yield while the scheduler retains responsibility for child-output delivery. Example: Scheduled job yield-job calls sessions_yield while handing off a publisher child.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains The collection-guidance repairs are present, but the previously reported terminal-finalization defect remains and needs repair before merge. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherScheduled jobs enter the agent runtime with automation context; the yield tool ends model execution, and runner finalization prepares output for scheduler delivery. flowchart TD
A[Scheduled job] --> B[Automation turn context]
B --> C[Agent tools]
C --> D[Requester yield owner]
D --> E[Runner finalization]
E --> F[Scheduler delivery]
G[Child completion] --> F
Technical reviewBest possible solution: Carry the scheduler-owned terminal outcome through the existing yield callback and runner finalization while preserving diagnostics for unsupported interactive yields. Do we have a high-confidence way to reproduce the issue? Current-main source explicitly refuses automation yields; on this head, an accepted empty yield reaches the unchanged no-continuation diagnostic, although no target code was executed during review. Is this the best way to solve the issue? Using the existing yield owner and removing duplicated filters is appropriately small, but the scheduler-owned outcome must survive the complete runner lifecycle. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 15c2e6838f1c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource -8, Tests +197, Docs +9. Total +198 across 19 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 27, 2026, 2:10 AM ET / 06:10 UTC (Revision 2). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d96fea60a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@clawsweeper re-review Both collection-guidance findings are repaired on 35634ac. The PR body records the owner tests, unchanged line-cap limits, clean P1 Codex review, and green exact-head CI. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Jump 8 of the absorb-8083 line: one merge of upstream openclaw/openclaw main 7fdf69f (477 commits, 3,070 files past U7 96da011) into the j7 head 1b92f87. Schema: upstream state 34 -> 35 (shared workspace CAS) is taken as is; our agent 38 (recipient authority) stays above upstream's unchanged agent 37. U8 did not touch the agent schema, its SQL, catalogs or port descriptor. 18 conflicts, resolved upstream-first: - subagent-announce: upstream's terminal-reply summary import beside our moved flow types. - subagent-registry-restore: upstream's retainRestoredCompletionReservation (openclaw#185549) owns restart recovery, cancellation, mismatch and orphan release; spawn custody (H1/F1) rows are skipped before it in both restore loops, so they keep their requester reservation for the sweeper exactly as in j7. isRestoredSubagentRunOwnedElsewhere now covers spawn custody only. - subagent-registry-sweeper: upstream's settleSubagentCompletionReservation and restart-drain stop; the H1 custody branch stays ahead of settlement and retired authority (non-mismatched rows only, as j7 skipped mismatches first), and the drain stop is ported into the extracted collector-group sweep. - session.ts: upstream moved the lifecycle-mutation types and preprocessing state out; our nextLifecycleRevision field moves with the type. - tool-resolution: both sides removed one import each (our catalog factory, upstream's requester-yield filter, openclaw#185445). - system-events test: upstream's file-level hooks plus our restore tests. - state-port PG test: upstream 135 tables + continuation_records = 136. - package.json schemaVersions: state 35, agent 38. - lint-suppressions, database-worker core paths: union. - plugin-sdk surface budgets: upstream + the fork's measured +11/+4. - generated files regenerated with config:docs:gen, db:postgres:gen and db:worker-inventory:gen, not hand-merged. Refs karmaterminal/openclaw-bootstrap#1727 Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(agents): end automation turns successfully on yield * test(agents): regenerate automation yield prompt snapshots * fix(agents): preserve automation collection guidance with yield * fix(cron): explain automation yield in turn context
What Problem This Solves
Peter asked “wth is yield failed” after a scheduled automation called
sessions_yieldwhile waiting for a publisher child. The tool returnedAutomation turns cannot use sessions_yield because no requester continuation is availableand told the model to finish the turn so the scheduler could handle child output. That normal handoff appeared as a red failure row.User Impact
Automation calls now return
status: "yielded"and end through the ordinary yield callback, without another model request. The scheduler keeps delivering child output under the job's delivery policy. Ordinary user yields, collector final-result requirements, and deferral for unobserved asynchronous tool results remain intact.Why This Change Was Made
The yield owner returns a scheduler-owned outcome before registering interactive claims. The obsolete tool filter is removed from all three internal tool surfaces, keeping the session catalog uniform. Parents needing synthesis retain
collect=true/agents_waitguidance even when yield is exposed. The unattended-run message explains the end-turn contract for all automation placements, including an existing session, without changing that session's system prompt or tools.The focused scheduler proof uses existing fixtures and a synthetic channel adapter: a child completes after yield,
noneretains the result without sending, andannouncedelivers exactly once. The double-announce test file is unchanged. New collection-guidance cases live in the delegation owner test;system-prompt.test.tsremains net zero lines. Documentation describes when to collect results before ending the turn.No config, dependency, version, persisted-shape, migration, or deployment changes. No live Gateway or real user state was used. Ending without pending children is accepted; parents needing synthesis must collect before yielding.
Evidence
e93a1b0d1370941e0b016d4c0455d8efeb2a5a51: the actual embedded Agent automation regression failed with expectedyielded, receivederror; eight existing cases passed. With the fix, the turn ends after one model request.node scripts/run-vitest.mjs src/agents/delegation-guidance.test.ts src/agents/system-prompt.test.ts src/agents/embedded-agent-runner/run/attempt.sessions-yield.test.ts src/agents/openclaw-tools.requester-yield.test.ts src/cron/execution-context-tool-policy.test.ts src/cron/isolated-agent/delivery-dispatch.automation-yield.test.ts src/agents/tools/sessions-yield-tool.test.ts src/agents/agent-tools.prefix-stability.test.ts --maxWorkers=1.node scripts/run-vitest.mjs src/cron/run-prompt.test.ts src/cron/session-run.test.ts src/agents/agent-tools.prefix-stability.test.ts --maxWorkers=1PASS: 3 files / 29 tests, including all 13 prefix-stability cases, on35634ac39a126308cd3b5c8c7bef7723a2821799. Fresh P1 Codex branch review is scoped-clean with no actionable P0/P1 findings. Exact-head CI is green: both requiredopenclaw/ci-gatechecks areSUCCESS(CI run 40457415786).git diff --checkpass. Earlier targeted lint passed; the later local lint preparation timed out generating plugin-sdk declarations before lint ran. The required exact-head CI gates pass on the final head, covering lint and type validation. The local preparation timeout is retained as a local proof limitation.node --import ./scripts/tsx.mjs scripts/generate-prompt-snapshots.ts --checkpassed:Prompt snapshots are current (6 files). No budget, baseline, or ratchet changes.Change size: 19 files, +287/-89 (net +198). Production: +38/-46 (net -8); tests including generated fixtures: +240/-43 (net +197); docs: +9.