Skip to content

test(doctor): focus outbound custody on nested maintenance - #154123

Merged
steipete merged 1 commit into
mainfrom
codex/doctor-custody-fixture-20260920
Sep 20, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/doctor-custody-fixture-20260920

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Doctor custody fixture ran the entire migration sweep for each of four plugin cleanup cases inside one 90-second setup budget. That setup timed out in CI.

User Impact

Maintainers can check outbound migration custody without running unrelated migration sweeps. Production behavior and every deadline remain unchanged.

Why This Change Was Made

The test now keeps real outer Doctor maintenance and its final release, but runs the existing outbound migration directly inside that scope. The inner migration still owns its real lock, plugin inspection, and resource cleanup.

All four cases continue to open real SQLite resources and test a fresh competing connection after outer release. The assertions now identify the exact callback and retained errors, and the failed acquisition's plugin ID and message. The existing outbound preparation suite separately checks completed delivery receipts and a refused receipt after a registered resource disposer fails. Runtime code and all deadlines remain unchanged.

The custody test uses one isolated child for all four cases because retained inspection resources have no retryable release handle; process exit must release their remaining OS custody before temporary state is removed. This real boundary is necessary to detect lost physical exclusion.

Evidence

Twenty consecutive one-worker standalone runs passed (wall 14.03–43.70 seconds, median 24.63 seconds under concurrent host load). The corrected six-case preparation file passed in 41.18 seconds wall, with the added refusal case taking 0.95 seconds; its five-case baseline took 52.02 seconds wall. These wall measurements include transform/setup costs and are not a controlled speed comparison. All 35 selected lock and inspection sibling cases pass, and independent review through P2 is clean.

The original failed CI log is retained. Diagnostic traces located substantial work in imports and unrelated migration sweeps rather than native release; they do not identify the exact hosted stack at the 90-second deadline. Three Linux runs of the original 745-file selection passed through the maintained routes: each unit-fast run passed 9,484 cases, and the one file moved to another project by current main passed all four current cases three times. The complete selected static gate also passes. The Testbox environment run identifies the isolated environment; retained command receipts record both commands exiting successfully and completed lease cleanup.

Exact-head CI and normal native landing checks remain required.

Keep the real outer Doctor scope and inner outbound migration lock while avoiding unrelated state migration sweeps in the custody fixture. Assert specific disposal and acquisition causes alongside native writability and physical exclusion.

Preserve completed and refused delivery-queue receipt coverage in the existing preparation suite. Keep every deadline unchanged.
@clawsweeper

clawsweeper Bot commented Sep 20, 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.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 20, 2026
@steipete
steipete marked this pull request as ready for review September 20, 2026 22:28
@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 Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 6:34 PM ET / 22:34 UTC.

ClawSweeper review

What this changes

The PR narrows Doctor’s outbound migration custody tests to nested maintenance, strengthens cleanup-error assertions, and preserves migration receipt coverage in the preparation suite.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused, useful test repair that current main has not adopted. No introduced correctness defect was found, and the maintainer-authored PR is protected from automatic closure.

Priority: P3
Reviewed head: d81a0319e244c87cfd6a0136a9f07714ed2cf870

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test repair preserves the important ownership checks and strengthens failure assertions, with no actionable defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored test-only change is exempt from external-contributor runtime proof; its reported runs exercise real Doctor maintenance, plugin cleanup, and SQLite exclusion, without changing production authority.
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 test-only change is exempt from external-contributor runtime proof; its reported runs exercise real Doctor maintenance, plugin cleanup, and SQLite exclusion, without changing production authority.
Evidence reviewed 8 items Pinned introduced scope: The merge-base-to-head patch changes only tests and test support. It preserves all existing deadlines and adds no production API, storage format, dependency, or authorization behavior.
Real custody boundary retained: All four cases still enter outer Doctor maintenance, run the production outbound migration, release the outer scope, test native-resource writability, and attempt acquisition through a fresh SQLite connection. Assertions now distinguish callback failure, retained cleanup, and failed plugin acquisition.
Receipt coverage remains at the orchestrator: The preparation suite continues through autoMigrateLegacyState, checks completed delivery-queue receipts for file, SQLite, and claimed entries, and adds a refused step-threw receipt case after registered resource disposal fails.
Findings None None.
Security None None.

How this fits together

Doctor prepares legacy outbound messages while maintenance locks exclude competing writers. These tests check that plugin cleanup releases those locks only after resources settle and that migration receipts report success or refusal.

flowchart TD
  A[Legacy queued messages] --> B[Outer Doctor maintenance]
  B --> C[Outbound migration lock]
  C --> D[Plugin preparation and cleanup]
  D --> E{Resources settled?}
  E -->|Yes| F[Release physical exclusion]
  E -->|No| G[Retain physical exclusion]
  D --> H[Migration receipt]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +56. Total +56 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 95 39 +56
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 95 39 +56

Review metrics

Metric Value Why it matters
Custody coverage 4 cleanup cases retained; 90-second child budget unchanged The fixture reduces unrelated work while retaining the physical-exclusion scenarios and existing deadline.

Technical review

Best possible solution:

Keep physical-exclusion coverage at the nested maintenance boundary and receipt coverage at the migration orchestrator without increasing deadlines.

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

No high-confidence reproduction of the original CI timeout was established in this read-only review; source confirms the repeated full-sweep workload, and the body reports successful validation after narrowing it.

Is this the best way to solve the issue?

Yes: exercising the existing outbound owner directly preserves nested lock and cleanup behavior, while the preparation suite retains orchestrator receipt coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0a9d65e3b7b6.

Labels

Label changes:

  • add P3: This improves internal test reliability without changing production behavior or user settings.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored test-only change is exempt from external-contributor runtime proof; its reported runs exercise real Doctor maintenance, plugin cleanup, and SQLite exclusion, without changing production authority.

Label justifications:

  • P3: This improves internal test reliability without changing production behavior or user settings.
  • 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 test-only change is exempt from external-contributor runtime proof; its reported runs exercise real Doctor maintenance, plugin cleanup, and SQLite exclusion, without changing production authority.

Evidence

What I checked:

  • Pinned introduced scope: The merge-base-to-head patch changes only tests and test support. It preserves all existing deadlines and adds no production API, storage format, dependency, or authorization behavior. (src/infra/state-migrations.outbound-custody.child.test-support.ts:101, d81a0319e244)
  • Real custody boundary retained: All four cases still enter outer Doctor maintenance, run the production outbound migration, release the outer scope, test native-resource writability, and attempt acquisition through a fresh SQLite connection. Assertions now distinguish callback failure, retained cleanup, and failed plugin acquisition. (src/infra/state-migrations.outbound-custody.child.test-support.ts:99, d81a0319e244)
  • Receipt coverage remains at the orchestrator: The preparation suite continues through autoMigrateLegacyState, checks completed delivery-queue receipts for file, SQLite, and claimed entries, and adds a refused step-threw receipt case after registered resource disposal fails. (src/infra/state-migrations.outbound-preparation.test.ts:172, d81a0319e244)
  • Production owner matches the narrowed fixture: The migration orchestrator delegates its delivery-queues step to migrateDoctorDeliveryQueues. That owner acquires its own maintenance lock and registers inspection cleanup with its maintenance resource scope; the fixture therefore retains the relevant nested ownership boundary. (src/infra/state-migrations.doctor.ts:1771, d81a0319e244)
  • Still distinct from current main: Fetched main retains the original custody fixture blob 29dd2a89c2e5b62eeb5c85295a076aba9e8e5128, which runs the full migration sweep. The latest release has a different older fixture blob; no merged replacement implementing this narrowing was established. (src/infra/state-migrations.outbound-custody.child.test-support.ts, 0a9d65e3b7b6)
  • Reported validation and its limits: The captured PR body reports 20 standalone passes, three repetitions of the original selection through current test routes, 35 sibling cases, and selected static checks. It explicitly leaves the exact hosted timeout stack unidentified. The linked Testbox environment run is cancelled, consistent with treating it as an environment reference rather than a passing test receipt; retained command receipts were not independently inspected.

Likely related people:

  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • 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.

@steipete
steipete merged commit c159663 into main Sep 20, 2026
229 checks passed
@steipete
steipete deleted the codex/doctor-custody-fixture-20260920 branch September 20, 2026 23:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 21, 2026
Keep default loopback routing direct after canary readiness and assert
that external requests still reach the proxy. Attribute readiness failures
to the proxy only in explicit proxy mode.

Keep the TUI client and proxy lifecycle in one module generation after
mock resets, assert the full block-mode recovery message exactly once,
and verify the inherited policy at Gateway WebSocket construction.

Include the existing test-only outbound custody repair from c159663
(#154123), preserving nested maintenance, physical exclusion, native
writability, failure causes, and migration receipts without longer budgets.

Related: #153930
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
…154123)

Keep the real outer Doctor scope and inner outbound migration lock while avoiding unrelated state migration sweeps in the custody fixture. Assert specific disposal and acquisition causes alongside native writability and physical exclusion.

Preserve completed and refused delivery-queue receipt coverage in the existing preparation suite. Keep every deadline unchanged.
steipete added a commit that referenced this pull request Sep 21, 2026
* fix(proxy): keep native runtime loopback requests direct

In 9.4, 8169aac added the native Codex loopback inference relay
while managed proxy routing still cleared NO_PROXY.

Use Proxyline's shared bypass policy and supply loopback exclusions to
native children. Explicit proxy/block modes remain unchanged. Doctor
reports failed loopback probes with recovery commands.

Fixes #153930. Reported by @eefreenyc.

* fix(proxy): align loopback diagnostics and client regression coverage

Keep default loopback routing direct after canary readiness and assert
that external requests still reach the proxy. Attribute readiness failures
to the proxy only in explicit proxy mode.

Keep the TUI client and proxy lifecycle in one module generation after
mock resets, assert the full block-mode recovery message exactly once,
and verify the inherited policy at Gateway WebSocket construction.

Include the existing test-only outbound custody repair from c159663
(#154123), preserving nested maintenance, physical exclusion, native
writability, failure causes, and migration receipts without longer budgets.

Related: #153930

* test(proxy): remove userinfo from Doctor fixture
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
…4013)

* fix(proxy): keep native runtime loopback requests direct

In 9.4, d6bd911 added the native Codex loopback inference relay
while managed proxy routing still cleared NO_PROXY.

Use Proxyline's shared bypass policy and supply loopback exclusions to
native children. Explicit proxy/block modes remain unchanged. Doctor
reports failed loopback probes with recovery commands.

Fixes openclaw#153930. Reported by @eefreenyc.

* fix(proxy): align loopback diagnostics and client regression coverage

Keep default loopback routing direct after canary readiness and assert
that external requests still reach the proxy. Attribute readiness failures
to the proxy only in explicit proxy mode.

Keep the TUI client and proxy lifecycle in one module generation after
mock resets, assert the full block-mode recovery message exactly once,
and verify the inherited policy at Gateway WebSocket construction.

Include the existing test-only outbound custody repair from f5b7014
(openclaw#154123), preserving nested maintenance, physical exclusion, native
writability, failure causes, and migration receipts without longer budgets.

Related: openclaw#153930

* test(proxy): remove userinfo from Doctor fixture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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