Skip to content

refactor(types): deslop type mirrors - #165225

Merged
steipete merged 3 commits into
mainfrom
deslop/l377-type-mirrors2-20261004
Oct 5, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/l377-type-mirrors2-20261004

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Related: #164286

What Problem This Solves

Internal TypeScript declarations repeat parser results, factory methods, dependency types, and option bags already owned elsewhere, creating extra places for the same contract to drift.

User Impact

No intended user-visible behavior change. Configuration keys, persisted records, wire shapes, CLI output, tool descriptions, and UI rendering are preserved. Public plugin SDK declaration changes are excluded from this batch.

Why This Change Was Made

Maintainer-directed second pass: derive each mirror from its existing owner instead of maintaining a second declaration. The batch removes 1,003 net production LOC (442 added, 1,445 removed), excluding the shrink-only ratchet updates. Deliberate leaf contracts that prevent import cycles and public SDK declarations remain in their original form.

Simplifications included
  • Infer private factory/controller results in node hosting, worker transcript delivery, agent watchdogs, UI capabilities, ClickClack activity/progress, Copilot event bridging, and QA transport/lifecycle helpers.
  • Derive parser and projection results in camera commands, node desktop inputs, Twilio responses, Memory Wiki status and claims, Discord/Slack/Telegram adapters, and QA evidence helpers.
  • Reuse canonical option and callback signatures in config/session helpers, update checks, onboarding, Gateway connections, browser operations, and TUI event handling.
  • Project existing dependency contracts for Copilot history/session methods, Playwright cookies, and the computer driver session interface, preserving intentional optionality.
  • Derive CLI option keys and UI sort/filter unions from their existing constant lists; reuse the existing model-picker option type.
  • Remove a redundant Copilot session cast and shrink its assertion-safety ratchet entry.

Evidence

Initial validation before the final main updates:

  • Independent Codex autoreview: no accepted P0–P2 findings; the final private-controller/parser increment was reviewed separately.
  • Blacksmith Testbox focused suites: 2,449 tests passed with one existing skip; the final ClickClack/Twilio increment added 101 passing tests. UI: 209 passed. Plugin contracts: 1,135 passed.
  • Core, UI, extensions, core-test shards, and extension-test typechecks passed. The subsequent equivalent provider-status alias restoration also passed core typechecking and the model-auth suite.
  • Dead-export scans and native changed CI lint passed with zero findings. Earlier checks identified the Copilot ratchet reduction and a deliberately narrower Gateway portal interface; the ratchet was shrunk and that interface simplification was removed.
  • SDK verification at df8d936af7266c7edcf2f4c8c570881f94010a43 (the later correction only annotates two UI receivers): SDK comparison reported no entrypoint, export, or reachable-declaration changes. Six SDK-visible candidate edits were removed rather than changing the public baseline. Both import-cycle checks reported zero cycles.
  • Fresh-main rebase was clean; the only intervening overlap was the shared shrink-only ratchet. Files claimed by newly opened deslop PRs were removed from this batch before publication.

Remote proof used the repository Crabbox wrapper with Blacksmith Testbox: tbx_01m44dhtbsf4d8v450b5pzv7et (focused runs), tbx_01m44hj7a2e30eczwkns0dpj87 (type/contract passes), and tbx_01m44ntj67jm4y5t3w1rv5scm0 (final validation). Command results above are the proof; Testbox workflow lifecycle status is separate.

Commands: node scripts/run-vitest.mjs <focused files>, pnpm --dir ui test <focused files>, node scripts/run-vitest.mjs src/plugins/contracts, node scripts/check-changed.mjs --base <base>, the repository's native runChangedCheck(..., { lintOnly: true }) CI route, node --import tsx scripts/check-deadcode-exports.mts, pnpm plugin-sdk:api:diff --base <base> --head <head>, and both check-madge-import-cycles.ts / check-import-cycles.ts owners.

Hosted CI found an introduced unbound-method lint regression in three existing UI consumer assertions. Commit f039c4fa8517a0cc3575762b9fdd296261e1a085 declares the two closure-only factory methods with this: void, preserving runtime expressions and existing tests. Independent review, exact consumer lint, four focused UI files (57 tests), and both cycle checks passed on Blacksmith Testbox tbx_01m44t396kn440tha66vw56dmw (correction proof). All hosted lint jobs and typecheck jobs are green on that corrected head.

The prior CI attempt on f039c4fa8517 remains red in five test jobs:

Job Observed failure Baseline evidence
checks-node-changed-compact-large-13 Doctor canonical-key suites: shared-state admission requires the host broker Same tests/error in scheduled main CI, checks-node-compact-large-18
checks-node-changed-compact-large-15 Doctor owner repair: shared-state admission requires the host broker Scheduled main job
checks-node-changed-1 Hard-kill recovery times out after 120000ms with only an inbound bus event Same failure in main-snapshot full release validation
checks-node-changed-7 Worker launch expects one assistant reply, receives two Same test/error on another current PR
checks-node-changed-8 Worker upgrade receives two assistant replies; skill-library proof misses its tool result Same failures in main-snapshot Gateway 1/4 and Gateway 4/4

Attribution resolved: the exact extra-Protocol-note quiet-window failure reproduces on the clean original main base 14bcf5e85d22201fa832069afbf113d22431a590, before this PR. See the complete comparison evidence.

Clean revision Three-run result
Original PR head f039c4fa8517 One pass, one completion-marker timeout with a generic note, one exact extra-note quiet-window failure
Fresh main eaae0fdae778 Three passes
Original main base 14bcf5e85d222 One exact extra-note quiet-window failure and two matching completion-marker timeouts with generic notes

The runs used independently installed and built Linux checkouts on one Hetzner lease. The head/main sequence was head/main/main/head/head/main. Three additional runs on CI main parent ea00cb30c661 produced a test timeout and two passes; that timeout is not claimed to match the extra-note assertion. No assertions, timeouts, retries, or skip rules were changed. Newer main has intervening execution/delivery ownership and session-read changes; no individual upstream fix is claimed.

The original 102-file production diff and the actual CI merge versus its main parent both emitted identical JavaScript using the repository's Rolldown/Oxc transformer. The final 101-file production diff also emits identical JavaScript against its rebased main. Only comments and formatting were normalized; compression and identifier mangling were disabled. Independent source/build review found no changed runtime values, parsers, switches, side-effect imports, or type-to-runtime generator path.

Configuration defaults, parsers, wire fields, and persisted-data shapes remain unchanged, including the config/upgrade/state files flagged by automated review. The complete Git diff was inspected. No migration or compatibility adjustment is required.

The earlier Windows missing-module fixture failure also occurred on an unrelated branch. The earlier queued worktree-GC expectation was fixed on main by #165240. Both now pass in this PR's second CI attempt.

Several failing E2E tests import modules with type-only edits in this PR. The unchanged executable code and matching original-base failure are the attribution evidence; no zero-overlap claim is made for their full import graphs. The maintainer authorized a squash merge pinned to the API head after establishing that the failure is inherited.

Final rebase and validation

Main already replaced the partial Playwright download mirror, so that file is excluded from the final diff. The rebase preserves main's asynchronous IRC send authority, SMS request authority, and canonical Gateway timeout import. The resulting production batch removes 1,003 lines. A subsequent rebase incorporated the existing approval/skills cycle repairs without changing the cleanup's patch ID.

Fresh independent autoreview reported no actionable P0–P2 findings. The closure-only UI methods retain explicit receiver-free typing. Shared ratchets were only shrunk: the stale Telegram max-lines exemption was removed and the environment-name budget was synchronized to the measured 464 names. Both maintenance changes received separate scoped-clean review.

Final pushed head: 52a65c4c0616356cf69f4fb79acdb08685d76d05.

  • Both import-cycle checks reported zero on the final production tree. The last commit changes only the internal environment-count budget; source/import inputs are identical to the checked parent.
  • Focused IRC client, Twilio, and Gateway connection suites passed; all 1,140 plugin contract tests passed on that same production tree.
  • The SDK API comparison from base 3927b7dc6f7a to 46d2080aafe3 reported no entrypoint, export, or reachable-declaration changes. The only subsequent file change is the internal environment-count budget.
  • Runtime emission comparison: all 101 changed production files are unchanged after type erasure and formatting/comment normalization.
  • Full check-changed is not claimed green: after the verified baseline shrinks and installing the missing rg prerequisite, the Hetzner host became unreachable during the remaining check. Crabbox could not confirm the child exit state. Hosted CI on the pushed head supplies the remaining validation; the completed checks above remain separate evidence.

The Linux comparison scripts, actual failure traces, immutable revision bindings, and independent review results were retained. Both attribution and validation leases have been released.

Attribution proof used Hetzner cbx_40bf1694ab88; final validation used Hetzner cbx_95e4c2ddc684. Earlier Blacksmith proof is recorded above. Recovery files and protected Crabbox staging were preserved.

Final exact-head CI and inherited failure

Final head: 52a65c4c0616356cf69f4fb79acdb08685d76d05. CI run 37287415348 completed. Builds, lint, production/test types, boundary checks, ratchets, UI/E2E, QA smoke, and the other test shards passed. The sole failing test job is checks-node-changed-extensions-bundle-3-3; the CI gate fails downstream.

The remaining failure is inherited from main, independently observed in main's Plugin Prerelease run 37293068948, checks-node-extensions-shard-2. Its checkout is 04b4e1445b09f6c228d2583517264723ed2abc0e, verified as an ancestor of current origin/main. Both runs fail the same test, extensions/qa-lab/src/scenario-catalog.test.ts > qa scenario catalog > keeps scenario documentation and code references backed by the repository, with:

AssertionError: session-dedup-reconnect codeRefs src/gateway/server-methods/agent-wait.ts exists: expected null not to be null

Main commit fa468f6a64c40e2d65664bec00bfbf91f8664edb (#165322) deleted agent-wait.ts while qa/scenarios/agents/session-dedup-reconnect.yaml retained that code reference. The scenario YAML, failing test, and path resolver are byte-identical between this PR and the independently tested main SHA. This PR does not change those inputs or delete the referenced module. Some surrounding QA helpers have type-only changes; all 101 changed production modules emit unchanged executable JavaScript. No test, timeout, retry, or skip has been weakened.

The subagent extra-Protocol-note attribution is separately resolved in the comparison evidence above; final-head hosted E2E passes. Applying the maintainer-authorized inherited-failure exception to squash-merge the exact API head. The unrelated main catalog repair remains with the coordinator; CI is not described as fully green.

@clawsweeper

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

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 52a65c4c0616356cf69f4fb79acdb08685d76d05
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/conversation-tool-policy-pipeline.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/server-methods/models-auth-status.types.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: nostr Channel integration: nostr channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: zalouser Channel integration: zalouser app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling channel: twitch Channel integration: twitch channel: irc extensions: acpx extensions: qa-lab extensions: memory-wiki extensions: copilot channel: sms Channel integration: sms plugin: cua-computer extensions: browser extensions: clickclack size: XL labels Oct 5, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 5, 2026, 5:19 AM ET / 09:19 UTC (Revision 6).

ClawSweeper review

What this changes

The PR replaces repeated internal TypeScript declarations with types derived from existing parsers, factories, dependency contracts, and option lists.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open as useful, maintainer-directed cleanup. No actionable introduced defect was found, and the previous generic compatibility blocker is unsupported by the actual type-only changes.

Priority: P3
Reviewed head: 52a65c4c0616356cf69f4fb79acdb08685d76d05

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Coherent owner-derived cleanup with substantial recorded validation and no actionable introduced findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored internal type cleanup is exempt from external-contributor runtime proof. Source inspection supports the recorded emission-equivalence and SDK checks; no material authority or stored-data contract changes require additional proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored internal type cleanup is exempt from external-contributor runtime proof. Source inspection supports the recorded emission-equivalence and SDK checks; no material authority or stored-data contract changes require additional proof.
Evidence reviewed 10 items Pinned introduction reviewed: Inspected the merge-base-to-head introduced hunks across core, packages, plugins, UI, and maintenance baselines. The changes remove mirrored declarations, supply explicit parameter types where contextual typing was removed, and preserve executable expressions.
Previous upgrade concern resolved: Doctor repair-mode calculations and guards are unchanged; only the mirrored return declaration becomes owner-derived. The config auto-enable, reload, session-maintenance, archive, migration-reader, and updater hunks likewise change type signatures without changing defaults, storage formats, or migration behavior.
Cleanup remains distinct from current main: The pinned fetched main still contains DoctorRepairMode's handwritten declaration, with the same executable implementation. This independently confirms that at least this central cleanup remains absent from main; no same-repository merged PR establishes completion of this batch.
Findings None None.
Security None None.

How this fits together

These internal types connect OpenClaw’s agent runtime, Gateway, plugins, and Control UI to their existing implementation owners. Deriving them from those owners reduces declaration drift while preserving runtime inputs and outputs.

flowchart LR
  A[Configuration and requests] --> B[Existing parsers and factories]
  B --> C[Owner-derived internal types]
  C --> D[Core and plugin callers]
  C --> E[Control UI callers]
  D --> F[Existing runtime behavior]
  E --> F
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: ui/src/app/device-scope-upgrade.ts, serialized state: src/node-host/invoke-system-run.ts, unknown-data-model-change: extensions/memory-wiki/src/status.ts, unknown-data-model-change: src/node-host/invoke-system-run.ts, unknown-truncated-pull-files, vector/embedding metadata: extensions/memory-wiki/src/claim-health.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Use the existing implementation owners as the source of internal types while retaining intentional leaf contracts and the public SDK boundary.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR addresses declaration duplication, and no introduced runtime bug was established.

Is this the best way to solve the issue?

Yes: deriving internal contracts from their existing owners removes competing declarations without adding runtime machinery or changing user settings.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7dc1b2b23b94.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal declaration cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored internal type cleanup is exempt from external-contributor runtime proof. Source inspection supports the recorded emission-equivalence and SDK checks; no material authority or stored-data contract changes require additional proof.

Evidence

What I checked:

  • Pinned introduction reviewed: Inspected the merge-base-to-head introduced hunks across core, packages, plugins, UI, and maintenance baselines. The changes remove mirrored declarations, supply explicit parameter types where contextual typing was removed, and preserve executable expressions. (52a65c4c0616)
  • Previous upgrade concern resolved: Doctor repair-mode calculations and guards are unchanged; only the mirrored return declaration becomes owner-derived. The config auto-enable, reload, session-maintenance, archive, migration-reader, and updater hunks likewise change type signatures without changing defaults, storage formats, or migration behavior. (src/commands/doctor-repair-mode.ts:4, 52a65c4c0616)
  • Cleanup remains distinct from current main: The pinned fetched main still contains DoctorRepairMode's handwritten declaration, with the same executable implementation. This independently confirms that at least this central cleanup remains absent from main; no same-repository merged PR establishes completion of this batch. (src/commands/doctor-repair-mode.ts:4, 7dc1b2b23b94)
  • Security and authority scope: The conversation policy pipeline retains its existing policy merging and ordering; the auth-status file changes projections of existing health and usage types. Node execution, desktop attachment, push delivery, credential leases, and UI capability changes do not introduce new authorization decisions or final effects. (src/agents/conversation-tool-policy-pipeline.ts:26, 52a65c4c0616)
  • Validation and compatibility evidence: The captured PR body binds the final production tree to unchanged emitted JavaScript for all 101 production files, zero import cycles, focused IRC/Twilio/Gateway passes, 1,140 plugin contract passes, and an SDK comparison reporting no reachable declaration changes. The subsequent head commit changes only the environment-count budget. These are contributor-recorded results; this read-only review did not execute them. (52a65c4c0616)
  • Current CI failure identified: The failing extension job reports a scenario-catalog assertion referencing src/gateway/server-methods/agent-wait.ts. Neither that test nor the referenced file is changed by this PR. GitHub commit metadata confirms that separate main commit fa468f6 removed the referenced file. (extensions/qa-lab/src/scenario-catalog.test.ts:54, 52a65c4c0616)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

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

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

Workflow

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

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-05T00:53:03.516Z sha df8d936 :: blocked before merge. :: none
  • reviewed 2026-10-05T01:43:27.701Z sha f039c4f :: blocked before merge. :: none
  • reviewed 2026-10-05T02:28:24.984Z sha f039c4f :: blocked before merge. :: none
  • reviewed 2026-10-05T02:45:28.555Z sha f039c4f :: blocked before merge. :: none
  • reviewed 2026-10-05T09:08:43.258Z sha 52a65c4 :: blocked before merge. :: none

@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Attribution update for f039c4fa8517a0cc3575762b9fdd296261e1a085: the subagent follow-up failure predates this PR. No runtime-affecting edit was found or reverted.

The requested three runs per revision used clean, independently installed and built checkouts on one Hetzner Crabbox (cbx_40bf1694ab88), Linux x86_64, Node 24.21.0, pnpm 12.5.1. The first six runs were ordered head/main/main/head/head/main.

Revision Run 1 Run 2 Run 3
PR head f039c4fa8517a0cc3575762b9fdd296261e1a085 Pass, 140s Generic Protocol note; completion-marker timeout at 90s, 183s total Exact extra-note quiet-window failure, 95s
Fresh main eaae0fdae778ff2711600323bc5180b28666db27 Pass, 157s Pass, 123s Pass, 122s
Original main base 14bcf5e85d22201fa832069afbf113d22431a590, without this PR Generic Protocol note; same completion-marker timeout, 214s Exact extra-note quiet-window failure, 95s Generic Protocol note; same completion-marker timeout, 181s

The exact shared failure is:

expected no outbound messages for 1000ms, saw:
<message-id>:Protocol note: acknowledged. Continue with the QA scenario plan and report worked, failed, and blocked items.

The saved failing CI job checked out merge 502202526e896457ca28576bf63631cca37f213a, whose main parent is ea00cb30c6611dafb186a959cb90ff5bf83d2b5f. Three additional runs on that clean parent produced a 180-second test timeout followed by two passes; that timeout is not claimed to match the Protocol-note assertion.

Runtime audit: all 102 changed production TypeScript files emit identical JavaScript, both for original base → PR head and CI main parent → CI merge. This used the repository's Rolldown 1.2.9/Oxc transformer and normalized comments/formatting only, with compression and identifier mangling disabled. An independent source/build review found no changes to runtime const/enum values, parser/schema calls, switch/default behavior, side-effect imports, or a type-to-runtime generation path. Public SDK API comparison remains unchanged as recorded in the PR evidence.

Commands for every clean revision:

pnpm install --frozen-lockfile
OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build qaRuntime
OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs extensions/qa-lab/src/plugin-subagent-self-yield-followup.e2e.test.ts

No test assertions, timeouts, retry policy, or production code were changed. The newer-main passes do not identify a particular fix; intervening main changes include execution/delivery ownership and session-read changes. The matching original-base reproduction establishes that this failure was inherited.

Infrastructure notes: three initial Hetzner attempts hit the fleet cap; a Testbox attempt stalled before remote execution. One reduced-priority Mac fallback run timed out and was excluded from attribution. Once Hetzner capacity opened, the complete Linux matrix above was collected. An additional checkout initially exceeded the RAM-backed temporary workspace; the control was rebuilt on disk-backed storage. All completed logs were retained.

The production reduction remains 1,005 net LOC (446 added, 1,451 removed). The API now reports a merge conflict after main advanced; I am resolving that before applying the maintainer-authorized pinned squash merge. The other inherited CI failures remain documented in the PR body.

steipete added a commit that referenced this pull request Oct 5, 2026
Prepare the reply transcript boundary before a remote OpenClaw worker
announces execution. Carry its backend through the existing start callback
so chat delivery and cancellation use the same runtime ownership facts.

This prevents duplicate assistant replies and lets the next turn after a
worker cancellation reach the provider instead of silently settling.
Both regressions were introduced by 0816aa1 (#164989) and reported in
#165225. Preserve singleton reply and skill replacement E2E assertions.
steipete added a commit that referenced this pull request Oct 5, 2026
Continue startup recovery when a pending agent database publishes its
successful admission. Reuse the existing recovery owner, original startup
cutoff, live authority checks, and serialized capacity. Limit subsequent
scans to the newly admitted agents while preserving fixed-store ownership.

This prevents an orphaned run from blocking new sends after SIGKILL.
Keep the original recovery timeout and add coverage for admission during
the first scan, after that scan, and after shutdown. Deferred dirty-store
admission in #164670 exposed the missing continuation reported in #165225.
@steipete
steipete force-pushed the deslop/l377-type-mirrors2-20261004 branch from f039c4f to 52a65c4 Compare October 5, 2026 09:02
steipete added a commit that referenced this pull request Oct 5, 2026
A crash could leave widget authoring running forever when startup recovery finished before the agent database completed background admission. The producer repair is already on main in c1b9f4e; add the missing deterministic process-level regression.

Use a synthetic loopback provider and owned Gateway restart to prove resumed widget publication, successful terminal notification, durable/projected done, and one final reply without an inline client.

Proof: pre-fix failure and post-fix success on Node 24 and pinned Bun; final P2 autoreview scoped-clean; exact-head CI green; ClawSweeper no findings. Production LOC unchanged. Related: #165225.
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Final exact-head CI and inherited failure

Final head: 52a65c4c0616356cf69f4fb79acdb08685d76d05. CI run 37287415348 completed. Builds, lint, production/test types, boundary checks, ratchets, UI/E2E, QA smoke, and the other test shards passed. The sole failing test job is checks-node-changed-extensions-bundle-3-3; the CI gate fails downstream.

The remaining failure is inherited from main, independently observed in main's Plugin Prerelease run 37293068948, checks-node-extensions-shard-2. Its checkout is 04b4e1445b09f6c228d2583517264723ed2abc0e, verified as an ancestor of current origin/main. Both runs fail the same test, extensions/qa-lab/src/scenario-catalog.test.ts > qa scenario catalog > keeps scenario documentation and code references backed by the repository, with:

AssertionError: session-dedup-reconnect codeRefs src/gateway/server-methods/agent-wait.ts exists: expected null not to be null

Main commit fa468f6a64c40e2d65664bec00bfbf91f8664edb (#165322) deleted agent-wait.ts while qa/scenarios/agents/session-dedup-reconnect.yaml retained that code reference. The scenario YAML, failing test, and path resolver are byte-identical between this PR and the independently tested main SHA. This PR does not change those inputs or delete the referenced module. Some surrounding QA helpers have type-only changes; all 101 changed production modules emit unchanged executable JavaScript. No test, timeout, retry, or skip has been weakened.

The subagent extra-Protocol-note attribution is separately resolved in the comparison evidence above; final-head hosted E2E passes. Applying the maintainer-authorized inherited-failure exception to squash-merge the exact API head. The unrelated main catalog repair remains with the coordinator; CI is not described as fully green.

@steipete
steipete merged commit d89960a into main Oct 5, 2026
176 of 179 checks passed
@steipete
steipete deleted the deslop/l377-type-mirrors2-20261004 branch October 5, 2026 10:34
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
Prepare the reply transcript boundary before a remote OpenClaw worker
announces execution. Carry its backend through the existing start callback
so chat delivery and cancellation use the same runtime ownership facts.

This prevents duplicate assistant replies and lets the next turn after a
worker cancellation reach the provider instead of silently settling.
Both regressions were introduced by 91961ee (openclaw#164989) and reported in
openclaw#165225. Preserve singleton reply and skill replacement E2E assertions.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
Continue startup recovery when a pending agent database publishes its
successful admission. Reuse the existing recovery owner, original startup
cutoff, live authority checks, and serialized capacity. Limit subsequent
scans to the newly admitted agents while preserving fixed-store ownership.

This prevents an orphaned run from blocking new sends after SIGKILL.
Keep the original recovery timeout and add coverage for admission during
the first scan, after that scan, and after shutdown. Deferred dirty-store
admission in openclaw#164670 exposed the missing continuation reported in openclaw#165225.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
)

A crash could leave widget authoring running forever when startup recovery finished before the agent database completed background admission. The producer repair is already on main in 9241c9e; add the missing deterministic process-level regression.

Use a synthetic loopback provider and owned Gateway restart to prove resumed widget publication, successful terminal notification, durable/projected done, and one final reply without an inline client.

Proof: pre-fix failure and post-fix success on Node 24 and pinned Bun; final P2 autoreview scoped-clean; exact-head CI green; ClawSweeper no findings. Production LOC unchanged. Related: openclaw#165225.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
Derive internal parser results, factory/controller methods, option bags, and dependency views from their existing owners instead of maintaining parallel TypeScript declarations.

Remove 1,003 net production lines while preserving runtime expressions and public plugin SDK declarations. Keep current main's transport authority and canonical imports, explicit receiver-free UI method typing, and narrow internal contracts. Shrink only verified stale ratchet entries and budgets.

Validation: independent review; zero import cycles; focused and plugin contract suites; unchanged emitted JavaScript and SDK API surface. The exact subagent extra-reply failure reproduced on clean original main before this change; comparison evidence is recorded in the PR.

Final exact-head CI passes except the inherited QA catalog reference to deleted agent-wait.ts, independently reproduced in main Plugin Prerelease run 37293068948/job/111708436437. Merged under the maintainer-authorized inherited-failure exception; full attribution evidence is recorded in the PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: discord Channel integration: discord channel: irc channel: nostr Channel integration: nostr channel: slack Channel integration: slack channel: sms Channel integration: sms channel: telegram Channel integration: telegram channel: twitch Channel integration: twitch channel: zalouser Channel integration: zalouser cli CLI command changes commands Command implementations extensions: acpx extensions: browser extensions: clickclack extensions: copilot extensions: memory-wiki extensions: qa-lab gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: cua-computer rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant