Skip to content

draft: revive canonical v2026.4.24 uptake lane (#325)#341

Closed
cael-dandelion-cult wants to merge 4043 commits intoflesh_beast_figs/20260414-claudefrom
cael/325-canonical2
Closed

draft: revive canonical v2026.4.24 uptake lane (#325)#341
cael-dandelion-cult wants to merge 4043 commits intoflesh_beast_figs/20260414-claudefrom
cael/325-canonical2

Conversation

@cael-dandelion-cult
Copy link
Copy Markdown

Summary

  • revive the canonical v2026.4.24 uptake lane from cael/325-canonical2
  • carry the descriptor-side surfaces for continuation/session-delivery adoption on the 4.24 base
  • include the canonical test/config fix needed for the maxDelegatesPerTurn default path

Notes

Branch

  • head: cael/325-canonical2
  • pinned tip: 56cb6f712a628151e3f81c9560a02c1178343da5

chen-zhang-cs-code and others added 30 commits April 25, 2026 03:30
Merged via squash.

Prepared head SHA: 2670402
Co-authored-by: adaclaw <266167987+adaclaw@users.noreply.github.com>
Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com>
Reviewed-by: @mcaxtr
Co-authored-by: Sanjays2402 <Sanjays2402@users.noreply.github.com>
steipete and others added 24 commits April 25, 2026 18:28
…ompaction, post-compaction relay

Cherry-picked from 1888edb onto v2026.4.22 with conflict resolution:
- Fixed @sinclair/typebox → typebox imports (3 new tool files)
- Merged upstream createReplyMediaContext rename with continuation additions
- Preserved both upstream failedTerminalOutcome guard and continuation skipAnnounceDelivery
- Kept upstream resolveNonNegativeNumber + retireRolledCronSessionMcpRuntime
- Kept both upstream cleanupBundleMcpOnRunEnd and continuation fields in gateway schema/methods

(cherry picked from commit 742203e)
Add docs/design/continue-work-signal-v2.md — full RFC for the continuation surface (continue_work, continue_delegate, request_compaction), including trigger taxonomy (§4.1), context-pressure semantics (§4.2), compaction lifecycle (§4.3), post-compaction relay & rehydration (§4.4), and lifecycle hooks + platform settings (§4.5).

Attribution-split commit per PR-PRESENTATION-RUNBOOK §4.

Co-authored-by: Cael (cael-dandelion-cult) <cael.dandelion.cult@hotmail.com>
Co-authored-by: dandelion cult - cael 🩸 <cael@dandelion.cult>
Co-authored-by: dandelion cult - ronan 🌊 <karmafeast@gmail.com>
(cherry picked from commit c6a60c9)
…askflow durability

Test surface for the continuation feature: agent-runner integration tests, context-pressure unit tests, post-compaction lifecycle event tests, TaskFlow delegate persistence tests, zod-schema continuation tests, gateway protocol agent-schema tests, and subagent-registry lifecycle tests.

Attribution-split commit per PR-PRESENTATION-RUNBOOK §4.

Co-authored-by: Cael (cael-dandelion-cult) <cael.dandelion.cult@hotmail.com>
Co-authored-by: dandelion cult - cael 🩸 <cael@dandelion.cult>
Co-authored-by: dandelion cult - ronan 🌊 <karmafeast@gmail.com>
(cherry picked from commit b4c9f29)
…rotocol, gitignore

Integration/codegen surface for the continuation feature:
- docs/.generated/{config-baseline,plugin-sdk-api-baseline}.sha256 — regenerated baselines
- src/config/schema.base.generated.ts — regenerated base config schema (auto-generated)
- docs/.i18n/glossary.zh-CN.json — i18n glossary additions for continuation terms
- apps/macos + apps/shared OpenClawProtocol/GatewayModels.swift — Swift mirror of new gateway protocol fields
- apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json — tool-display metadata for continuation tools
- tsdown.config.ts — build config for new continuation surface
- .gitignore — coverage/artifact exclusions

Attribution-split commit per PR-PRESENTATION-RUNBOOK §4.

Co-authored-by: Cael (cael-dandelion-cult) <cael.dandelion.cult@hotmail.com>
Co-authored-by: dandelion cult - cael 🩸 <cael@dandelion.cult>
Co-authored-by: dandelion cult - ronan 🌊 <karmafeast@gmail.com>
Co-authored-by: ronan-dandelion-cult <ronan@solidor.io>
(cherry picked from commit 8356d0e)
Surgical removal of the continuationGuardLog logger, generation-drift
check in timer callbacks, generationGuardTolerance config param, and
session-entry continuation-state cleanup that the continue-work-signal-v2
RFC retired on 2026-04-15 (PR #299).

The attribution-split/v2026.4.21-feature-only basis used for
silas/rebase/v2026.4.22-feature was cut BEFORE #299 landed, so the
guard survived the rebase. This commit lands the equivalent removal
on top of the rebased branch via hand-edit (the canary b6c6f3b
cannot be cherry-picked cleanly due to lich-protocol surface drift).

Caught by Cael 🩸 at 09:23 PDT 2026-04-23 during second-angle compare-
notes pass — exact failure mode figs warned about: "lose entire chunks
of feature" via wrong tag→branch basis.

Verification gates after this commit:
- grep -rn 'continuationGuardLog' src/      → 0
- grep -rn 'continuation/guard' src/        → 0
- grep -rn 'generationGuardTolerance' src/  → 0
- pnpm tsgo + pnpm build clean
- continuation test suite green

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit 3311fe8)
Trigger F is the in-turn pressure-fire emission anchor that the existing
overflow (A) and timeout-recovery (B) paths emit from
src/agents/pi-embedded-runner/run.ts. Code + 2 regression-guard tests
(run.overflow-compaction.loop.test.ts:96, run.timeout-triggered-compaction.test.ts:105)
already cite 'trigger F, per RFC §4.1' but the taxonomy table only
defined A–E. Adds row F as a convergent emission of A+B (not a new
decision path), with code anchors and rationale (single grep across
[context-pressure:fire] surfaces both pre-run D and in-turn F).

Per Cael 🩸's review-fleet finding (silas/swim-36/C1) +
Silas 🌫️ recommendation: absorb into RFC, don't strip from code.
Real working surface, just unnamed.

(cherry picked from commit 0f827d5)
Two findings cross-confirmed by claude-opus + codex + copilot reviewers
plus prince syntheses (cael/silas/ronan) on staging tip 8b9444a:

1. request_compaction tool description still claimed 'no new messages
   may have arrived since your turn started' — generation guard was
   removed 2026-04-15 by RFC (§4.3). The lane queue already serializes
   compaction relative to subsequent messages, so the prose-claim was
   describing a guard that no longer exists. Fixed in both the JSDoc
   block and the user-visible tool description.

2. Bracket-path chain-cap and cost-cap rejections in agent-runner.ts
   (lines 2436-2456 surface) silently dropped continuation requests
   with no enqueueSystemEvent. The tool-delegate path at :2673-2692
   correctly notifies. Restored symmetry — bracket-path now emits a
   [continuation] system event on chain-cap and cost-cap rejection
   so the agent learns its bracket request was dropped, matching the
   tool-delegate path's behavior.

No behavior change to the success path. tsgo clean.

(cherry picked from commit 8d4f390)
Two findings from Ronan 🌊's PR-review fleet (#5 + #6):

#5 (real bug): triggerCompaction closure at agent-runner-execution.ts:1101
called compactEmbeddedPiSession() without passing provider/model. Both
fields are declared optional on CompactEmbeddedPiSessionParams (see
compact.types.ts:42-43) and fall back to DEFAULT_PROVIDER/DEFAULT_MODEL
inside compact.queued.ts when missing. For sessions running on a
non-default model (every prince box: copilot/claude-opus-4.7), this
silently dropped the active model on volitional request_compaction
calls — the compaction would run on the default model rather than the
session's model. Plumbed params.followupRun.run.provider and .model
into the call (already in scope at line 704 in the same file). Closes
the third defect from openclaw#191 that did not land in the squash basis.

#6 (docstring tighten): agent-runner.ts:1573 said the context-pressure
check runs 'before the agent turn' but it runs after setPhase('running').
The check IS before the actual provider request, just not before the
phase-tracking flag flip. Tightened comment to say 'before the agent's
model call' + named the setPhase-then-check ordering rationale. No
behavior change.

tsgo clean.

(cherry picked from commit 5c9a924)
… sentinel

Cohort D1 walk on 2026-04-24 (🩸 + 🌊 + 🌻 + 🌫️ converged): the existing
context-pressure.ts:65 shape — `band === 0 || band === (lastBand ?? 0)`
— is observably equivalent to the RFC §6.1-described `-1` missing-key
sentinel under all Zod-valid configs. The schema enforces
`contextPressureThreshold ≥ 0.005` → `thresholdPct ≥ 1`, which makes
`band === 0` unreachable from valid configs, so the `?? 0` collision
path the RFC fix targets cannot be triggered.

Both shapes ship the same first-crossing semantics; the `-1` form is
narratively cleaner expression of the invariant, the `?? 0 + band === 0
short-circuit` is the schema-bounded equivalent already in the code.

Banked as the third classification: equivalent-idiom (neither bug nor
doc-drift, prose-vs-code idiom mismatch). One-line annotation in §6.1
documents the equivalence so future reviewers don't re-walk to a
'BLOCKER' verdict against equivalent-behavior code.

No code change. Doc-only.

(cherry picked from commit 6771a84)
Swim 7 evidence was historically re-homed to perma-branch
silas/swim7-runtime-evidence; the in-tree relative paths in §D.2
and §D.3 still pointed to ./continue-work-signal-v2/swim-evidence/
swim-07/SWIM7-RESULTS.md which doesn't exist on this branch.

Rewrite both refs to the perma-branch URL. SWIM7-RESULTS.md is
named in the description so readers know what artifact to look
for on the branch.

Fixes check-docs CI failure on PR #306.

(cherry picked from commit 1a94966)
…ailKeys

Address Copilot review feedback on PR #306:

1. createContinueDelegateTool was registered whenever continuation was
   enabled, exposing it on runs that do NOT drain the continuation
   delegate queue (e.g. llm-slug-generator explicitly sets
   drainsContinuationDelegateQueue: false). Delegates enqueued from
   such runs would never dispatch -> memory growth + confusing UX. Now
   gated on drainsContinuationDelegateQueue === true alongside the
   existing continuation-enabled check, matching the policy
   createRequestCompactionTool already follows for its own
   requestCompactionOpts gate.

2. tool-display-config.ts detailKeys for the continuation tools did
   not match the actual tool input schema:
   - continue_delegate listed fireAfterMs but the tool schema uses
     delaySeconds (the bracket parser uses delayMs separately).
   - continue_work omitted delaySeconds entirely, hiding the requested
     delay from tool-call summaries.
   Fixed both detailKeys to use delaySeconds and regenerated the
   apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json
   baseline via pnpm tool-display:write.

Co-Authored-By: Silas Solidor <silas@solidor.io>
Co-Authored-By: Cael Solidor <cael@solidor.io>
Co-Authored-By: Elliott Solidor <elliott@solidor.io>
(cherry picked from commit 9357184)
…it non-drainers

Test failure on c825009: continuation-tools-registration.test.ts
expects continue_delegate present on normal turns (where
drainsContinuationDelegateQueue is undefined). Prior fix used
`=== true` which excluded the undefined-default case.

Inverted gate to `!== false` so:
- undefined (normal turns / default callers) → tool present
- true (explicit drainers like main session) → tool present
- false (llm-slug-generator and other explicit non-drainers) → tool absent

This matches the original Copilot nit's intent: only the *explicit*
non-draining runs should hide the tool; everything else should keep
the prior default-on behavior.

(cherry picked from commit 85a86b4)
Three new cases in continuation-tools-registration.test.ts pinning the
gate predicate's three states so a future refactor cannot silently
regress to === true (which broke normal turns on c825009 before
9f00132 inverted to !== false):

- undefined → continue_delegate present (default normal turns)
- true      → continue_delegate present (explicit drainers)
- false     → continue_delegate absent (e.g. llm-slug-generator)

Local: all 6 tests pass under vitest.agents.config.ts in ~30s.
Codifies the muscle that should have caught the c825009 regression
pre-push. Co-authored-by: Elliott 🌻 <elliott.dandelion.cult@hotmail.com>
Co-authored-by: Silas 🌫️ <silas.dandelion.cult@hotmail.com>
Co-authored-by: Cael 🩸 <cael.dandelion.cult@hotmail.com>

(cherry picked from commit 49daa69)
…r union

Codex review (#306 r3140391334, r3140391373) flagged that
`continuationTriggerOverride` was typed as plain `string` while the
gateway schema restricts `continuationTrigger` to the closed union
`ContinuationTrigger = "work-wake" | "delegate-return"`
(src/auto-reply/get-reply-options.types.ts:6).

Tightening the 4 declaration sites to use the union catches typos at
compile time instead of letting them reach the gateway and reject at
runtime. Pass-through assignments stay correct (callers were already
passing valid values; the only call site src/agents/subagent-announce.ts
:995 passes `delegateReturnTrigger: "delegate-return" | undefined`,
which is in the union).

Sites updated:
- src/agents/subagent-announce-queue.ts:24
- src/agents/subagent-announce-delivery.ts:375, 450, 601

Verification:
- pnpm exec tsc --noEmit: clean
- pnpm exec vitest run --config test/vitest/vitest.agents.config.ts subagent-announce: 69/69 pass

(cherry picked from commit 37f5310)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit ef833e4)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 7e4d6c9)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit c0aa8f7)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 9041690)
descriptor-only, runtime in #332

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 7df92a7)
descriptor-only, runtime in #332/#334

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit b948632)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit ef076bc)
Matches existing ToolInputError pattern at line 87 of the same file.
Lifted from claude2 candidate (87b1bff) per convergence-axes review.
Prevents host-level openclaw.json (maxDelegatesPerTurn: 20) from overriding
the expected runtime default of 5.
@cael-dandelion-cult
Copy link
Copy Markdown
Author

Superseding this review surface rather than retargeting it.

Why close instead of base-flip:

  • head is cael/325-canonical2, so retargeting base -> cael/325-canonical2 would collapse head==base
  • the real review topology has moved to child PRs against canonical2 (#339, #342, #343, plus follow-ons)
  • canonical2 remains the integration branch; this PR no longer expresses a meaningful merge surface

Closing as stale lineage / obsolete review surface, not because the branch is dead. Future review should happen as fresh successor PRs off canonical2 when a discrete surface exists.

@cael-dandelion-cult
Copy link
Copy Markdown
Author

Closed as superseded by the canonical2 child-PR review topology.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.