Skip to content

fix: goals created mid-turn stop after delegated work - #183706

Merged
fuller-stack-dev merged 13 commits into
openclaw:mainfrom
HermanZeng:fix/goal-created-during-turn
Oct 29, 2026
Merged

fuller-stack-dev merged 13 commits into
openclaw:mainfrom
HermanZeng:fix/goal-created-during-turn

Conversation

@HermanZeng

@HermanZeng HermanZeng commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #183705

Current published candidate

bd1798a, tree 76c97d0aa721ee59884375ebc7cd3b77c2130d16, preserves HermanZeng's published history. Its parent 4f3d736 integrates the previous published 895 head with main 90a5029. The conflict resolution retains both sets of Goal-test imports and all of main's continuation-authority behavior.

Against that main, the PR remains nine Goal production/test/helper paths (+982/-23), with no configuration, dependency or test-budget allocation. The final follow-up removes only 11 lines of fully subsumed assertions: the later, broader revoked-stream check and identical provider counters still run after a real positive publication. All distinct early history, chat-silence, sibling-denial and provider-cancellation checks remain.

Verification and remaining merge gates

  • Independent peer review of bd is complete with no findings. Additional API-based review is INCOMPLETE; an assignment-corrected rerun remains pending and mandatory before merge. Publication does not imply that review passed.
  • New-head CI is pending. No passing result from a previous head is substituted for bd's required type, lint, runtime, baseline, security or dependency checks. The earlier successful 895 run is retained below as historical evidence.
  • The affected real-source Gateway authority test passed 1/1 in 28.944 s (110.79 s wall), including current-role restrictions, sibling denial, actual socket cancellation on revocation, and the authorized-publication/revoked-nondisclosure control.
  • The 78 owner tests and direct/delegated/queued Gateway regression passed on 4f. Their production/test/fixture inputs are unchanged in bd and that evidence is reused, not described as a new aggregate run.
  • Focused type-aware lint, formatting and diff checks passed. The actual local native counter against main 90a passed at 6,272,482 / 6,326,764, slack 54,282, with main's ceiling unchanged. This is not a prediction of the later CI merge-tree count.
  • Local bundling still reported unresolved externalization warnings for the gateway-client's @noble/hashes imports. The exercised Goal path passed; fresh-install CI must establish the wider dependency/type coverage. No local reinstall or packaging-success claim is made.

These are source-Gateway tests with scripted external-provider decisions, not new shipped-runtime, hosted-model or Windows proof. Historical failed exercises and their limitations remain below. Merge remains held for complete API review and current-head CI.

Historical published evidence and failed CI — not current-head results

Historical published 895 evidence

The following successful CI evidence belongs to head 895, not the current bd candidate.

Closes #183705

Historical integration

Published head 895f1f5, tree 2475e5698c8b199288c63b5e909e49062bfd7749, is a normal merge of published 461391d and pinned main 8a3c02c. HermanZeng's published history is preserved.

Main has fixed both failures from CI run 40800636327: #187162 restores its 6,320,000 test-line ceiling, and #187144 supplies the required braces in the inherited Slack-route test. The advisory max-lines warnings were not the lint failure. This integration takes both upstream fixes unchanged. The obsolete unpublished local repair was discarded before publication; this PR adds no budget allocation or admission-test change.

Against the pinned main, the scope remains the same nine Goal production/test/helper files, all byte-identical to the published 461391 candidate. The actual native counter on this integrated tree passes at 6,246,948 / 6,320,000, with 73,052 remaining under main's unchanged ceiling. No tests were deleted, moved, minified or skipped.

Verification and limits

  • New focused checks of materially changed upstream inputs passed: 54/54 session-controller watchdog tests and 37/37 canonical SQLite shared-state worker tests, two shards, exit 0. These cover late assessment versus Stop/deadline/revocation and worker authority, cancellation, retirement and FIFO behavior. Diff checks passed.
  • Current-head CI passed production and test type checks, all lint and baseline-ratchet checks, runtime, security and dependency checks. The actual Goal Gateway cases passed: authority/revocation 1/1 (20.144 s) and direct/delegated/queued continuation 1/1 (18.397 s), both exit 0.
  • CI tested merge ed0312327863e9320e29407e594cf7dc2809626a against main 5228f24. Its actual test-line count was 6,246,985 / 6,320,000, with 73,015 slack. This is distinct from the pinned local-tree count above; main owns the unchanged ceiling in both.
  • The inherited brace-fixed admission file is identical to the previously audited and tested 18-case file and to main. No duplicate local production or test repair was added.
  • Exact-candidate independent review is READY, and CI run 40806654694 completed successfully on this published head. The native CI observer reported GREEN and the final rollup had no failed or pending checks. No PR merge is implied. Historical shipped-runtime, hosted-model and Windows proof limitations remain below; failed runs remain failed.

All wording and counts below refer to their named historical candidates. The current published head and CI status are identified above.

Closes #183705

What this fixes

A Goal created during an admitted chat turn can stop after delegated work returns. The change binds that Goal to the existing return owner while preserving committed-yield, session, Stop, budget and current-operator checks. It adds no scheduler or autonomous command engine.

Historical correction and integration

Candidate: 461391d (tree f9a603610c6ad92a94d53a621483a9db0f50d2d5). Its direct parent is the required main-integration merge 5090795, whose ordered parents are 70d9f73 and main cb5a438.

HermanZeng's original history is preserved. The required main merge resolved two actual conflicts: it retains main's existing test-line ceiling and its current real actor-admission consumer fixture, including every distinct failure, transcript, registry and no-model-execution assertion. No unrelated production change was authored.

Verification

  • 79 selected tests passed across five files on the integrated parent: two consumer tests, 75 Goal-owner tests, and both maintained real-Gateway regressions; the invocation exited 0. The final correction removes only an obsolete Goal-return mock from the context-read test, restoring main's exact real-owner fixture. Both affected consumer tests were then rerun and passed (2/2, exit 0). The unchanged Goal/Gateway production and test bytes retain their integration proof.
  • The maintained cases cover direct, delegated and genuinely queued Goal creation, one automatic continuation, and exactly one final reply in the requester's subscribed session.message stream and canonical history.
  • Revocation cancels the held producer before stale work is released, without later provider, sibling-session or Goal-completion effects. A separate real administrator chat.inject publication reaches the authorized observer and history exactly once while the revoked subscription receives no late content. A client may reconnect read-only; the tests do not require permanent disconnection.
  • Focused source lint passed for six test/helper files and five production files. Formatting and whitespace checks passed. The integrated test count is 6,244,060 / 6,320,000, using main's ceiling unchanged.
  • This is source-Gateway proof with scripted external-provider decisions, not a new shipped-runtime or hosted-model exercise. Local dedicated typechecking was blocked before checking by the shared compiler-location guard. The published head's CI production and test type checks have now passed.

Exact-candidate independent review: READY for preparation at 461391d, with both coverage gaps and the obsolete context-read mock resolved. CI: run 40800636327 completed with two independent failures; this is not an all-green result. Production/test types, Goal runtime checks, security and dependency checks passed. No merge is implied.

  • Lint failure: a missing brace at src/agents/tools/sessions-send-tool.admission.test.ts:722, in a file unchanged from main. The two max-lines annotations are warnings, not this failure's cause.
  • Test-line failure: CI tested merge 799e7feacab2f0562f40c84fb675fb63c9e545e8 against main 64cb114, which adopted main's newer ceiling of 6,243,924. The actual CI count was 6,245,665, over by 1,741, with a PR delta of +920. The earlier local check used the older integrated main ceiling; it is not substituted for this failed CI measurement. No new reserve or automatic ceiling increase has been applied.

Historical hosted-driver failures remain failures; real-model revocation/reassignment was not exercised, and the earlier Windows alias-close timeouts are not claimed repaired by these source checks.

Prior-head evidence and retained failure history

The following text is the prior published description. Its “current” wording applies only to its named historical commits, not to the candidate above.

Closes #183705

What Problem This Solves

An unfinished Goal created during a chat turn can stop after delegated work returns. Bind the actual newly created Goal to the existing admitted return owner, retaining committed-yield, current-session, cancellation and operator-authority checks.

Evidence

Historical budget-only follow-up

Current head 03b8a7485c6f3ffd86f6c1082413989d4d5ac51d, tree
3035ced419595b71cd357cfe0ef281bcfd9fab6e, has the single published parent
583ffe10b822eb26dd1133f322bd71c148bfb839. Only the test-line ceiling changed;
all production/test blobs and the counting/authority contracts remain unchanged.

The three scoped session PRs now deliberately use identical 6,313,000
single-line ceilings. Two latest actual comparison runs measured
6,311,267 / PR delta +617 and 6,311,148 / delta +498, respectively; each still
exceeded its prior small ceiling by 90 after queue-time base movement. This
does not invent a completed failure for this PR's then-running parent check.
All original failures and pending-state observations are retained below.

Same-pattern Git numstat checks confirm the three retained test additions occupy
disjoint paths and total 617 + 498 + 694 = 1,809. Both observed CI totals
minus their PR deltas imply 6,310,650, so the explicit planning is
6,310,650 + 1,809 + 541 = 6,313,000. This is arithmetic, not an independent
main measurement or combined-tree/runtime test. The bounded one-time 541 reserve
addresses observed queued-base movement, and identical budget bytes avoid mutual
scalar conflicts between these changes. No automatic increase or future-fit
guarantee is introduced. The native owner permits manual increases with a PR
justification; no coverage, checker, assertion or timeout was removed.

This unchanged corpus retains its actual native count 6,311,232, giving
arithmetic slack 1,768 under the new ceiling. The native scalar parser,
identical-byte/unchanged-corpus checks and whitespace checks passed; the count
was reused rather than newly executed. Normal commit hooks ran. Independent
P0-P3 review of all three budget-only deltas and the helpers found no actionable
finding (Codex-app narrative assessment, inherited model identity unverified;
not CLI/helper attestation). New-head CI remains an independent gate.

The model evidence stays bound to cba507: independently confirmed mid-turn Goal
creation, a real child/yield, restricted-member sibling denial, one automatic
continuation, and the final reply published/persisted. The combined driver still
exited 1 and remains failed because of its documented chat-vs-durable-message
observation mismatch. B was not run; real-model revocation/reassignment proof
remains missing.
No new model call, accounting reset or new-head runtime proof
is claimed. Both older failed model attempts and Windows timeouts remain below.

Retained prior-head implementation, validation and failed proof history

The following description is retained as a historical record for its named commits. Its original “current”, “now” and “final” wording refers to those earlier candidates, not to the integration identified above. Earlier failures remain failures; earlier green CI is not current-head CI.

Closes #183705

What Problem This Solves

An unfinished Goal created during a chat turn can stop after delegated work returns. Bind the actual newly created Goal to the existing admitted return owner, retaining committed-yield, current-session, cancellation and operator-authority checks.

Evidence

Historical candidate and the measured CI budget repair

Current head: normal merge 583ffe10b822eb26dd1133f322bd71c148bfb839, tree
ea7f196bdf9c518bafcf569553a5a8757667b0aa, with ordered parents published
cba507bae47aa6027fd98170bc9b7e1bdd9aecdb and fixed main
a9b037d25c98aefd761ddb9bdcb0636d92ebe540. This integration addresses the
specific completed CI failure below, not merely a newer main tip. No history was
rewritten and no additional functional repair was made.

The exact cba507 CI job
used synthetic merge dc8e14af9d72904f31eff71f4ea894f6a20ba135 against that
same fixed a9b037d base. Its only independent failure was 6,311,232 test
lines / ceiling 6,310,560 / PR delta +694 / over 672
; the other red check was
the aggregate gate. All nine other independent baseline checks passed. The
maintained classifier labeled it new, not inherited or a model/runtime defect.
The original failed job and its log remain retained.

Main had replaced the old commented reserve with the single-line 6310560
ceiling. Its observed check was skipped, so that scalar is not called an
independent measured main count. The normal merge was conflict-free and preserved
all incoming changes. The only manual edit raises that ceiling to 6,311,254,
exactly the retained +694 regression lines; this follows the owner's explicit
manual-increase-with-PR-justification policy. The actual local integrated native
counter passed at 6,311,232, leaving 22 slack, independently matching the
earlier CI total. No test, assertion, checker or timeout was removed or weakened.

The full new-base delta is eleven files: ten feature/test files plus the budget.
Every feature/test blob matches the reviewed cba507 candidate exactly. Their
upstream path OIDs also match between the old and fixed new base. Whitespace
checks passed, normal commit hooks ran, and independent P0-P3 integration review
found no actionable issue. It reused the prior complete feature/owner review and
independently verified every frozen blob, staged/working scope, budget and
publication route. This was a Codex-app narrative assessment with inherited
model identity unverified, not CLI/helper or enforced-isolation attestation.

Transitive upstream inputs changed. The earlier build, type/test results and
model captures retain their named source commits rather than becoming executions
of 583ffe10; no new runtime build or real-model call is claimed for this merge.
New-head CI remains a separate gate.

Real-model proof: supported A facts and the remaining B gap

The real-model exercise remains bound to the tracked-clean cba507 source
identified in the retained record below. It made nine HTTP 200 requests with
complete output/usage retained and settled. Independent public-event and
read-only stopped-persistence checks confirmed actual mid-turn Goal creation,
one real child and correlated native yield, the real main-only member's sibling
tool denial, exactly one automatic Goal continuation, Goal completion, and the
same final text published to that member as durable session.message and stored
on the same canonical branch. No sibling session was created.

The combined driver still exited 1 and remains failed: its final marker wait
incorrectly required text inside a terminal chat event after the native owner
had already handed that text to durable session.message. The recorded terminal
event had no message, while actual member publication and persistence contained
the exact final response. This evidence does not establish missing product
delivery; the failed result is not rewritten as a passing combined run.

B never started and the real-model revocation/reassignment proof remains
outstanding.
No revocation call, retained-return cancellation or post-revocation
effect observation is claimed. Controlled response delay, native WebSocket rather
than browser proof, bounded/owned cleanup and unchanged stopped database hashes
retain their original limitations. The earlier two failed model attempts and
Windows alias-close timeouts are also preserved below. No further model attempt,
accounting reset, forced history update, hosted re-review or merge is implied.

Retained prior-head implementation, validation and failed proof history

The following description is retained as a historical record for its named commits. Its original “current”, “now” and “final” wording refers to those earlier candidates, not to the integration identified above. Earlier failures remain failures; earlier green CI is not current-head CI.

Closes #183705

What Problem This Solves

An unfinished Goal created during a chat turn can stop after delegated work returns. Bind the actual newly created Goal to the existing admitted return owner, retaining committed-yield, current-session, cancellation and operator-authority checks.

Evidence

Historical integration and proof status

Current candidate: normal merge cba507bae47aa6027fd98170bc9b7e1bdd9aecdb,
tree 62de539fe524a809e2591b7cebf8df1d9fde8cb3. Its ordered parents are
98679a804ab787cb598b8d90979094da8eaf9f2c and fixed main
a1859e5195f6e74f1980192bdf291c0193e940a1. No history rewrite or further
moving-main integration was performed. The sole content conflict adopted main's
unchanged 6,310,000 test-line ceiling and complete reserve explanation; it adds
no new budget exception to this candidate.

The ten-file change remains five production owners (+72/-22) and their focused
tests/consumer fixture (net +694 test lines). Nine files are byte-identical to
the previous head. The remaining execution file retains main's optional
recoveryMemoryFlushAttempted input and the original Goal-return change; the
five-file production patch has the same stable patch-id before/after integration.
Transitive admission, memory-flush/overflow recovery, child wake/query, spawn and
authority-projection inputs did change upstream. This is not a claim that the
entire runtime input graph was unchanged or that old-head CI covers this merge.

Independent full ten-file P0-P3 review, including the owners/callers, found no
actionable findings. It was an approved Codex-app narrative subagent assessment
with inherited model identity unverified, not a CLI/helper pass or enforced
isolation attestation. The previous focused tests and type graphs retain their
named historical source identities below; they were not repeated just to obtain
green output on an unchanged feature delta. Current-head CI remains separate.

The integrated native test-line check passed at 6,305,277 / 6,310,000, with
4,723 slack on this fixed local tree. The integrated assertion SAFETY ratchet
also passed: 2,406 files / 5,477 grandfathered assertions. Whitespace checks
passed. These are current local checks, not an unobserved CI synthetic-merge
count or a claim of fresh current-head type-graph execution.

Exact-head shipped Gateway and real-model evidence

Normal own-worktree frozen dependency installation and the maintained CLI build
completed with Node 24.22.1 / pinned pnpm 12.15.0. The default runtime build is
not a strict typecheck. Both native producer stamps name this tracked-clean
cba507bae47aa6027fd98170bc9b7e1bdd9aecdb; effective build input signature
041bb95d4bb174f564a6d94700ea08240a278839b62faa6c9847316a2a68692b
and runtime signature
dc0868a69fa60eb3d9a98385552761986f22a7fbbe4745eff0dc0feae1379c1d
matched their producer stamps, and native preparation required neither rebuild.
No stamp, authority check, TLS verification or production code was modified for
this proof.

A separate zero-model setup passed 46 assertions: actual administrator and two
member profiles, member read/write scopes without administrator authority, no
gateway-owner identity fallback, real public sibling-session denial, no sibling
effect, and normal owned cleanup. It made no hosted-model requests.

The subsequent real qwen3.8-flash combined attempt exited 1 and remains
failed
. It made nine physical HTTP 200 requests (eight parent, one child),
77,644 input / 488 output tokens, all with complete model output and reported
usage retained/settled. All content was synthetic. The native public WebSocket
client used a certificate-pinned fixture TLS front and the normal shipped
Gateway; this was not browser/Control UI, fleet, restart or real-channel proof.

Independent offline inspection of the immutable request/response captures,
actual public events and a read-only copy of stopped SQLite state nevertheless
established the following completed A flow on one canonical history branch:

  • A real main-only member created a Goal mid-turn, spawned one actual main child
    (raw sequence 9), and received a correlated native yielded receipt (13).
  • The actual sibling sessions_create tool call (18) received the owner denial
    (19); the sibling database contained no session nodes.
  • The requester returned an unfinished interim reply. The automatic Goal nudge
    appeared at sequence 22, the Goal completed with continuation count exactly
    one, and the observed session had no active run.
  • The final real-model text was persisted at raw sequence 30 and published as
    the same session.message to both the member and administrator observers
    (event orders 311 / 309). It exactly matched the final retained model output.

The failed driver's final-delivery wait required the marker inside chat final.
For this same continuation run, terminal chat events did arrive (313 / 314), but
contained no message because the native owner had already handed the committed
text to durable session.message publication. Native buffer/publication source
contracts and stopped persistence corroborate that observation-surface mismatch;
it is not evidence that the product failed to deliver the final reply. The
driver's original global failure phase was overwritten by asynchronous provider
assertions, so that saved label is not used as a precise wait-site diagnosis.
The original failed result is not rewritten into a passing combined run.

The child response was deliberately delayed only after its unmodified real body
was fully retained and usage settled, until public correlated yielded / active
Goal facts existed. No model decision, tool result or continuation instruction
was fabricated. This is controlled-boundary proof, not undelayed performance.
Original stopped database/WAL/SHM hashes were unchanged by independent inspection.
Owned cleanup joined with all admitted requests drained and no forced provider
abort or reported cleanup error; it does not certify global descendant exit.

B never started: no model request, role-revocation call, retained-return
cancellation observation or post-revocation final-effect proof occurred. The
original review's real-model revocation/reassignment requirement therefore remains
outstanding. Successful A observations do not close it. Both earlier failed model
attempts and both unexplained Windows configured-alias-close timeouts remain
retained below; no retry, longer timeout or green replay erases them.

Retained prior-head implementation, validation and failed proof history

The following description is retained as a historical record for its named commits. Its original “current”, “now” and “final” wording refers to those earlier candidates, not to the integration identified above. Earlier failures remain failures; earlier green CI is not current-head CI.

Closes #183705

What Problem This Solves

Fixes an unfinished Goal stopping after delegated work returns when the agent created the Goal during that same chat turn.

User Impact

Users can keep pursuing an explicitly requested Goal across a same-process child handoff without sending another message to restart it. There is no schema/configuration migration, restart recovery extension, or new autonomous capability for independent commands or scheduled turns.

Why This Change Was Made

The existing return owner captured only Goals present before execution. Keep that owner unbound for an admitted built-in chat, then bind the actual create_goal result once to the current run/session/agent/store. Retaining the return still requires a committed yield; the existing queue, current Goal, cancellation, budget, and authority checks continue to decide whether another turn may run.

Evidence

Repair and Validation Status

Current repaired candidate: 98679a804ab787cb598b8d90979094da8eaf9f2c, integrating the final bounded snapshot f39b480c874d8acdae73f3b1c060dbd6cfc7a052. The preceding bdefe28105a066bf29a8565972140be3b947c9e4 integrated the observed CI comparison snapshot 23b53fd33fcd0fbaaf62546db23fb032541c9bdc into de7fed4b39fdfdd5f0b0c736d914533fbbed5e42; a subsequent upstream budget edit caused the sole conflict resolved by this final integration. Earlier, de7fed4 integrated fixed main a6be2f6aee7fd9782563d54e33e4b60995853008 into 70159c5dc95809b55cb60713a558d871ef08ecad, retaining both upstream placement coverage and the lifecycle-generation helper at its import conflict. No history was rewritten. All nine original PR files remain byte-identical to de7fed4; the only additional changes are the consumer fixture and justified test budget below. The five production-file changes are unchanged.

The focused Goal regression, type, and static gates below passed at the preceding candidate. CI subsequently found a missed consumer fixture and a test-line budget failure; their repair and the retained local failure are reported next. The additional hosted-model exercise did not satisfy all requested proof conditions. In particular, a successful shipped-runtime, real-model automatic-continuation demonstration and a real-model restricted-operator final-effect demonstration are still outstanding. These partial/failed exercises are not evidence of a newly identified production defect, and this update does not claim that all review feedback is resolved.

CI follow-up: real consumer owner and explicit test budget

CI on de7fed4 found Operation has no controller owner in the existing subagent cohort-conflict regression. Initially Goal-less admitted chat now enters the real Goal return owner, but that consumer fixture supplied an unregistered operation double. The fixture now creates the existing real controller operation with its captured physical store/session target, observes the real failure method through a call-through spy, and completes/joins owner settlement. Every original registry-conflict, visible-error, transcript, and no-model-execution assertion remains. No production owner or authority check was relaxed, and no Goal-wrapper mock was introduced.

The corrected case passed in the original three-file infra group (7.532 s). The command as a whole returned exit 1: 43 passed, one failed, because the unmodified refuses held row facts after configured-alias close case timed out after 120 seconds on Windows. That same case had passed in the original CI job; this does not prove an inherited or platform-only defect. Static investigation found isolated fork workers and no new collection-time controller registration from this fixture, but the stalled await remains unidentified. No timeout was raised, test removed, or green replay substituted. The messaging test type graph, focused lint, formatting and whitespace checks passed. The local run used Node on Windows, not CI's Bun/Linux scheduling.

One bounded diagnostic ran only that failed alias-close case on the final fixed f39b480 integration inputs; it also timed out after 120 seconds (one failed, 14 explicitly filtered cases). This is a different base from the first local group, not an identical-source replay. It does not establish a preceding-file cause, a Windows-only cause, or a repaired failure. The precise blocked await remains unknown. Both failed local receipts and the wrapper's conservative retained-namespace warnings remain recorded; no further replay or production workaround was added.

The separate ratchet job failed on positive test-line growth. The first fixed CI-snapshot integration measured 6,286,460 total lines and passed its explicit zero-slack budget check. After resolving the subsequent upstream scalar conflict on the final fixed f39b480 snapshot, the native checker measured 6,286,640 total lines with a +694 PR delta. The final deliberate ceiling change is exactly 6,285,587 to 6,286,640, with zero slack: 694 retained regression lines plus 359 lines already beyond the ceiling in the comparison tree. That split is arithmetic, not an independent failing run of main. The documented owner permits manual increases with a PR justification. No guard was disabled or required coverage deleted; the native checker passed after the edit.

The new fixture received an independent full-context P0–P3 agent review, and the mechanical integration/budget change received a separate independent assessment. Neither found an actionable issue; neither is a CLI/helper pass. Current-head hosted CI remains separate from the previous failed run and these local receipts.

Passing Local Evidence

  • Historical local Gateway/tool/child-return baseline: a pre-existing Goal continued once and completed; the otherwise matched model-created Goal received no Goal context or nudge and remained active after the child batch committed and Gateway work drained.
  • The Gateway regression passes actual create_goal -> sessions_spawn -> sessions_yield -> committed requester final -> Goal nudge -> complete, plus a non-yield final control: delegated parent/child requests 6/1, direct 4/0, exactly one continuation in each, no provider errors.
  • Added actual Gateway authority coverage with identified users and configured roles: a member restricted to main receives the real sibling sessions_create denial, creates no sibling session, and completes one Goal continuation. After a separate member's role is revoked through users.setRole, the held provider socket is actually cancelled; no subsequent provider requests, sibling session, Goal completion, or normal post-revocation assistant chat delta/final content is observed. This is a fixed-provider Gateway regression, not a real-model authority proof.
  • At de7fed4, Goal owner/tool suites: 73 passed (66 + 7). Both Gateway tests passed. Affected consumers and provider-prefix tests passed across eight files; their combined test total is not asserted because one summary was truncated in the captured output.
  • At that preceding candidate, production and affected messaging, agent-tools, and Gateway canonical test type graphs passed. Focused lint, format, and diff checks passed for all nine original PR files. The first lint run found six missing-brace style errors in the new authority test; all were repaired without changing conditions, assertions, or ordering, and the final static checks passed.
  • Independent P0–P3 subagent review of the full repaired nine-file candidate against the fixed main snapshot found no actionable findings. The CLI reviewer was unavailable and produced no report. The alternative review was explicitly approved for this PR and is not a CLI pass; the subsequent brace-only delta also received mechanical review.

These Gateway tests use a scripted loopback Responses provider. They are not hosted-model, real-channel, restart, local Codex, or production-scale proof. Hosted CI for the repaired candidate and its CI duration are not established by these local runs.

Hosted-Model Exercise: Partial Evidence, Both Attempts Failed

Both exercises used an isolated shipped dist/index.js Gateway process, the built-in OpenClaw agent runtime, actual public native CLI/WebSocket RPC with the current client version, and Alibaba Bailian qwen3.8-flash. All task content was synthetic. This was not a browser/Control UI exercise, and no production service or operator state was used.

The tested source was the tracked-clean preceding candidate de7fed4b39fdfdd5f0b0c736d914533fbbed5e42, not the current CI-follow-up head. Native preparation reported build:false and runtime:false, and the effective build/runtime input fingerprints matched that source. The unchanged producer stamps still record precommit producer HEAD 70159c5dc95809b55cb60713a558d871ef08ecad with inputsClean:false. This is supported source-equivalent artifact reuse for that source, not a claim that the artifacts were freshly built at either repaired commit. No new model call accompanied the CI follow-up.

  1. First model attempt: failed, seven HTTP 200 requests. The trace records real create_goal, sessions_spawn, one child request, sessions_yield, requester return, and later requests containing the automatic Goal nudge, including update_goal. The final harness assertion failed. That original capture omitted the exact assertion phase, last public Goal row, and final receipt, and its isolated state was cleaned. Two response-time ordinal labels also overlap. Consequently, neither completed Goal state nor successful final delivery can be inferred, and this trace is not a passing automatic-continuation proof.
  2. One diagnostic attempt: failed, six HTTP 200 requests. With a real authorized sessions.messages.subscribe observer and named assertion diagnostics, the public Goal was complete, its continuation count was 0, and the final marker was caller-visible. One child request and a real yield occurred, but no automatic Goal nudge occurred. The model instead completed the Goal during the requester child-return, contrary to the synthetic task's instruction to leave an unfinished interim phase. It therefore did not exercise the required automatic-continuation case. This is not attributed to a production defect. The client, Gateway, remote I/O, and accounting writes were joined; only stopped synthetic state was retained privately before normal cleanup.

There were 13 physical hosted-model requests, all HTTP 200 with usage reported: 96,997 input tokens and 1,164 output tokens. No further model attempt was made. Private credential configuration and account/budget accounting are not part of this public evidence.

The failed artifacts and accounting are retained locally; no public hosted-model proof artifact is claimed. The unmet proof requirements above remain explicit.

Reproduction, scope, and historical evidence

Original tested source base: ab68862753db1c083bf4bac921d642b4e194631b; Node 24.22.1 on Windows 11. The core Goal tool/continuation files remained byte-identical in the later upstream snapshot originally checked, and both callers still required a pre-existing Goal. That was a source check, not runtime proof of that later snapshot.

The earlier 70159c5dc95809b55cb60713a558d871ef08ecad validation recorded 74 owner/tool tests, 53 consumer/provider-prefix tests across seven files, and both import-cycle checks passing. Those are historical results, not substituted for the current 73-test owner/tool result or a new import-cycle run.

Current focused reproduction commands:

node scripts/run-vitest.mjs run src/auto-reply/reply/goal-continuation.test.ts src/agents/tools/goal-tools.test.ts --maxWorkers=1
node scripts/run-vitest.mjs run src/gateway/chat-goal-created-yield.e2e.test.ts src/gateway/chat-goal-created-authority.e2e.test.ts --maxWorkers=1

In the repaired-candidate run, the original Gateway test body took 26.687s and the authority test body 84.342s; the combined Vitest run took 268.39s. Its cold wrapper took 1,226.24s, including a successful 826.6s runtime build. These are local measurements, not CI timings. Historically, the original Gateway test alone took 31.110s of test time / 55.64s Vitest wall time, with an initial cold 57.085s / 143.89s run including compilation/import.

The original Gateway test reuses one Gateway for delegated and direct routes because helper mocks cannot prove the actual tool run ID, async scope, persisted child handoff, and subsequent queue drain. The separate authority regression likewise reuses one Gateway for its current-role and revoked-role scenarios; it does not add a production authority seam.

The context-read consumer originally used an unregistered operation double to isolate a Goal-less persist-before-native-queue race. Its Goal wrapper is explicitly isolated; its original assertions remain unchanged. Goal/controller composition stays covered by the Goal owner suite and actual Gateway regressions. No production lifecycle check was relaxed to accommodate that double.

The change reuses the existing owner and removes the initial-Goal-only selection, rather than adding another scheduler or stored return state. Against the current fixed main snapshot, the production delta remains +72/-22 lines; tests are +699/-5, including the original 225-line Gateway composition, the added 370-line authority regression, and the existing consumer fixture repair. The explicit test-budget adjustment is one additional configuration line.

@clawsweeper

clawsweeper Bot commented Oct 25, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: M labels Oct 25, 2026
@HermanZeng
HermanZeng marked this pull request as ready for review October 25, 2026 16:22
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 70159c5dc95809b55cb60713a558d871ef08ecad, but the PR head is now 98679a804ab787cb598b8d90979094da8eaf9f2c. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (1 earlier review cycle)
  • reviewed 2026-10-25T16:40:44.542Z sha 70159c5 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 28, 2026
@fuller-stack-dev
fuller-stack-dev merged commit 9e86c84 into openclaw:main Oct 29, 2026
136 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
Keep Goals created during admitted chat turns connected to the existing continuation owner.

Bind the newly created Goal to its matching run, session, agent and physical store. Resume through the existing queue only after committed return, preserving current operator authority, cancellation and budget checks. No new scheduler or autonomous command engine.

Maintained source-Gateway regressions cover direct, delegated and genuinely queued Goal creation, exactly one continuation and final subscriber/history delivery, sibling denial, provider cancellation after revocation, and a positive publication control with no revoked disclosure. Independent parent-red/head-green verification and exact-head CI are recorded in PR openclaw#183706.

Co-authored-by: Jason (Json) <[email protected]>
Co-authored-by: VACInc <[email protected]>
Co-authored-by: yxshee <[email protected]>
Co-authored-by: Masato Hoshino <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
Co-authored-by: Marvinthebored <[email protected]>
Co-authored-by: Solvely-Colin <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Shakker <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Pat <[email protected]>
Co-authored-by: Akshit Khokhani <[email protected]>
Co-authored-by: HeZzz <[email protected]>
Co-authored-by: jalehman <[email protected]>
Co-authored-by: xiaopan-xydt <[email protected]>
Co-authored-by: Milan Patel <[email protected]>
Co-authored-by: MoerAI <[email protected]>
Co-authored-by: Jay Zhou <[email protected]>
Co-authored-by: KJH <[email protected]>
Co-authored-by: Ted Li <[email protected]>
Co-authored-by: libaojiang <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: xydigitLybnnnn <[email protected]>
Co-authored-by: gideonpraise <[email protected]>
Co-authored-by: jbax1899 <[email protected]>
Co-authored-by: Edo Sulaiman <[email protected]>
Co-authored-by: Jason O'Neal <[email protected]>
Co-authored-by: 555aaditya <[email protected]>
Co-authored-by: Max Johnson <[email protected]>
Co-authored-by: LiuwqGit <[email protected]>
Co-authored-by: YangManBOBO <[email protected]>
Co-authored-by: Terwox <[email protected]>
Co-authored-by: Glucksberg <[email protected]>
Co-authored-by: Francisco Novella Fletcher <[email protected]>
Co-authored-by: Alix-007 <[email protected]>
Co-authored-by: PollyBot13 <[email protected]>
Co-authored-by: Arthur Pinheiro <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: HootRock <[email protected]>
Co-authored-by: hehuang139 <[email protected]>
Co-authored-by: Taksh <[email protected]>
Co-authored-by: sunlit-deng <[email protected]>
Co-authored-by: Leon-SK668 <[email protected]>
Co-authored-by: potoior <[email protected]>
Co-authored-by: Michel Settembrino <[email protected]>
Co-authored-by: ayaangazali <[email protected]>
Co-authored-by: Eric Cai <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Chris Eckert <[email protected]>
Co-authored-by: xydigitLybnnnn <[email protected]>
Co-authored-by: Miles <[email protected]>
Co-authored-by: Brian McGuire <[email protected]>
Co-authored-by: Shoaib <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
Co-authored-by: Takhoffman <[email protected]>
Co-authored-by: JIRBOY <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
Co-authored-by: obviyus <[email protected]>
Co-authored-by: MumuTW <[email protected]>
Co-authored-by: stevenlee-oai <[email protected]>
Co-authored-by: alkor2000 <[email protected]>
Co-authored-by: jacobtomlinson <[email protected]>
Co-authored-by: Nicolas Keil <[email protected]>
Co-authored-by: Holger Gruenhagen <[email protected]>
Co-authored-by: Aaron08140 <[email protected]>
Co-authored-by: wangmiao0668000666 <[email protected]>
Co-authored-by: Andrea Sforna <[email protected]>
Co-authored-by: Wesley <[email protected]>
Co-authored-by: eleqtrizit <[email protected]>
Co-authored-by: Sukhdeep Johar <[email protected]>
Co-authored-by: creanet-64 <[email protected]>
Co-authored-by: scotthuang <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Co-authored-by: luyifan <[email protected]>
Co-authored-by: Daniil Karpenko <[email protected]>
Co-authored-by: HeZ2z <[email protected]>
Co-authored-by: paulcam206 <[email protected]>
Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: Anmol Bhardwaj <[email protected]>
Co-authored-by: TorstenW <[email protected]>
Co-authored-by: lijing <[email protected]>
Co-authored-by: Krasimir Kralev <[email protected]>
Co-authored-by: xialonglee <[email protected]>
Co-authored-by: hugenshen <[email protected]>
Co-authored-by: openclaw-agent-man <[email protected]>
Co-authored-by: OpenClaw Agent Man <[email protected]>
Co-authored-by: Dillon McCoy <[email protected]>
Co-authored-by: Stronggenetics <[email protected]>
Co-authored-by: holgergruenhagen <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
Co-authored-by: MertBasar0 <[email protected]>
Co-authored-by: Avnish Kirnalli <[email protected]>
Co-authored-by: Hankyeol Kyung <[email protected]>
Co-authored-by: Samuel Benainous <[email protected]>
Co-authored-by: chelsealong <[email protected]>
Co-authored-by: shakkernerd <[email protected]>
Co-authored-by: jjjhenriksen <[email protected]>
Co-authored-by: Jason O'Neal <[email protected]>
Co-authored-by: Vito Cappello <[email protected]>
Co-authored-by: Sedrak Hovhannisyan <[email protected]>
Co-authored-by: etzelm <[email protected]>
Co-authored-by: Vyctor H. Brzezowski <[email protected]>
Co-authored-by: TheAngryPit <[email protected]>
Co-authored-by: Jason Sy <[email protected]>
Co-authored-by: Hannes Rudolph <[email protected]>
Co-authored-by: Rogério Chaves <[email protected]>
Co-authored-by: hannesrudolph <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Dave Lauer <[email protected]>
Co-authored-by: JustYannicc <[email protected]>
Co-authored-by: yinx65588-boop <[email protected]>
Co-authored-by: Vito Cappello <[email protected]>
Co-authored-by: ceckert <[email protected]>
Co-authored-by: TheAngryPit <[email protected]>
Co-authored-by: wangmiao0668000666 <[email protected]>
Co-authored-by: eliavb43 <[email protected]>
Co-authored-by: boeingchoco <[email protected]>
Co-authored-by: Aniruddha Adak <[email protected]>
Co-authored-by: Eric Curtin <[email protected]>
Co-authored-by: mike1122real-hub <[email protected]>
Co-authored-by: ceckert <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: Paul Bohm <[email protected]>
Co-authored-by: ywj <[email protected]>
Co-authored-by: CodeMiner-掘金安东尼 <[email protected]>
Co-authored-by: JasonBuildAI <[email protected]>
Co-authored-by: Jaxon Parrott <[email protected]>
Co-authored-by: maliv2 <[email protected]>
Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Beru <[email protected]>
Co-authored-by: Brad Cleaver <[email protected]>
Co-authored-by: SunnyShu <[email protected]>
Co-authored-by: JasonBuildAI <[email protected]>
Co-authored-by: Scott Hanselman <[email protected]>
Co-authored-by: Zn <[email protected]>
Co-authored-by: Vitor Cepeda Lopes <[email protected]>
Co-authored-by: Links <[email protected]>
Co-authored-by: Erick Kinnee <[email protected]>
Co-authored-by: sallyom <[email protected]>
Co-authored-by: nxmxbbd <[email protected]>
Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: joshavant <[email protected]>
Co-authored-by: ruel225 <[email protected]>
Co-authored-by: Pavel Zun <[email protected]>
Co-authored-by: xpeng5278-web <[email protected]>
Co-authored-by: LiLan0125 <[email protected]>
Co-authored-by: dwc1997 <[email protected]>
Co-authored-by: ablake4427 <[email protected]>
Co-authored-by: SunnyShu <[email protected]>
Co-authored-by: Harjoth Khara <[email protected]>
Co-authored-by: Aniket Kumar <[email protected]>
Co-authored-by: ferres <[email protected]>
Co-authored-by: htuyer121 <[email protected]>
Co-authored-by: zijunl <[email protected]>
Co-authored-by: Wang Rui <[email protected]>
Co-authored-by: Brandon Julio Thenaro <[email protected]>
Co-authored-by: rodricksz4h5 <[email protected]>
Co-authored-by: RJ <[email protected]>
Co-authored-by: shannon0430 <[email protected]>
Co-authored-by: shannon0430 <[email protected]>
Co-authored-by: kybrcore <[email protected]>
Co-authored-by: Victor <[email protected]>
Co-authored-by: momothemage <[email protected]>
Co-authored-by: wuqingxuan <[email protected]>
Co-authored-by: xiabee <[email protected]>
Co-authored-by: Yuaneen <[email protected]>
Co-authored-by: CHANGAO MA <[email protected]>
Co-authored-by: Cameron Vetter <[email protected]>
Co-authored-by: Dmitriy <[email protected]>
Co-authored-by: 肖盼0668001048 <[email protected]>
Co-authored-by: AmelioMansour <[email protected]>
Co-authored-by: mikasa0818 <[email protected]>
Co-authored-by: L4XB <[email protected]>
Co-authored-by: gloss-dandelion-cult <[email protected]>
Co-authored-by: Daniil Karpenko <[email protected]>
Co-authored-by: dankarization <[email protected]>
Co-authored-by: Vishal Doshi <[email protected]>
Co-authored-by: Hosung Park <[email protected]>
Co-authored-by: ryan-dyer-sp <[email protected]>
Co-authored-by: Alex Babkin <[email protected]>
Co-authored-by: Marvinthebored <[email protected]>
Co-authored-by: felirami <[email protected]>
Co-authored-by: dankarization <[email protected]>
Co-authored-by: Daniil Karpenko <[email protected]>
Co-authored-by: serg0x <[email protected]>
Co-authored-by: Dylan Harrington <[email protected]>
Co-authored-by: Ricardo Almeida <[email protected]>
Co-authored-by: quqi1599 <[email protected]>
Co-authored-by: Chuanlei Guo <[email protected]>
Co-authored-by: Max Xu <[email protected]>
Co-authored-by: Miguel Branco <[email protected]>
Co-authored-by: Seth Ratner <[email protected]>
Co-authored-by: fatherkam <[email protected]>
Co-authored-by: Deltawerks <[email protected]>
Co-authored-by: Johan Rocuts <[email protected]>
Co-authored-by: lonexreb <[email protected]>
Co-authored-by: goutamadwant <[email protected]>
Co-authored-by: Vyctor H. Brzezowski <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>
Co-authored-by: 0668000539 <[email protected]>
Co-authored-by: LeizhenZhang <[email protected]>
Co-authored-by: Heming Zeng <[email protected]>
Co-authored-by: pstarkgit <[email protected]>
Co-authored-by: Leo Stehlik <[email protected]>
Co-authored-by: 宗佐 <[email protected]>
Co-authored-by: songc <[email protected]>
Co-authored-by: liqiang2 <[email protected]>
Co-authored-by: Omar Shahine <[email protected]>
Co-authored-by: Demos Ra <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>
Co-authored-by: xyi74976-del <[email protected]>
Co-authored-by: 肖盼0668001048 <[email protected]>
Co-authored-by: LinzeShi <[email protected]>
Co-authored-by: SC-10749 <[email protected]>
Co-authored-by: Jaxon Parrott <[email protected]>
Co-authored-by: Jim Lui <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: fuller-stack-dev <[email protected]>
Co-authored-by: SeungTaek Lim <[email protected]>
Co-authored-by: Zimo Xu <[email protected]>
Co-authored-by: Matt Schwartz <[email protected]>
Co-authored-by: MarMarLabs <[email protected]>
Co-authored-by: bajiaoshan <[email protected]>
Co-authored-by: Massimo Balestrieri <[email protected]>
Co-authored-by: licheer-zte <[email protected]>
Co-authored-by: PollyBot13 <[email protected]>
Co-authored-by: Mike <[email protected]>
Co-authored-by: Nice De Cc <[email protected]>
Co-authored-by: InsanusMokrassar <[email protected]>
Co-authored-by: Andrew Bowlds <[email protected]>
Co-authored-by: ben.li <[email protected]>
Co-authored-by: Yun. <[email protected]>
Co-authored-by: yinx65588-boop <[email protected]>
Co-authored-by: GrahamMcBain <[email protected]>
Co-authored-by: amittell <[email protected]>
Co-authored-by: grootbro <[email protected]>
Co-authored-by: qingminlong <[email protected]>
Co-authored-by: levonti <[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 gateway Gateway runtime P2 Normal backlog priority with limited blast radius. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Goals created during a chat stop after delegated work returns

2 participants