Repository navigation
fix(doctor): preserve escaped references through config repair - #147453
Conversation
Keep include-expanded authored snapshots internal across valid, invalid, and cached config reads. Cover read-scoped root/include responses while preserving the paired internal trees. Defer alias migration helpers and their direct resolved-source API tests to the first consumer layer; preserve existing env-reference entrypoint coverage here.
|
🦞👀 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 September 21, 2026, 6:20 PM ET / 22:20 UTC (Revision 14). ClawSweeper reviewWhat this changesDoctor preserves active and escaped environment references through config migrations and successive repairs, with regression coverage for startup, backups, and write refusals. Merge readiness⛔ Blocked before merge - 1 item remains This PR remains useful: current main and the latest release still lack Doctor’s matched planning-reference preservation. The updated evidence and source comparison address the previous composition concern; no actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherDoctor reads user configuration, plans migrations, and sends repairs through the shared config writer. Gateway startup also uses this repair machinery before admitting a migrated configuration. flowchart TD
A[Authored config and environment] --> B[Matched config snapshot]
B --> C[Doctor migration plan]
C --> D[Restore reference intent]
D --> E[Validate and check revision]
E --> F[Shared config writer]
F --> G[Saved config and backups]
E --> H[Startup admission or refusal]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +110, Tests +391. Total +501 across 14 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep reference restoration in Doctor’s existing planning flow and persistence in the shared writer, preserving authored intent without introducing another migration or write owner. Do we have a high-confidence way to reproduce the issue? Yes, from source: plan a repair containing an environment reference, rotate that environment before writing, or migrate an escaped memory reference through startup repair. The old restoration and prediction paths explain the mismatch; this review did not execute them. Is this the best way to solve the issue? Yes. Retaining the matched planning pair and sharing the restored startup candidate addresses the mismatch while preserving the canonical writer’s revision, ownership, and backup checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 06fc929b483e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
Merge the verified main baseline while retaining Vincent Koc's original three-commit ancestry. Keep authored capture and public stripping together; retain current-main migration and validation APIs and supplemental privacy tests. Co-authored-by: Vincent Koc <[email protected]>
Merge the verified main baseline while retaining Vincent Koc's original three-commit ancestry. Keep authored capture and public stripping together; retain current-main migration and validation APIs and supplemental privacy tests. Co-authored-by: Vincent Koc <[email protected]>
Keep migration-normalized values canonical and forward explicit reference activation through both restoration passes and the Doctor writer.
…policy Preserve contributor ancestry and current-main authorization, deferral, and Windows activation behavior while routing token persistence through the Doctor config owner before service mutation.
Integrate the retained Doctor residual with landed main. Keep the original authored and resolved planning pair across repairs, preserve active and escaped references when the environment changes, and use the same restored config for startup validation, prediction, and commit. The 14 Doctor postimages are unchanged from the retained d1e77 candidate; inherited config write and receipt behavior comes from landed main. Co-authored-by: Vincent Koc <[email protected]>
Incorporate the upstream prepared-metadata fixture repair (openclaw#147453) and pnpm observation guard repair (1497878) that own the observed unrelated CI failures. Preserve contributor ancestry. Co-authored-by: Patrick-Erichsen <[email protected]>
Incorporate the upstream prepared-metadata fixture repair (openclaw#147453) and pnpm observation guard repair (1497878) that own the observed unrelated CI failures. Preserve contributor ancestry. Co-authored-by: Patrick-Erichsen <[email protected]>
…law#147453) * fix(config): preserve references across plugin owner migrations * fix(config): keep authored provenance out of config responses Keep include-expanded authored snapshots internal across valid, invalid, and cached config reads. Cover read-scoped root/include responses while preserving the paired internal trees. Defer alias migration helpers and their direct resolved-source API tests to the first consumer layer; preserve existing env-reference entrypoint coverage here. * test(config): invalidate cached provenance fixtures * fix(doctor): honor config write refusals before gateway repair * test(doctor): simplify gateway repair mock arguments * test(doctor): cover update metadata and include refusal * fix(doctor): preserve revision checks across successive repairs * test(doctor): preserve committed repairs after revision drift * fix(config): preserve explicit reference write intent * fix(doctor): preserve planned config references * test(meeting-bot): control browser retry fixture clocks * fix(doctor): preserve explicit and normalized reference intent Keep migration-normalized values canonical and forward explicit reference activation through both restoration passes and the Doctor writer. * test(doctor): assert updater deferral through config writer * test(models): keep native auth refresh fixture passive * test(node): keep prepared workspace fixture owner private Create the fixture owner root with the same private permissions as project preparation so permissive host umasks cannot invalidate transfer tests. * refactor(config): split authored env-reference accounting Move unchanged authored-reference helpers and private snapshot tests into coherent siblings so the provenance change satisfies the line-cap ratchet. * fix(tooling): include authored env helper in PR wrapper archive Keep the extracted wrapper source inventory complete after the config helper extraction; preserve eager-import closure and provisioning guards. * test(doctor): extract gateway writer fixtures for line caps Keep all assertions and coverage while moving coherent gateway assertion helpers and the linked token/writer fixture to sibling test support. * test(doctor): bind persistence fixtures to observed config revisions Use the real config snapshot for existing and absent config files and assert the writer result. Preserve disk, metadata, privacy, and no-op assertions. * refactor: extract config write values and reference test groups * refactor: pass roster projection into write value preparation * refactor: make config write value dependency a leaf contract * fix: include config write values in PR wrapper source closure * fix(config): restore read-time references through topology writes * test(doctor): isolate installation consent runtime fixture Keep real service auditing and runtime path classification while making the installation-only fixture independent of the host Node launcher. Cover denied, approved, and noninteractive consent for version-managed runtime drift. * test: stabilize catalog clock and accepted agent dispatch Keep the synthetic catalog clock on whole milliseconds so the exact arm interval survives floating-point boundaries. Retain the dispatch fixture clock until accepted work dispatches or responds, scoped to this invocation. * test: drain status model fixture session resources Give each status model test an owned state directory and await its scoped cleanup so retained session-cost workers cannot leak into later suites. * test: scope sandbox workspace authority fixture state Own default and custom session stores and await scoped cleanup so cached SQLite read scopes cannot leak into later auth-profile suites. * fix(ci): bound worker fixture builds and SDK cycle traversal * test(gateway): join inherited native-subagent tracked execution Consume only the three qualified gateway fixture postimages from supplier 6711131 (PR openclaw#144318). Preserve suite registration, complete lifetime row suppression and terminal success checks. No production change or historical hosted-cause repair is claimed. Source-commit: 6711131 * test(gateway): reuse shared session-store mock defaults Remove redundant spawned-child fixture mock setup; the shared harness already establishes the no-op default. Preserve all task-row suppression and tracked execution assertions without raising session-accessor debt. * fix(sqlite): retire aborted snapshot admission before allocation Consume the exact qualified three-file cancellation repair from supplier 6711131 (PR openclaw#144318). Preserve shared producer leases and cleanup ownership, plus the existing250ms cancellation bound. Reuse atomic-marker readiness without weakening lifetime assertions. Source-commit: 6711131 * fix(ui): preserve new-session focus after shortcuts dismissal Consume four exact qualified focus-repair postimages from supplier 6711131 (PR openclaw#144318). Restore focus only from a previously open drawer and let removed dialog ownership restore focus once. Preserve cold/warm keyboard and typed-draft assertions. Source-commit: 6711131 * test: isolate cancellation timing and active progress locator Start owned cancellation timing after fixture exclusion and cold-open, retaining the 250ms bound and all worker, reclamation and cleanup assertions. Scope resumed progress to the active Progress note region, consuming the exact qualified UI test postimage from supplier commit below. Source-commit: 6711131 * test: use supported deferred for snapshot cancellation fixture Reuse createDeferredCore under the existing hosted TypeScript target. Preserve fixture readiness, the 250ms bound, and all lifetime, ownership and cleanup assertions. No production or compiler-baseline changes. * fix(config): preserve provenance during include rollback Capture both post-write read environment snapshots through snapshotEnv so rejected config-applied values roll back with their ownership metadata. Exercise the existing rename and permission-fallback regressions through applyConfigEnvVars instead of direct assignment. Preserve concurrent edits. * test(gateway): scope spawned-child fixture storage Resolve the shared spawned-child fixture store from its child agent and the current test state root instead of the global /tmp/sessions.json locator. Transcript admission performs a real SQLite target lookup before the mock pending-input writer. Assert the test-owned target after joining execution and preserve terminal success, dispatch count, and duplicate-row suppression. The fixture isolation control fails on the parent; all353 ordered agent cases and affected static gates pass. No unique historical hosted cause is claimed. * test: synchronize Darwin watch setup and scope auth cleanup Wait for a real parent FSEvents probe before creating the watched fixture directory. Preserve native transcript-create, append, and directory assertions. Scope auth snapshot disposal checks to the reader-owned path and agent, while proving an unrelated shared-registry resource survives. The global-empty control fails both cleanup branches; the repaired suite passes all six cases. Both fixture deltas pass independent P2 review and affected native/static checks. Production code is unchanged. Existing Windows cleanup failures remain unresolved; no unique historical CI cause is claimed. * test(gateway): join plugin fixture work before removing state * test(config): pin web search validation metadata fixture Use the declared manifest fixture for prepared validation while preserving explicit empty snapshots, acceptance and rejection assertions, and separate provider autodetection coverage. Controlled prepared-metadata contexts reproduce the discovery-mock bypass; original CI worker/cache/order remains unproven. --------- Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
|
Merged via squash.
|
Related: #136025
Part of #145252
What Problem This Solves
Doctor could validate a planned repair using one config representation and commit another, losing escaped environment-reference intent during migration. Changing the environment between planning and writing could also replace authored references with resolved values. A later config revision must be refused without undoing an already committed repair.
User Impact and Release Note
Doctor retains its original matched authored/resolved reference pair across migrated paths and successive writes. Startup validates, predicts, and commits one restored config. Active and escaped reference intent, explicit edits, backup bytes, include ownership, write receipts, and later raw-drift refusal remain intact. No new config option, default, schema, or public API is introduced.
This prerequisite does not complete downstream alias convergence or close the original issue. Original alias-repair context: #138040 by @aniruddhaadak80. Original contributor @vincentkoc is credited in the preserved ancestry and integration commit.
Main Integration
072b7f45eb2a23066bf525755e51eb338c0292bc; tree:0524f0c7e4ab986a8c87e4c181ddcac8bf13e7e2.174a2ea7865bb4b262609fd47657a37c0916182eand maineba2d9f5da8c68a6276b481386fddb8374c89ebc. The effective diff against pinned main is exactly 14 Doctor production/test paths.7d7b5ba1b5a9afa132ff369c3ea50cdaa870ce40; fix(doctor): preserve revision checks across successive repairs #147235 landed at1a7911f56c11ba5c980d598610f34961f35e641e. Their implementations are inherited from main, not duplicated in this residual.Validation and Applicability
git diff --checkpass. API-direct review of the identical effective diff is P0–P2 scoped-clean; its scope is the supplied patch and retained evidence, not an independently rerun whole-tree/runtime qualification.174ainstalled proof remains accepted at its original scope: verified published 2026.9.4 updater transition into the candidate with actual native Doctor success; emitted Doctor reference-preservation/migration cases across environment rotation and two completed writes, advancing revisions and exact prewrite backups; full Doctor CLI invalid-to-valid migration and stable repeat, except the documented wizard timestamp. No atomic-visibility or whole-stack recovery claim is made.io.runtimemodule adds an async-reader assertion method outside the Doctor path. Final package-wide behavior is not relabeled as freshly executed evidence.174aCI 35593374285 attempt 1 succeeded with 200 passed, five skipped and zero failed; the required non-skippedopenclaw/ci-gatewas attached to that head only. Exact072bCI 35661346931 attempt 1 succeeded (128 successful jobs, 17 skipped); its required non-skippedopenclaw/ci-gatepassed. ClawSweeper revision 14 found no actionable defect; its compatibility checklist is confirmed by the retained migration/backup/repeat proof and exact source applicability above, without claiming new-head installed execution.Preserved Failures and Limits
startup_failure, with zero jobs/check runs and no package or test execution. Its precise hosted validation cause remains UNKNOWN; it was not retried unchanged. The separate installed proof above is not a rewrite of this failed attempt.Same dedicated owner continues exact-head CI/review, supported native landing, live verification, and custody-safe closure. No live Odin update/restart, shared handoff-store mutation, unrelated work, or unchanged proof replay is part of this PR.