Repository navigation
fix: await Doctor process and restart lease inspection - #190872
Conversation
Add Doctor snapshot cancellation and capacity regressions for CI baseline proof before completing the async owner cutover. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Await snapshot preparation and cleanup across Doctor inspection and repair planning, preserve original-path admission, and reject snapshots that exceed measured cache capacity. Retain synchronous public and transaction authority contracts. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Bind task-worker cancellation to snapshot custody, retain the updater identity export, and repair async consumer fixtures and wrapper source closure. Keep the lease SQL kernel at its existing lifecycle owner. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Preserve per-run cancellation semantics in worker handler fixtures after adding the task-owned abort signal. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
…ries Keep inaccessible state roots in the diagnostic result, and update source-isolation, lease-poll, and PostgreSQL transport fixtures to observe the actual async owners. Complete task control fixture migration. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Integrate tested main 1347e90 to resolve the named numeric-parser CI contract mismatch from #189993. Preserve specific ExpectedCliError diagnostics and refused dispatch in capability fixtures. Correct the generated IPC preload newline found by review; its cooked script passes node --check. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Apply the repository formatter to the two exact files reported by main-tier CI. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Await session and legacy-auth images, private engine reads, and fresh recovery inventories through the existing cancellable snapshot owner. Preserve writer and SDK contracts and reassert effect authority after awaited reads. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Use the gateway retention role explicitly in idle coverage, await the authoritative target and presented route pane, and retain failed restart diagnostics without relaxing its assertions. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
…/doctor-awaited-readers
|
🦞👀 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. |
Integrate main to resolve CLI fixture and canonical locale conflicts. Retain the Cron backup manifest owner and await the existing asynchronous schema gate. Wait for hook notice enqueue, browser provider entry, and identity authorization completion before checking their results; retain assertions and test budgets. Add bounded failure diagnostics for early child termination. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
|
Codex review: needs real behavior proof before merge. What this changesThis PR makes Gateway process, owner-lease, and restart preparation await existing asynchronous readers. Example: Doctor inspects Gateway ownership for port 18789 while preparing a SQLite snapshot.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this maintainer-authored PR contributes useful staged work for documented Doctor stalls; no definite introduced correctness bug was established. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor and Gateway lifecycle commands consume persisted ownership and native process observations to produce inspection results, restart intents, and guarded process-control effects. flowchart TD
Commands[Doctor and lifecycle commands] --> Inspection[Async ownership inspection]
Inspection --> Worker[Existing state read worker]
Worker --> Lease[Gateway owner lease]
Inspection --> Guards[Current authority and PID checks]
Guards --> Effects[Gateway RPC and native process control]
Technical reviewBest possible solution: Complete this staged cutover through existing read owners while preserving the shared cleanup policy and current authority checks before effects. Do we have a high-confidence way to reproduce the issue? Main contains synchronous lease-inspection paths and reporters captured a synchronous snapshot stall, but this stage's service-specific trigger was not reproduced during this read-only review. Is this the best way to solve the issue? Awaiting the existing read owners and sharing cleanup decisions between synchronous and asynchronous drivers is a coherent focused repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d858bbd383a0. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: none. SecurityNeeds attention: No concrete bypass was established, but asynchronous shutdown authority needs final-effect rejection evidence. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +279, Tests +132, Other +1. Total +412 across 34 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 1, 2026, 11:56 PM ET / November 2, 2026, 04:56 UTC. |
Integrate the reviewed core conflict repair and retain canonical backup and live-destination guards. Update consumer fixtures to observe asynchronous producers and persisted shared-auth outcomes, with current source formatting. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Keep the existing close and no-backfill checks using logger creation metadata instead of independently buffered file offsets. Millisecond ties remain explicitly ambiguous; native lease lifetime assertions retain their own proof. Add bounded diagnostics for the unresolved config admission refusal and mark the existing platform partial mocks at their owning isolation boundaries. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
… errors Prepare quarantine in the existing inspection scope before native admission. Retain failed preparation outcomes to preserve optional-index tolerance without synchronous retries, and keep disposal failures visible on cancellation. Retire the unused synchronous shared-auth inspection export and calibrate the actual async copy owner. Co-authored-by: Christian Rodrigues de Oliveira <[email protected]> Co-authored-by: steipete <[email protected]>
Security-sensitive guard clearedCurrent revision: This PR no longer changes files in the maintainer security-review tier. Separate CODEOWNERS requirements still apply to security policy and enforcement files. |
…ss-reads # Conflicts: # config/test-lines-allocations/doctor-awaited-readers.txt # src/cli/update-cli/cleanup-unmanifested.test.ts # src/cli/update-cli/cleanup.ts # src/commands/doctor-session-sqlite-retirement.ts
Keep this split limited to process and restart lease inspection and direct consumer tests. Remove inherited backup, auxiliary snapshot, CI prerequisite and temporary diagnostic changes already owned elsewhere. Co-authored-by: steipete <[email protected]>
…ss-reads # Conflicts: # src/infra/gateway-owner-lease.ts
Record closed phase names in the existing restart regression to locate the Bun CI stall after config capture. Temporary diagnostic output, not a product fix. Co-authored-by: steipete <[email protected]>
Select the existing awaited snapshot and transport for Promise-only lease inspection. Remove temporary native restart diagnostics after locating the stall inside the real CLI. Co-authored-by: steipete <[email protected]>
Use the existing same-file independent read path for committed Gateway lease observations. Preserve native transaction refusal and original-source fallback after path replacement. Co-authored-by: steipete <[email protected]>
A legitimate state-file replacement can retain the previous logical read admission. Capture the current physical file under maintenance custody for awaited lease inspection, preserving identity and authority checks. Co-authored-by: steipete <[email protected]>
|
Merged via squash.
|
Await Doctor process and restart lease observations through the existing awaited cold-snapshot and committed warm-source readers. Preserve native-transaction refusal, original-source identity fallback, synchronous native supervisor callbacks, and current caller/PID checks before effects. Bind maintenance snapshots to the current physical file under custody when retained admission follows an earlier inode. Keep the split scoped to process/restart inspection, its direct consumers and tests. Remove inherited integration work and temporary diagnostics; test allocation is 193 net LF. Related: openclaw#178359, openclaw#187900. Not yet released. Co-authored-by: steipete <[email protected]> Co-authored-by: Christian Rodrigues de Oliveira <[email protected]>
Related: #178359, #187900.
What Problem This Solves
Doctor and service inspection can block cancellation while synchronously preparing Gateway process and restart lease observations. Awaited maintenance inspection also needs to follow a legitimately replaced state file rather than a retained admission's old inode.
User Impact
Process and restart observations await the existing read owner and cleanup. Offline maintenance can inspect the current physical state file after restoration or a database port. Native process signals, service actions and restart-intent writes still require current caller authority and captured process identity. This is the second split stage of the Doctor repair. Not yet released.
Why This Change Was Made
Use the canonical awaited snapshot/read transport for Promise-only lease inspection. Descriptive reads use the existing independent warm-source path when the retained writer's physical identity still matches, preserving native-transaction refusal and original-source fallback for replaced paths. Maintenance snapshot admission captures the current physical file under acquired custody while retaining caller admission, cancellation and custody checks after awaits.
Await direct service callers, preserve synchronous native-supervisor callbacks, and share the stale-process cleanup policy between async and native drivers. Restart-intent writes inspect their admitted transaction. Preserve main's live-Gateway copy exclusion.
The 37-file diff contains process/restart inspection, direct callers/tests and allocation records. Inherited backup implementation, auxiliary snapshot, schema, CI prerequisite and temporary diagnostic changes are removed. Previous stage #190870 is landed; #190873–#190875 remain separate. No stack branch was merged into another.
Evidence
Parent32cbe6 CI41472933181 proved both real Bun restart cases (972ms/625ms), all three serialized lifecycle cases and the complete 166-test CLI group. Its sole product failure was PG backup restore at lease admission: a new physical file was compared with the retained old inode. Recent main41465453264/job125345759351 passed that exact restore case, so no flake exception or failed-job rerun is used. This candidate fixes the lease owner and its regression; restore implementation is unchanged. New exact-head CI must be fully green before landing.
Local full update integration was stopped when canonical preflight unexpectedly started a prohibited runtime build; no local pass claimed. That consumer stays in PR CI under production-host restrictions. Native-platform/latest-stable upgrade qualification remains unrun. Immediate-slot Testbox requests queued and were stopped; no running production Gateway or operator state is used.
Current exact-head CI: 223e606ca3a7b.