Repository navigation
fix(status): self-heal status lazy-loader failures and contain render errors - #94806
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 4:00 PM ET / 20:00 UTC. ClawSweeper reviewWhat this changesThe PR changes six status lazy loaders to retry after rejected imports and returns fixed, redacted replies when Merge readinessKeep open: current main still has sticky status-loader rejection caching and lacks the command-boundary fallback; this focused PR repairs both without reopening the Plugin SDK surface or dropping rich status presentation. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe authorized flowchart LR
A[Authorized status command] --> B[Status reply builder]
B --> C[Lazy runtime loaders]
C --> D[Status text and presentation]
D --> E[Channel-visible reply]
C --> F[Failure fallback]
F --> E
Before merge
Agent review detailsSecurityNone. PR surfaceSource +7, Tests +166. Total +173 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the status-specific retry policy and command-boundary containment after exact-head CI, preserving the current structured success payload and limiting the self-healing claim to retryable import failures. Do we have a high-confidence way to reproduce the issue? Yes — current main’s sticky loader contract gives a high-confidence source reproduction path, and the PR body records an injected temporary module-resolution failure followed by same-process recovery. Is this the best way to solve the issue? Yes — status-owned loaders use the existing retrying primitive while the command owner contains channel-visible failures, avoiding a broader public SDK change or loss of rich presentation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bd7fb1d5976c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
All 8 commits pushed including CI guard test fix. Updated PR body with new HEAD \6f4f200f32. Requesting re-review. /clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Updated PR body with clean real behavior proof (screenshot of LINE /status working). Requesting re-review for SHA 3b7af3e2e8. /clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Rebased onto upstream/mainRebased 17 commits onto Key changes in this rebase
Verification
Diff vs upstream/main15 files, +329 -186. |
|
/clawsweeper re-review CI parallelism change removed from this PR (reverted commits b969643e0d + 50089dcbc0). PR body updated with clearer proof/scope documentation. Scope clarified: broader LINE delivery work tracked in #86012. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
/clawsweeper re-review Standalone proof scripts removed (their behavior is covered by unit tests: commands-status.test.ts timeout/throw tests + status-text.test.ts ??= retry test). PR body updated with timeout scope highlighted as maintainer decision item. Diff now 10 files, +212/-184. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
c88ce88 to
d23e979
Compare
|
/clawsweeper re-review Two P1 fixes applied:
Branch rebased onto latest upstream/main ( |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Rebased onto upstream/main Local proof available before push:
Proof gap called out in the PR body: local Vitest/Testbox could not be rerun from this machine after rebase because the clean worktree had no dependencies and Crabbox/Blacksmith CLIs were unavailable, so the exact pushed head needs GitHub CI/ClawSweeper verification. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Follow-up pushed: Local proof after the follow-up:
Please re-review the new head and CI rerun. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Rebased onto current
Tests, typecheck, and formatting verified locally. Ready for re-review. |
|
Heads up: the two red checks on this PR (
The branch has been rebased onto current |
|
Rebased onto current
Verification:
Codex review notes:
Head is now |
|
Addressed the re-review findings (head now [P1] Internal error leak — fixed. Maintainer-decision item (shared 10s deadline) — resolved by removal. Per the review's recommended option, the cross-channel render timeout was removed entirely. The shared Retry hardening — unchanged and verified. The in-memory loader retry ( "Persistent cache schema" — false positive. The Verification:
The two remaining red checks ( |
|
This pull request has been automatically marked as stale due to inactivity. |
@clawsweeper re-reviewHead rebased onto current 1. Rebase + lazy-loader boundary rework. The hand-rolled per-loader promise resets are replaced by a shared 2. Real behavior proof (redacted, injected failures).
Mutation check: reverting Tests: |
|
Merged via squash.
|
What Problem This Solves
Fixes the
/statusfailure mode from #94626: one transient module-load failure permanently poisoned every subsequent/statusreply until gateway restart, and a status-render failure could escape toward channel dispatch with internal error text.Both root-cause halves were verified live on current
main(@0d18fa8d8bd) before this rewrite:src/status/status-text.tscached rejected dynamic imports for the process lifetime (createLazyRuntimeModulehardcodescacheRejections: true, andloadStatusMessageRuntimeopted in explicitly). One failed import → every later/statusdegraded (e.g. permanent⚠️ Plugins: health unavailable) until restart.buildStatusReplyawaitedbuildStatusReplyPartswith no catch, so a render failure propagated out of the command boundary; andbuildStatusPluginsReplyinterpolated rawerror.messageinto the channel reply, leaking internal module paths to users.Note: #94626 was stale-bot-closed (
not_planned), but the reported behavior remains real on currentmain— this PR is the fix vehicle regardless of that close.Why This Change Was Made
buildStatusReplynow wrapsbuildStatusReplyPartsand returns a fixed generic reply on throw; diagnostics go to logs only vialogError(formatErrorMessage(error))(redaction-aware). The success path is untouched and still returns the full structured payload{ text, presentation, presentationTextMode: "fallback" }, so rich-capable channels keep native status cards.createLazyPromisedirectly — its eviction-on-rejection default means a transient failure retries on the next request. Deliberately no options parameter is added tocreateLazyRuntimeSurface/createLazyRuntimeModule/createLazyRuntimeNamedExport: those are re-exported from the publishedopenclaw/plugin-sdk/lazy-runtimesubpath, and widening them for a status-only need would turn it into a Plugin SDK contract (addressing the earlier ClawSweeper P1)./status pluginsnow replies with the fixed⚠️ Plugins: health unavailable; details stay in logs. This removes an actual channel-facing info-disclosure bug.main, preserving the rich-status payload work (feat(status): render /status as native rich tables on channels that support them #120167) that the previous head would have regressed.User Impact
/statusreply; the next request self-heals — no restart needed.Production delta:
+32/−25across two source files; tests+167/−1. Growth is the containment contract itself plus boundary tests; loader swap is net-negative (src/status/status-text.ts: +12/−14).Evidence
Focused tests (all green on this head):
pnpm test src/status/status-text.test.ts→ 13/13, incl. newbuildStatusText lazy loader retryregression (fails on pre-fix main: sticky cache pins the rejection, so recovery never happens).pnpm test src/auto-reply/reply/commands-status.test.ts -t "buildStatusReply error handling"→ generic-fallback containment + redacted log diagnostics (exact-object pin proves no presentation/internal-text leakage), rich-payload passthrough guard, plugin-health generic reply (fails on pre-fix main twice over: interpolation broke exact match,logErrornever called).pnpm tsgo:core,pnpm tsgo:test:srcclean. Lint clean on all four files.commands-status.test.ts(uses provider-qualified model overrides…120s timeout;uses workspace-scoped auth evidence…EPERM on temp cleanup) reproduce identically with those files checked out atmain; Linux CI is authoritative for those lanes.Real-behavior proof (mock-gateway harness per the repo's real-behavior gate): ephemeral dist-backed gateway + synthetic
qa-channeltransport +mock-openaiprovider, three real/statusrequests driven through the channel bus at head9cf1c42a416. Injection = renaming the single lazy-imported chunkdist/status-subagents.runtime-*.jsaway after startup (transient resolution failure — Node caches evaluation-time throws per specifier but not resolution failures, so this models the reported retryable class); file restored before request 2.{ "status": "pass", "headSha": "9cf1c42a416", "providerMode": "mock-openai", "channel": "qa-channel", "injection": "transient resolution failure (chunk file temporarily missing)", "request1FailureInjected": { "deliveredFallback": true, "fallbackMarker": "Status: error rendering response", "leakedInternalModuleOrErrorText": false, "deliveredTextRedacted": "⚠️ Status: error rendering response" }, "request2RecoverySameProcess": { "gatewayPidAtStart": 19004, "gatewayPidAfterRecovery": 19004, "sameGatewayProcess": true, "restoredModuleFile": true, "renderedNormalStatus": true, "deliveredTextRedacted": "🦞 OpenClaw 2026.8.1 … full normal status body (time/uptime/model/session/queue lines)" }, "request3Stability": { "renderedNormalStatus": true }, "assertions": { "fallbackDeliveredOnLoaderFailure": true, "noInternalLeakOnFailure": true, "nextRequestRecoversWithoutRestart": true, "subsequentRequestStaysHealthy": true } }(PIDs/timestamps above are from the recorded run; verdict JSON verbatim except the >900-char normal body abbreviated here.)
The harness script is intentionally kept as author-local scratch (untracked) rather than committed — it drives the public
extensions/qa-lab/api.jssurface only; reproducible via the pattern intest/e2e/qa-lab/runtime/cloud-worker-midturn-loss-proof.ts.Scope notes: synthetic-channel harness satisfies the mock-gateway proof gate; live LINE delivery and the LINE-specific token-expiry hypotheses from #94626 are separate surfaces, untouched here.