Repository navigation
feat(code-mode): send current replies without an extra turn - #119057
vincentkoc wants to merge 17 commits into
Conversation
d6eac27 to
c5f6f19
Compare
33f10ff to
e0a1c4c
Compare
c5f6f19 to
17a866b
Compare
e0a1c4c to
8a51ce7
Compare
|
Codex review: blocked before merge. Reviewed October 2, 2026, 6:20 PM ET / 22:20 UTC (Revision 60). ClawSweeper reviewWhat this changesAdds a host-authorized Code Mode reply tool, prevents duplicate final replies after delivery, and updates harness adapters, transport handling, tests, and diagnostics. Merge readiness⛔ Blocked before merge - 6 items remain Keep open: this maintainer-authored PR adds distinct behavior absent from current main. Focused boundary proof is useful, but supported-host compatibility and the earlier qualification concerns remain unresolved. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw Code Mode lets an agent compose enabled tools in a JavaScript or TypeScript cell. This change connects that execution to current-conversation delivery and carries private delivery receipts into reply finalization. flowchart TD
A[Agent Code Mode cell] --> B[Host-created reply tool]
B --> C[Check invocation and writer authority]
C --> D[Channel transport]
D --> E[Private delivery receipt]
E --> F[Reply finalization]
F --> G[Suppress duplicate reply]
Decision needed
Why: The patch narrows a released delivery contract, and the body expressly leaves SDK/security acceptance and supported-host qualification open. Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep terminal reply authority private while preserving a documented, versioned ordinary-delivery contract for supported plugins and hosts. Do we have a high-confidence way to reproduce the issue? Not applicable to the new capability. The supplied production-boundary scenarios exercise delivery and revocation, but this read-only review did not reproduce supported-host upgrade behavior. Is this the best way to solve the issue? Unclear: reusing shared message dispatch and private receipts is appropriate, but narrowing ordinary plugin delivery needs an accepted compatibility contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6ef6fc44055e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (59 earlier review cycles; latest 8 shown)
|
17a866b to
ea3c5d8
Compare
8a51ce7 to
8ad36db
Compare
ea3c5d8 to
9a44488
Compare
8ad36db to
5912113
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Punchcard-Session: brisk-workshop-harbor-jn
Add temporary opt-in phase and lifecycle diagnostics for the first models-set E2E case using the existing plugin load profiler. Keep cold imports, timeout, assertions, and execution order unchanged; this is diagnostic evidence, not a timeout root-cause fix.
Exercise embedded-runner and harness-host capability delivery through the current-turn integration paths, including authority invalidation at the actual preparation and execution boundaries.
Move shared integration support under test helpers and cover nested, outer-loop, and Host delivery boundaries with real persistence and transport ownership.
Record bounded cleanup attribution without replacing the original error or exposing state paths.
Capture allowlisted lifecycle milestones before cleanup without weakening streaming assertions or changing timeouts.
Use the existing loader diagnostics switch to distinguish lazy preparation and module evaluation without changing native or source-transform selection.
|
Closing this stacked proposal as a preservation-aware archival disposition, not as landed verbatim or fully superseded. The audit used main Focused replacements landed:
These are scoped replacements, not coverage of every supported-runtime or orchestration variant. Optional cold-model, loader, streaming, self-yield, OTel and request-shape diagnostics, plus unported orchestration fixtures, remain preserved reference work. Retired Task/heartbeat test machinery and obsolete proposed API shapes are not reasons to restore old runtime paths. Older-host fallback remains held and unqualified; the old constructorless fixture is not proof of every released host through 2026.9.2. Durable catalog exec-prefix, accepted-steering, omitted aborted-wait, replay-safety and publication assertions also remain unqualified and deferred. #135969 remains separate; restart/FULL-B and committed-result/publication recovery work are not activated or declared complete. The adapter audit included the native Codex response contract at No whole-17-commit/140-path equivalence, Beta qualification or performance claim is made. The original branch |
What Problem This Solves
Enables one host-authorized reply to the current conversation from an OpenClaw Code Mode cell without an extra model turn, while preventing retained or substituted tools from borrowing later authority.
Why This Change Was Made
The host owns the exact private tool instance, source invocation, writer lifetime, and cancellation. Same-cell terminal delivery is available only to a runtime advertising per-result terminal handling. Acknowledged or ambiguous delivery suppresses duplicate ordinary final delivery.
Permission refresh shares one atomic admission at the private completion record while rebuilding tool instances. Reservation precedes awaited preparation. Producer-recorded non-dispatch permits a retry only after preparation settles before adapter handoff; post-handoff ambiguity retains the one-shot fence. Original errors and late acknowledgements retain their meaning.
The follow-up composes real outer-loop completion with delivery and persistence. It addresses prepared custom activity whose captured parent was not passed to append, and outer-completion leaf drift after a legitimate delivery mirror. Shared repairs live in PR1; this layer supplies real-loop regression coverage and integration wiring. A newer user, writer, or lifecycle must not be adopted by the old invocation.
User Impact
The model receives explicit OpenClaw Code Mode framing, positive JavaScript/TypeScript guidance, and deterministic one-cell composition. Observation is reserved for genuine ambiguity or authority conflicts. Retained tools cannot reuse closed or replacement authority.
Stack And Scope
All five PRs remain draft. Frozen integration base:
fe1c715de7eccc5ce1ec9f7de6b2eb64c6248ad1, observed on September 11, 2026. This exact target is fixed for the proof; it is not a claim to track later moving main.2ad458b0cbfdcd4c327d11ceb5169464b53b7f546db9a7156affee1c9ee182bcf41d61e93f40d195a64afa8675245ff71ab3d954fecb625ae9b5ec567e7df513bddb6ee15f342e3fe1cd4cb94afe9d6b708809cdc2cdbb09c1184ce74838fbf283b71419Base branch:
fix/code-mode-slack-transport-stack-20260908; candidate layer base:7e7df513bddb6ee15f342e3fe1cd4cb94afe9d6b. Final composed candidate tree:ad32f67773244e30f12d07d8d634d1584a17630f. The stack has 43 signed commits and spans 359 changed paths against frozen mainfe1c715de7eccc5ce1ec9f7de6b2eb64c6248ad1. The inherited full-runtime wake repair and completion-order regression are placed in PR3; downstream layers are replayed in their existing ownership order. All 41 prior author/message/date records and reviewed replay patches are preserved after the test insertion. Reviewed main-composition adaptations are described below. Temporary diagnostic-helper commits are excluded. Focused exact-tree proof is recorded below; this is not full-stack, type, release or moving-main qualification.PR1 owns shared repairs, fixture/setup/lint and filesystem-race corrections, and stack-local npm/Workshop prerequisites; these prerequisites are not already supplied by main. PR3 owns R's released-ownership fixture; Slack owns B's Enterprise physical-transport tests.
Frozen main already contains the canonical native locale repair from PR 143928, commit
89a1abd12ff92d78e0a5d2cf22641968dce828ea. The duplicate stack commit was omitted only after ancestry and all 44 generated postimages matched; canonical contributor credit remains in main.This layer owns A, real foreign-session construction rejection with zero effects and unchanged state; C, native HTTP upload allow/revoke/lost-completion cases; and real embedded outer-loop tests for persisted activity, permission refresh, once-only mutation/reply, and next-turn isolation. The shared helper uses the bundled plugin public surface, without a new boundary allowlist or production export.
TaskFlow, streaming, and loader/models-set diagnostics remain separate from causal fixes. Self-yield passed 2/2 on
64fa; the OTel caller-context fixture repair still needs new-head execution. The predispatch diagnostic captures bounded request digests and one best-effort history summary only after the unchanged two-request assertion fails, then rethrows the original failure. No request filter, assertion, deadline, or production behavior is relaxed; the extra request's cause remains unclassified.createToolSurfaceandcommitProviderTranscriptPrefixstay independent. Requester-yield filtering precedes final wrapping; plugin namesakes and public inventory cannot supply private terminal authority. The per-instance one-shot latch remains intentional.Evidence
Full Runtime Wake Retirement And Frozen-Main Integration (2026-09-11)
Release note: full runtime close/restart now retires stale heartbeat wake work with its discarded runtime payloads. Ordinary handler replacement still preserves pending work. The repair adds lifecycle fencing, terminal waiter settlement and cancellation checks before resumed preparation, session mutation, typing and dispatch; it adds no empty-wake skip, timeout, retry or public API.
The inherited owner mismatch was reproduced on signed
59d7b211646336d042e4a5275cdcdf1d54278f00: both deterministic close/restart cases failed at the intended stale successor-call assertion (before run). On diagnostic-backed5789c87d38da11dac66c907ec350f5b19e52bbc0, all 24 lifecycle cases and the unchanged allowed/cancelled/retained Gateway prefix passed (repair run); retained notice and durable-state assertions were reached. That diagnostic tree recorded 2/0/0 physical POSTs with complete bounded correlation and cleanup. Those physical-count facts apply only to that diagnostic tree.The diagnostics-free composed tree
615c58eb2676faa936ef121fed674be0c3b59e88separately passed the same 24 lifecycle cases and original Gateway prefix (clean run). All selected cases ran with zero automatic retries; the canonical E2E private-QA build and all test/report exits passed. This proof does not transfer to the later rebase.The frozen-main integration run on
6b9bb1514c196d217af2d718d9778575b4beda7aexecuted all 207 selected cases with zero automatic retries: 206 passed and one main-added subscription assertion failed because it still expected one argument. Infra 34/34, agent support 68/68, reply lifecycle 33/33, packaging 16/16 and the original Gateway prefix 3/3 passed; embedded tests were 52/53. The SDK gate measured 4457 public exports/153 entrypoints with zero forbidden subpaths, and the canonical E2E build passed (integration run). The nonzero outcome is retained.The test-only correction on
708809cdc2cdbb09c1184ce74838fbf283b71419keeps the original media-trust matcher, explicitly requires the absent second completion-owner argument, and adds one-call and Set-reference assertions. The affected file then passed 29/29 with zero automatic retries on the corrected SHA (focused follow-up). Test, native-report and process exits were zero; its owned lease stopped. All other source bytes match the integration tree; their evidence remains bound to6b9bb1514c196d217af2d718d9778575b4beda7a, not described as a second 207-case run.The final stack is rebased onto frozen main
fe1c715de7eccc5ce1ec9f7de6b2eb64c6248ad1. Reviewed composition preserves both Windows test-list additions, combines the SDK surface at 4457 exports/153 entrypoints, retains main's migration recovery/refusal and lane-controller behavior, and ports the stack's activity/observer fencing into main's pure task publication owner. Completion performs explicit managed-cancellation reconciliation before deferred observers. A new direct completion regression checks committed task/subagent/flow visibility, exact observer count and reopened durable generation. Both cancellation tests and both subscription capability sets remain.The wake repair contributes net +95 production lines and +410 test lines, justified by full-lifecycle ownership. Its clean PR3 placement and downstream replay exclude all temporary diagnostic-helper commits. The final 43-commit signed stack preserves the prior 41 author/message/date records and reviewed replay patches, with two additional test-only integration commits. Gateway helper bytes match the prior public source.
This is focused correctness and frozen-main integration proof, not a new 48-case run, frontier comparison, Beta recommendation, supported-release/upgrade proof, typecheck or moving-main guarantee. The original 47/48 failure and subsequent diagnostic failures below remain historical evidence; the exact historical event46-to-wake31 lineage was never established. Exact-head CI/type/lint, remaining owner/upgrade review gates and landing approval remain outstanding.
Admission Trace; Original Failure Preserved (2026-09-11)
The native diagnostic run used unpublished source
6fb2b529ae05e9e68712782878f60b11a78d9a08, treed56fdd6aee6025edb35b06899acbf74873db5f78, and exact-tree carrier9f63430ec7fbf8eadf459cab268db1b48ea31005. Two planned invocations ran once each, with zero automatic test retries: isolated retained 1/1 passed, then the original allowed/cancelled/retained prefix 2/3 passed. Prefix physical POSTs were 2/0/1, three total. The original 47/48 result and its retained failure are not replaced by the isolated pass.The failing POST uniquely joins a background-task heartbeat requester and precedes the held recovery dispatch by 4,595 ms. Its requester claim was validated, but originating task authority remains unproven: the earlier cancelled-task event cannot be uniquely joined to the wake, whose pending and selected event lists were empty. Admission capture correctly remains incomplete despite no capture drops and completed cleanup. The original zero-call assertion remains red; later durable-state assertions were not reached. This does not establish a stale held-recovery dispatch or a legitimate originating-task request.
Source review separately establishes a full-close lifecycle mismatch: Gateway close stops the heartbeat runner, then drains global lifecycle state. System-event queues are cleared, but pending wake state survives. These eight relevant production files are byte-identical to frozen base
8d7c8caba1d1bbdc06dff641d4b71fcd7b318261; this is neither latest-main nor shipped-behavior proof. The repair owner is full runtime drain, preserving intentional handler-replacement retention, not an empty-wake consumer guard. No repair is published here.12 review moves remain, not 12 proven bugs; overlapping Before-merge owner/upgrade risks remain unresolved or only partially evidenced. Earlier dated evidence below remains historical. No Beta, performance, or current-main qualification is claimed. Next evidence is a deterministic full-close/wake-owner lifecycle regression, then the original prefix after an approved owner fix, not another broad or model campaign.
Focused Verification; Unresolved Failure (2026-09-10)
076c0f6da337bec075322e5c85b6b0de9cc4008b/ tree270fa87b134f9cbc1bfbbef36a0a47e7e4d0a319executed all 48 selected mock/loopback cases: 47 passed, 1 failed, 0 selected skips, zero framework retries; the wrapper's no-output retry was also disabled. QA cleanup 11/11, session mutation 22/22, observer cases 6/6, Gateway ownership 4/5, transport rejection recovery 1/1, and Slack Enterprise 3/3. The original retained-owner zero-POST assertion remains red; its later durable assertions were not reached. Initial execution and nine-case continuation are separate attempts, not one successful run.b84bb7b28d7843b4bf81daab5e240e92b098de11, retained alone passed 1/1. Ate46789e3ebfce51300f5b7676b079d4549adced0/ treef5abfd72151421e86a1ec081cde9281e916bbfee, the paired diagnostic passed retained-alone 1/1, then passed only 2/3 in the original allowed, cancelled, retained order. Separate invocations, reports and exits are preserved; no failed-case retry or assertion weakening occurred.Frozen-Main Integration; Historical Source Review
270fa87b134f9cbc1bfbbef36a0a47e7e4d0a319: three passes, no P0-P2 findings, minimum confidence 0.64. It covered the 13-path integration delta with complete supplied owner/caller context, not all 352 stack paths. The first pass explicitly limited its conclusion to its first evidence batch; all three helper passes subsequently completed. Actual report/status bytes and exact-source Git receipts are retained. Independent registry, subscription, and identity audits also passed. This is source review, not runtime qualification.414782450952a196bbb64b1605a458c2531c47b6: task replacement, exact active-owner cleanup, and cancellation, lines 320, 784, and 825; model follow-up and retry accounting, lines 305 and 1204. This is dependency-source evidence, not a new live-model trace.8fc45edc048aa7ac67d2237fd5a857408d37ce87; relevant shard/Gateway jobs executed zero steps, and no separate E2E run matched that complete head response. These are not passes. At integration publication, no runtime tests, type tests, or matched benchmark had run on the new candidate heads; the focused results above are subsequent evidence.Earlier c2d7 Integration; Historical
439d46bc20d1d85a3bf4e2acec787425c7e3157b. Its temporary report files are now unavailable; current report-byte verification is not claimed. Retained Git freeze/assembly receipts and independent exact-source verification remain available. This was not a holistic review of all 352 paths or runtime qualification.Earlier Follow-up; Historical Source Review
64facandidate: three test files, +391/-53; production delta zero. It remains in the stack, but its review and earlier CI/E2E results are historical, not execution proof for these heads.it.forcontext. Failure-only R5 and predispatch diagnostics retain the existing request filters, exact assertions, and deadlines. The retained-successor POST origin and unexpected third HTTP request remain UNCLASSIFIED; diagnostics are not causal fixes.64fa593ec6e8cc0e329f9c3d3b85ed27e81609be: P4 21/21 passed; Gateway 1,915 passed, 8 failed, 20 skipped; UI 1,995 passed; self-yield 2/2 passed. These do not qualify the new head. At that historical head, inherited static defects, including Control UI locale parity, were separate from unresolved execution causes; not every failure was classified as baseline.64fa593ec6e8cc0e329f9c3d3b85ed27e81609be; new-head execution remains pending. The three Enterprise B cases remain unexecuted and outside the approved manual CI/non-live Repo E2E inventory. A focused Testbox route awaits user approval; the broader Plugin Prerelease route remains out of scope.preparedTurnParentIdSDK draft is accepted only for the scoped repair. It is not a released-host capability claim or a landing/upgrade acceptance waiver.Historical Evidence Only
CI 34483907441 and Repo E2E 34483936399 ended red on
64fa593ec6e8cc0e329f9c3d3b85ed27e81609be: CI 184 passed, 8 failed, 2 skipped in 40m40s (seven causal failures plus the aggregate); E2E 11 passed, 3 failed, 14 skipped in 39m46s. Neither run includes the later OTel/R5 repairs, predispatch diagnostic, or this frozen-main integration.The earlier four-pass native review with zero P0-P2 findings covered only the 16-path test/support delta from synthetic comparison
b309dcd308affe0ffb0957e9c04de27a9c5336b2to64fa593ec6e8cc0e329f9c3d3b85ed27e81609be, not the full stack or runtime behavior.CI 34474484717 and Repo E2E 34474485553 ended red on prior top head
b990edc4994244ab5ef3b31e6cbae0bac0456e70. These terminal results are historical; they do not qualify the new candidate. The concrete assertion, lint, and type defects identified there are corrected in the reviewed test follow-up, with runtime confirmation pending.CI 34467941804 and Repo E2E 34467949392, attempt 1, ended red on prior top head
7bffb8c7136879b9252523695f3e043d6fc08c7d. The streaming timeout's cause remains unclassified; diagnostics do not turn it into a fixed result.Earlier CI 34456574286 and Repo E2E 34456581884 cover
152b124a53e525ed610070279f80d37738b9094c. Its acknowledged/lost-response persisted-session passes used a mock provider. They remain historical boundary evidence, not candidate-head qualification. The earlier models-set first-case timeout likewise has no claimed root-cause repair.Remaining Gates
The pre-update ClawSweeper review binds prior published head
076c0f6da337bec075322e5c85b6b0de9cc4008b. The review retains 2 requests for this layer: ordinary delivery on fresh/upgraded supported hosts plus conditional-capability SDK/security acceptance; composed-candidate qualification and classification of the acknowledged execution failures. Across the prior review set this is 12 requests (2/2/3/3/2), retained for explicit disposition, not 12 proven bugs. The full-runtime repair and focused proof advance PR3's retained-successor coverage and part of PR4's composed-failure classification; they do not silently close any request. All five Gateway outcomes, supported fresh/released/custom-runtime or rollback coverage, cost measurements and applicable SDK/security/storage/release owner decisions remain incomplete or only partially evidenced. A new exact-head ClawSweeper review is required for each changed layer; the prior-head reviews do not qualify the rebased SHAs. The earlier 11-request snapshot and 13-disposition record remain historical. Exact-head CI/type/lint and landing approval remain separate gates.Historical Rank-Up Dispositions
The earlier 13-disposition record is retained below for context; it is not the current request count or a completion claim.
The earlier retained review was previously recorded against
64fa593ec6e8cc0e329f9c3d3b85ed27e81609be, not this candidate. Its three earlier rank-up moves are preserved below. The later old-head review discharged two evidence moves using unchanged-path historical 21/21 evidence; that did not provide runtime qualification for these new heads:Release-R, storage/security/SDK-owner acceptance, real Enterprise Grid compatibility, supported-host upgrade policy, and PR3's unmeasured representative retained-history cost remain explicit stack gates. Release-qualified support is not proven.
Frontier efficacy: INCONCLUSIVE. Frontier Beta: NO-GO. Historical direct accuracy was 7/30 versus Code Mode 6/30; visible calls fell 44.4%, but total calls rose 29.9%, prompt tokens 11.6%, agent time 6.8%, and wall latency 3.3%. Beta still requires accuracy non-regression, fewer effective turns/tokens, no total-work or end-to-end latency regression, and matched auditable supported-frontier traces. No such improvement is claimed here.
Local-model preservation and LM Studio preservation remain separate, non-Beta follow-ups. No fresh Punchcard attestation or merge recommendation is claimed.