Repository navigation
feat(update): enter built-in triage after failures - #134865
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 1:28 PM ET / 17:28 UTC. ClawSweeper reviewWhat this changesThis PR adds bounded diagnostic triage after operational update failures in the CLI and Control UI while preserving updater recovery and operator admission controls. Merge readinessKeep open: the earlier preflight concern is resolved by the explicit admission-versus-operational-failure boundary, and no concrete introduced functional or security defect was found. Native Windows Scheduled Task and launchd recovery paths still lack after-fix behavior proof. Priority: P2 Review scores
Verification
How this fits togetherAn update attempt passes admission checks, installation and service recovery, then reports its outcome. Operational failures can prepare redacted diagnostics for a CLI handoff or an operator-gated Control UI conversation. flowchart LR
A[Update attempt] --> B[Admission checks]
B --> C[Install and service recovery]
C --> D[Recorded failure outcome]
D --> E[CLI diagnostic handoff]
D --> F[Control UI triage]
F --> G[Operator-gated Custodian turn]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Add redacted after-fix traces for native Windows Scheduled Task and launchd recovery, or record explicit maintainer acceptance of that remaining platform-proof gap. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a diagnostic feature rather than reporting a current-main defect. Is this the best way to solve the issue? Yes for the reviewed failure boundary: admission refusals remain excluded while post-admission operational failures are diagnosed after recovery; native-platform proof remains incomplete. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 968256ff2965. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
@clawsweeper re-review The automatic diagnostic turn for an authorized Control UI operator is the intended, maintainer-approved default for this feature. It receives bounded, redacted failure facts through the existing conversation owner; repair, retry, and restart authority remain separate. Unattended CLI updates collect diagnostics without automatically starting an agent. The requested after-fix non-git installed proof is now complete and documented in the PR, with screenshots from the verified npm package. Real Gateway/WebSocket traffic showed one failed update and one diagnostic turn, with the ordinary draft preserved and no replay across reload, status checks, and Gateway leave/return. With inference unavailable, the failure and host command stayed visible and no diagnostic turn was sent. Both runs had zero browser errors and unchanged installed payloads. There is no SQLite schema change or data migration in this PR. The saved failure file is a redacted support export. Browser continuity extends the existing tab notice with bounded scoped receipts; coverage includes existing notices without the new fields. The complete changed-file gate and focused owner/browser suites pass. The final head additionally removes five stale process-test stubs; all ten unchanged output/exit cases now pass, and that test-only repair passed independent review. Hosted CI is running on 34ba77d. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Require persisted diagnostic receipts, retain authoritative attempt identity, and retire prior failures when a new update campaign starts. Roll back only known-unsent chat rows and consumed ordinary drafts after transport failure. Keep connection lifecycle scheduling synchronous by removing the deferred bootstrap wrapper. Integrate main while preserving composer persistence and existing stream performance budgets. Keep artifact paths and installation-specific recovery commands in local output while persisting bounded diagnostic summaries for restart notices. Redact captured output before shortening failure details so clipping cannot remove credential syntax, and retain concrete types in update test fixtures.
Keep helper paths local, retain update identity across reloads, and preserve verifier failures while campaigns settle. Admit diagnostics after recovery becomes idle, preserve newer composer drafts, and integrate the canonical Settings catalog.
|
Built-in failure diagnosis now follows CLI, background, managed-service, and web failures while the updater retains recovery/restart authority. Read-only admission refusals finish before diagnostics can write state. Browser attempt identity, durable scoped receipts, idle-only presentation, and draft ownership prevent stale or duplicate diagnosis. Five refusal regressions failed on the old built runtime; all ten process-state tests now pass, including the subsequent replay, alongside 403 owner tests. A fresh full runtime/UI build, integrity check, npm installation, and three real installed browser flows passed. The latest merge-only declaration failure is repaired with exact fragment types: native SDK emit and a consumer of all 867 emitted keys pass; the two type/lint-only runtime edits produce identical module JavaScript. The registry guard now checks exact type/runtime fragment agreement; all four corrupt variants are rejected. Full protocol checks, unchanged Swift/Kotlin outputs, lint, and the script-only review passed. Fresh managed npm failure proof also passed: lifecycle exits 42, original updater error/exit 1, one healthy restart, exactly one diagnostic child and prompt, redaction, durable export reuse and cleanup. Current process preparation preserved 7,532 non-UI JavaScript files; 6,486 core JavaScript files match the validated package, without claiming complete package-tree equality. Current head: On the new preflight finding: the documented exception is for command admission—arguments, supervisor ownership, handoff identity and immutable-config mode. Those checks run before triage. Failed operational metadata/schema/runtime/service checks after admission intentionally receive diagnostics while still blocking installation. The cited schema test has already stopped the service and verifies recovery, no package install, the original error, then diagnosis. The same reason also covers earlier checks, so excluding the reason would remove useful post-stop diagnosis. We are retaining this intended behavior; diagnostics do not override a guard or retry the update. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Completion proof is recorded for The 17:02 UTC review exposed ambiguous supervisor-ownership wording; the docs now explicitly distinguish initial external-supervisor/state-store admission from admitted managed-service diagnosis. The installed inherited-PID refusal proof retained CLI error/exit 1, ran one collector and zero agents, and left the service and 11,356 package files unchanged. This does not prove literal process ancestry. All refusals continue to block installation; diagnosis cannot retry or override them. Native Windows/launchd live-proof limits remain explicitly accepted; Linux/PowerShell results are not claimed as native equivalents. |
|
Merged via squash.
|
* feat(update): enter built-in triage after failures * test(triage): make command indentation assertion explicit * test(update): use real helpers in finalization process fixture * test(google-meet): isolate callback timeout propagation * fix(update): admit commands before collecting failure diagnostics * fix(build): preserve named protocol schema declaration types * fix(build): validate annotated protocol registry composition * docs(update): clarify diagnosis after service refusals * fix(build): align protocol registry with main
What this changes
Failed CLI, background, managed-service, and web updates lead directly into built-in investigation. The updater retains installation, recovery, and restart authority; diagnostics cannot retry an update or turn a successful recovery check into an update success.
Interactive CLI failures open the existing triage picker after recovery and cleanup. JSON,
--yes, and background flows collect diagnostics without automatically starting an agent. Original exit codes and JSON stdout remain authoritative. Web failures open Ask OpenClaw with the recorded cause and an investigation-first prompt; repairs require approval. Unavailable diagnosis preserves the failure and host-side guidance. Cancellation, no-op results, and pending handoffs do not start diagnosis.Initial argument, external-supervisor/state-store ownership, handoff identity, and immutable-config refusals finish before triage in both update and repair, without diagnostic exports or agents. After admission, metadata/schema/runtime/service failures intentionally receive diagnostics after recovery, including refusal to stop the command’s parent Gateway process. Diagnosis does not stop that Gateway or retry the update. A schema change detected after service stop still requires recovery and diagnosis. Every refusal blocks installation; diagnosis cannot retry or override it. Prepared decisions flow into execution without a mutable admission flag.
Ownership and privacy
Lazy English catalogs have one composition owner; cold triage registers fact labels before a Settings visit. No new configuration, environment variable, dependency, database schema, or automatic retry is introduced.
Validation
Head:
40f4e393eebeff704a6499b07207780a6aa3402f; treeb4fd68056550693b19b6f8ae226ed8746459afe1. The full implementation and focused corrections were independently reviewed without accepted actionable P0–P2 findings.The five-path admission/declaration and one-script changed gates passed at
cb5010abb363and1836c71d0f84. The current full protocol check passed with unchanged generated outputs. Full exact-head CI passed.Five refusal regressions failed against the old built runtime; all ten process-state cases now pass, including replay at
cb5010abb363. They cover invalid update/repair arguments, external state ownership, and handoff mismatch. SHA-256 snapshots retain full path/type/content comparison. The admission repair also passed 403 owner tests across five files.A complete runtime/UI build, mandatory tarball integrity check, and fresh npm installation passed at
b1d46d9c457e. Archive99cd340748b87a96149c0fde0a993f2d9ecc2ba9b8b7ed0e008abac5c01f3c68matched all 11,356 retained installed payloads and 1,613 UI entries. Three real Gateway/WebSocket/browser flows, without RPC mocks, recorded update/diagnostic/status counts of 1/1/12 with inference, 1/0/5 without it, and 1/0/7 with denied storage. Draft/guidance preservation, reload and Gateway-return replay protection, health, credential scans and cleanup passed.The CI merge exceeded the compiler’s inferred declaration limit. Exact fragment types preserved 867 public keys and representative field types in emitted-declaration proof. The candidate adopts the canonical main annotation and strict registry guard verbatim; duplicate PR-side fixes are removed against that main. Full protocol checks preserve generated Swift/Kotlin outputs. Earlier positive/negative guard and compiler reproductions retain their original source scope.
Fresh managed npm failure proof passed: both lifecycle failures stayed exit 42, updater JSON stayed error/exit 1, and one healthy restart preceded exactly one diagnostic child and prompt. Privacy, durable export reuse, and service/registry cleanup passed. At
cb5010abb363, process preparation preserved all 7,532 non-UI JavaScript files; all 6,486 core JavaScript files match the validated package. Complete package-tree equality is not claimed. Unchanged UI/platform proof includes 505 selected tests, the 95-path gate, and eight real npm/channel scenarios.A real installed CLI refusal exercised the inherited service PID marker matching a live managed Gateway. JSON stayed cli_error/exit 1; one diagnostic collector and zero agents ran. The service and all 11,356 retained package files stayed unchanged. Cleanup passed. This tests inherited service identity, not literal parent-process ancestry. The documentation now explicitly distinguishes this diagnosed operational refusal from read-only initial command admission.
PowerShell 7.4.19 on Linux ARM64 passed 18 real-child argument/input/environment checks. Native Windows shims/Scheduled Tasks and native launchd lack live proof. The maintainer accepts that explicit gap based on Linux managed-helper proof and platform branch tests, which do not establish native service-manager behavior. Deterministic local inference proves transport/lifecycle, not external reasoning.
99 paths against
165d1c0b9a49. Production/build: +2,459/−804, net +1,655 across 50 files; excluding 204 unchanged moved lines: +2,255/−600. Tests/support: +5,292/−656, net +4,636 across 43 files. Docs: +67/−14; baselines: +1/−2; generated manifest: +4/−1. Growth supplies diagnostics and scoped ownership; duplicate projection, catalog and deferred lifecycle paths are removed.Before: welcome suggestions blocked diagnosis. After: drafts and failure guidance survive. Images show the unchanged UI on an earlier validated package.