Repository navigation
refactor(types): deslop type mirrors - #165225
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: blocked before merge. Reviewed October 5, 2026, 5:19 AM ET / 09:19 UTC (Revision 6). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThese 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
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Attribution update for The requested three runs per revision used clean, independently installed and built checkouts on one Hetzner Crabbox (
The exact shared failure is: The saved failing CI job checked out merge 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.tsNo 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. |
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.
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.
f039c4f to
52a65c4
Compare
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.
Final exact-head CI and inherited failureFinal head: The remaining failure is inherited from main, independently observed in main's Plugin Prerelease run 37293068948, Main commit 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. |
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.
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.
) 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.
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.
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
Evidence
Initial validation before the final main updates:
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.Remote proof used the repository Crabbox wrapper with Blacksmith Testbox:
tbx_01m44dhtbsf4d8v450b5pzv7et(focused runs),tbx_01m44hj7a2e30eczwkns0dpj87(type/contract passes), andtbx_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 nativerunChangedCheck(..., { lintOnly: true })CI route,node --import tsx scripts/check-deadcode-exports.mts,pnpm plugin-sdk:api:diff --base <base> --head <head>, and bothcheck-madge-import-cycles.ts/check-import-cycles.tsowners.Hosted CI found an introduced
unbound-methodlint regression in three existing UI consumer assertions. Commitf039c4fa8517a0cc3575762b9fdd296261e1a085declares the two closure-only factory methods withthis: 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 Testboxtbx_01m44t396kn440tha66vw56dmw(correction proof). All hosted lint jobs and typecheck jobs are green on that corrected head.The prior CI attempt on
f039c4fa8517remains red in five test jobs:checks-node-changed-compact-large-13checks-node-compact-large-18checks-node-changed-compact-large-15checks-node-changed-1checks-node-changed-7checks-node-changed-8Attribution 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.f039c4fa8517eaae0fdae77814bcf5e85d222The 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
ea00cb30c661produced 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.3927b7dc6f7ato46d2080aafe3reported no entrypoint, export, or reachable-declaration changes. The only subsequent file change is the internal environment-count budget.check-changedis not claimed green: after the verified baseline shrinks and installing the missingrgprerequisite, 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 Hetznercbx_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 ischecks-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 is04b4e1445b09f6c228d2583517264723ed2abc0e, 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:Main commit
fa468f6a64c40e2d65664bec00bfbf91f8664edb(#165322) deletedagent-wait.tswhileqa/scenarios/agents/session-dedup-reconnect.yamlretained 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.