Skip to content

fix(status): self-heal status lazy-loader failures and contain render errors - #94806

Merged
steipete merged 1 commit into
openclaw:mainfrom
samson1357924:fix/line-94626-status
Aug 23, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
samson1357924:fix/line-94626-status

Conversation

@samson1357924

@samson1357924 samson1357924 commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the /status failure mode from #94626: one transient module-load failure permanently poisoned every subsequent /status reply 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:

  1. Sticky rejected imports. All six status lazy loaders in src/status/status-text.ts cached rejected dynamic imports for the process lifetime (createLazyRuntimeModule hardcodes cacheRejections: true, and loadStatusMessageRuntime opted in explicitly). One failed import → every later /status degraded (e.g. permanent ⚠️ Plugins: health unavailable) until restart.
  2. Uncontained render failures + info leak. buildStatusReply awaited buildStatusReplyParts with no catch, so a render failure propagated out of the command boundary; and buildStatusPluginsReply interpolated raw error.message into the channel reply, leaking internal module paths to users.

Note: #94626 was stale-bot-closed (not_planned), but the reported behavior remains real on current main — this PR is the fix vehicle regardless of that close.

Why This Change Was Made

  • Containment at the owning boundary. buildStatusReply now wraps buildStatusReplyParts and returns a fixed generic reply on throw; diagnostics go to logs only via logError(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.
  • Self-healing loaders without SDK growth. The six status loaders now use createLazyPromise directly — its eviction-on-rejection default means a transient failure retries on the next request. Deliberately no options parameter is added to createLazyRuntimeSurface/createLazyRuntimeModule/createLazyRuntimeNamedExport: those are re-exported from the published openclaw/plugin-sdk/lazy-runtime subpath, and widening them for a status-only need would turn it into a Plugin SDK contract (addressing the earlier ClawSweeper P1).
  • Plugins fallback de-interpolated. /status plugins now replies with the fixed ⚠️ Plugins: health unavailable; details stay in logs. This removes an actual channel-facing info-disclosure bug.
  • Rebased onto current 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

  • A transient module-load hiccup degrades exactly one /status reply; the next request self-heals — no restart needed.
  • Render failures now produce a visible, safe fallback instead of silence or an escaped exception (every action ends in a visible outcome).
  • Internal paths/error text can no longer reach chat through either status fallback.

Production delta: +32/−25 across 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. new buildStatusText lazy loader retry regression (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, logError never called).
  • Typecheck: pnpm tsgo:core, pnpm tsgo:test:src clean. Lint clean on all four files.
  • Two pre-existing, unrelated Windows-host flakes in 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 at main; 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-channel transport + mock-openai provider, three real /status requests driven through the channel bus at head 9cf1c42a416. Injection = renaming the single lazy-imported chunk dist/status-subagents.runtime-*.js away 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.js surface only; reproducible via the pattern in test/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.

@openclaw-barnacle openclaw-barnacle Bot added channel: line Channel integration: line size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 4:00 PM ET / 20:00 UTC.

ClawSweeper review

What this changes

The PR changes six status lazy loaders to retry after rejected imports and returns fixed, redacted replies when /status rendering or plugin health collection fails.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep 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
Reviewed head: 9cf1c42a416a59cb3b014dad9a8b27d32ceb5dee

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-backed repair with adequate production-boundary proof; exact-head CI remains the normal final gate.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body records an after-fix ephemeral gateway run through a synthetic channel, showing a delivered fixed fallback, no leaked text, and same-process recovery after the lazy chunk is restored.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body records an after-fix ephemeral gateway run through a synthetic channel, showing a delivered fixed fallback, no leaked text, and same-process recovery after the lazy chunk is restored.
Evidence reviewed 6 items Current-main defect: Current main uses an explicit sticky rejection cache for the message runtime and sticky lazy-runtime wrappers for the other status loaders; a rejected load remains cached rather than being retried.
Retry contract: The shared lazy-promise loader evicts the exact rejected promise by default, while the lazy-runtime wrapper deliberately enables cached rejections.
PR owner-boundary repair: The PR applies the retrying loader only to status-owned loaders and catches failures at the authorized reply boundary while retaining the successful structured payload.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw status --help

Result: PASS (completed)

pnpm openclaw status --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-94806-toirlz/target$ pnpm openclaw status --help
$ node scripts/run-node.mjs status --help
pnpm openclaw status --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 80.61 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.6s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 11.4s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 3385ms (slowest: built plugin control-plane loads 2675ms)
│
◇

OpenClaw 2026.8.1 (9cf1c42) — All your chats, one OpenClaw.

Usage: openclaw status [options]

Show channel health and recent session recipients

Options:
  --agent ‹id›    Agent id for --usage auth scope
  --all           Full diagnosis (read-only, pasteable) (default: false)
  --debug         Alias for --verbose (default: false)
  --deep          Probe channels (WhatsApp Web + Telegram + Discord + Slack + Signal) (default: false)
  -h, --help      Dis
… output truncated …

Assertions:

  • PASS expect_output: Show channel health and recent session recipients

How this fits together

The authorized /status command gathers optional runtime, queue, subagent, and plugin facts before producing plain text plus an optional structured presentation for channel delivery. Lazy imports provide several of those facts, and the command reply builder is the boundary that turns rendering results into channel-visible output.

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
Loading

Before merge

  • Resolve merge risk (P1) - The proof demonstrates recovery after a temporary module-resolution failure; it should not be read as a guarantee that Node-cached module-evaluation failures can self-heal.
  • Resolve merge risk (P1) - Production code is net +7 lines; the added command-boundary containment and redacted diagnostics are the concrete behavior that cannot be absorbed into the existing loader swap alone.
  • Complete next step (P2) - No repair dispatch is needed because the current PR has no discrete blocking defect; await normal exact-head CI before merge.
Agent review details

Security

None.

PR surface

Source +7, Tests +166. Total +173 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 32 25 +7
Tests 2 167 1 +166
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 199 26 +173

Review metrics

Metric Value Why it matters
Production versus test delta production +32/-25 (net +7); tests +167/-1 The small production increase is limited to visible failure containment and redacted diagnostics; the larger test delta protects retry and presentation behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body records an after-fix ephemeral gateway run through a synthetic channel, showing a delivered fixed fallback, no leaked text, and same-process recovery after the lazy chunk is restored.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body records an after-fix ephemeral gateway run through a synthetic channel, showing a delivered fixed fallback, no leaked text, and same-process recovery after the lazy chunk is restored.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: A retryable status-render failure can otherwise suppress an authorized channel command until gateway restart.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body records an after-fix ephemeral gateway run through a synthetic channel, showing a delivered fixed fallback, no leaked text, and same-process recovery after the lazy chunk is restored.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records an after-fix ephemeral gateway run through a synthetic channel, showing a delivered fixed fallback, no leaked text, and same-process recovery after the lazy chunk is restored.

Evidence

What I checked:

  • Current-main defect: Current main uses an explicit sticky rejection cache for the message runtime and sticky lazy-runtime wrappers for the other status loaders; a rejected load remains cached rather than being retried. (src/status/status-text.ts:111, bd7fb1d5976c)
  • Retry contract: The shared lazy-promise loader evicts the exact rejected promise by default, while the lazy-runtime wrapper deliberately enables cached rejections. (src/shared/lazy-promise.ts:55, 75aa8306f772)
  • PR owner-boundary repair: The PR applies the retrying loader only to status-owned loaders and catches failures at the authorized reply boundary while retaining the successful structured payload. (src/auto-reply/reply/commands-status.ts:27, 9cf1c42a416a)
  • Caller and test coverage: Text commands, native slash commands, inline status, and directive status all call buildStatusReply; added tests pin generic fallback, no leaked presentation, rich-payload preservation, plugin-health redaction, and same-module retry. (src/auto-reply/reply/commands-info.ts:251, 9cf1c42a416a)
  • History provenance: The shared lazy-cache behavior appears to date to the canonical single-flight cache change; the older lazy-runtime foundation is a related architectural predecessor. (src/shared/lazy-promise.ts:55, 75aa8306f772)
  • Release/main status: The proposed head is not contained by a local release tag and current main still contains the unfixed behavior, so this work is neither shipped nor superseded. (src/status/status-text.ts:111, 9cf1c42a416a)

Likely related people:

  • Peter Steinberger: Authored the canonical single-flight cache change that defines the retry-versus-sticky behavior used by this PR. (role: recent shared lazy-loader maintainer; confidence: high; commits: 75aa8306f772; files: src/shared/lazy-promise.ts, src/shared/lazy-runtime.ts)
  • obviyus: Merged rich-status work establishes the structured presentation contract that this PR preserves on success. (role: recent status presentation contributor; confidence: high; commits: 5e477aff2adc; files: src/auto-reply/reply/commands-status.ts, src/status/status-text.ts)
  • Dallin Romney: Authored the earlier lazy-runtime foundation behind the sticky runtime-wrapper policy. (role: lazy-runtime foundation author; confidence: medium; commits: 5458e316f363; files: src/shared/lazy-runtime.ts)

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-18T07:31:28.451Z sha ba27d6d2d7e8a9ddd82a341e5f54aff00791349a :: needs real behavior proof before merge. :: [P1] Preserve rich status presentation on rebase | [P1] Keep status retry policy out of the public Plugin SDK
  • reviewed 2026-08-23T08:23:28.137Z sha ba27d6d2d7e8a9ddd82a341e5f54aff00791349a :: needs real behavior proof before merge. :: [P1] Preserve the structured status reply | [P1] Keep retry policy out of the public Plugin SDK

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 19, 2026
@samson1357924

Copy link
Copy Markdown
Contributor Author

All 8 commits pushed including CI guard test fix. Updated PR body with new HEAD \6f4f200f32. Requesting re-review.

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 19, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 19, 2026
@samson1357924

Copy link
Copy Markdown
Contributor Author

Real behavior proof - LINE /status command

Bot: 爬蟲蝦(scraper_claw) on LINE
Command: /status
Response: OpenClaw 2026.6.8, Gateway uptime 1d 1h, System uptime 1d 1h

Screenshot of live LINE conversation:

LINE /status proof

@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 19, 2026
@samson1357924

Copy link
Copy Markdown
Contributor Author

Updated PR body with clean real behavior proof (screenshot of LINE /status working). Requesting re-review for SHA 3b7af3e2e8.

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 19, 2026
@samson1357924

Copy link
Copy Markdown
Contributor Author

Rebased onto upstream/main

Rebased 17 commits onto 574604e3da (+257 upstream commits).

Key changes in this rebase

  • src/infra/tailscale.ts — dropped from our diff (upstream already merged the identical curly-brace fix in 60d55a1725)
  • test/scripts/lint-suppressions.test.ts — merged both our entry and upstream's new agent-bundle-mcp-runtime.ts entry (alphabetical order)
  • All other 11 files rebased cleanly with zero conflicts

Verification

Check Result
Code review (subagent) APPROVED — 0 blocking/important issues
status-text.test.ts 6/6 PASS
commands-status.test.ts 38/39 PASS (1 pre-existing flake, not from this PR)
ci-workflow-guards.test.ts 33/33 PASS
lint-suppressions.test.ts 3/3 PASS
oxlint status-text.ts 0 errors
oxlint commands-status.ts 0 errors

Diff vs upstream/main

15 files, +329 -186.

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jul 2, 2026
@samson1357924

Copy link
Copy Markdown
Contributor Author

/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.

@clawsweeper

clawsweeper Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 2, 2026
@samson1357924

Copy link
Copy Markdown
Contributor Author

/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.

@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@samson1357924
samson1357924 force-pushed the fix/line-94626-status branch from c88ce88 to d23e979 Compare July 3, 2026 17:40
@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 3, 2026
@samson1357924

Copy link
Copy Markdown
Contributor Author

/clawsweeper re-review

Two P1 fixes applied:

  1. Removed stale createLazyPromise/createLazyRuntimeModule imports from src/status/status-text.ts:45 (caused check-lint + check-prod-types failures — rebase merge artifact)
  2. Removed dead clearTimeout(timer) inside setTimeout callback in src/auto-reply/reply/commands-status.ts:28 (no-op, timer already fired by the time callback executes)

Branch rebased onto latest upstream/main (

@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@samson1357924

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased onto upstream/main 9606fe4323 and pushed ccd5a681ba. I also tightened the retry-cache test so it proves the same imported status-text.ts module falls back after a dynamic import failure and retries successfully on the next render without resetting modules between attempts.

Local proof available before push:

  • git diff --check -- src/status/status-text.test.ts — pass
  • git diff --check upstream/main...HEAD — pass
  • Code reviewer + test engineer re-read the final diff; no blocking findings.

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.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@samson1357924

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Follow-up pushed: a2d83ae5d9 removes the unused static buildStatusText import that caused check-lint to fail on the prior pushed head. Code reviewer and test engineer both reviewed the lint fix; no blocking findings.

Local proof after the follow-up:

  • git diff --check upstream/main...HEAD — pass
  • CI failure inspected: check-lint job 85419200808 failed only on src/status/status-text.test.ts:2 unused buildStatusText import, now removed.

Please re-review the new head and CI rerun.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@samson1357924

Copy link
Copy Markdown
Contributor Author

Rebased onto current upstream/main and addressed the review/CI findings:

  • Root cause: dynamic runtime loaders in src/status/status-text.ts cached rejected import promises, so a single transient failure made every later /status call fail silently on LINE.
  • Fix: loaders now reset their module-level promise to null on .catch() and retry; buildStatusReply (src/auto-reply/reply/commands-status.ts) races buildStatusText against a 10s timeout and returns a clear fallback instead of hanging.
  • Cleanup: removed the now-unused lazy runtime barrels (status.runtime.ts, status-message.runtime.ts, status-queue.runtime.ts) and the test:build:status-message-runtime script.
  • CI: the previous check-test-types failure was a pre-existing discord test error already fixed on main; the rebase clears it. Also fixed a resoved→resolved typo in the error-handling tests so they typecheck, and verified formatting with oxfmt.

Tests, typecheck, and formatting verified locally. Ready for re-review.

@samson1357924

Copy link
Copy Markdown
Contributor Author

Heads up: the two red checks on this PR (check-lint and check-additional-runtime-topology-architecture) are pre-existing failures on upstream/main, not caused by this change.

  • check-lint fails on src/auto-reply/reply/queue.drain-restart.test.ts (L260/L525 no-shadow) and src/gateway/server.chat.gateway-server-chat.test.ts (L217/799/800). Both errors exist verbatim on upstream/main and neither file is touched by this PR (the diff is only package.json, src/status/status-text.*, src/auto-reply/reply/commands-status.*, plus deleted runtime/test scripts).
  • check-additional-runtime-topology-architecture is a Madge import cycle spanning src/agents/* + status-text.types.ts. This PR's status-text.ts change only adds .catch() retry logic around the pre-existing import("../agents/harness/selection.js") edge — it introduces no new import. The cycle nodes are unmodified by this PR.

The branch has been rebased onto current upstream/main to clear the "out-of-date" state. Please don't block on those two unrelated main-side failures.

@samson1357924

Copy link
Copy Markdown
Contributor Author

Rebased onto current upstream/main (clears the out-of-date state) and added a quality pass:

Verification:

  • Code review: APPROVED (0 blocking issues).
  • Test engineer: PASS — status-text.test.ts 6/6; the new commands-status.test.ts timeout + throw fallback tests pass. The single unrelated commands-status.test.ts flake (120s hang in a buildStatusText-direct test) is pre-existing and outside this PR's scope.

Codex review notes:

  • Real behavior proof is linked in the PR body (LINE /status screenshot).
  • The ??= retry cache flagged as a "persistent cache schema" is a false positive — it is in-memory test state with no persisted schema; the production retry cache is also in-memory and resets on rejection.

Head is now d38d032fef5. Requesting re-review.

@samson1357924

Copy link
Copy Markdown
Contributor Author

Addressed the re-review findings (head now 5f964e58b46, rebased onto current main):

[P1] Internal error leak — fixed. buildStatusReply now returns a fixed generic message (⚠️ Status: error rendering response) and keeps the full diagnostic in logVerbose only. The channel reply no longer interpolates the caught exception, so module paths or runtime details never reach users. Test updated to assert the internal error text is not in the reply.

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 /status command path (commands-info.ts) serves every channel, so a fixed deadline needs explicit owner sign-off and representative cross-channel proof; the retry hardening already addresses the root cause (cached rejected import). Channel-specific timing can be handled in a separate change if evidence requires it. This also removes the merge-risk: message-delivery concern.

Retry hardening — unchanged and verified. The in-memory loader retry (status-text.ts) is the root-cause fix; status-text.test.ts 6/6 pass (including the retry-after-import-failure test).

"Persistent cache schema" — false positive. The ??= retry cache in status-text.test.ts is in-memory test state with no persisted schema; the production retry cache is also in-memory and resets on rejection. No migration applies.

Verification:

  • status-text.test.ts: 6/6 pass.
  • commands-status.test.ts error-handling: the fallback test passes (generic message, internal error not leaked).
  • oxfmt: clean. git diff --check: clean.
  • Net code change for this commit: +9/−73 (removed the timeout race machinery and its test).

The two remaining red checks (check-lint, check-additional-runtime-topology-architecture) are pre-existing on main and outside this PR's scope. Requesting re-review.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@samson1357924

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head rebased onto current upstream/main (edfeec49e7) and squashed to a single commit d98f2ab72a. The rework addresses both blocking items:

1. Rebase + lazy-loader boundary rework. The hand-rolled per-loader promise resets are replaced by a shared LazyRuntimeLoaderOptions { cacheRejections?: boolean } on src/shared/lazy-runtime.ts (default stays true, preserving all ~40 existing call sites). All six status loaders in src/status/status-text.ts pass { cacheRejections: false }, so a failed import is evicted and retried on the next request in the same module instance. The unused-barrel deletions from the earlier revision are reverted (they are part of current main's lazy-boundary design).

2. Real behavior proof (redacted, injected failures). node --import tsx scripts/repro/status-lazy-retry-proof.mts (isolated OPENCLAW_STATE_DIR) exercises production functions:

  • Scenario A: injected transient module failure -> next load() in the same loader instance re-imports and resolves (importer ran exactly twice).
  • Scenario A2: old default (cacheRejections: true) re-throws the cached rejection with the importer run once — the poisoning bug reproduced.
  • Scenario B: production buildStatusReply with an injected render failure returns exactly ⚠️ Status: error rendering response; injected error text and internal module paths are absent from the reply.
  • Scenario C: healthy default path renders a real status body.
  • ALL PROOF ASSERTIONS: 10 passed, 0 failed (full transcript in the PR body).

Mutation check: reverting loadStatusPluginHealthRuntime to cacheRejections: true turns the new retry test red (status-text.test.ts); restored, it passes.

Tests: lazy-runtime.test.ts 4/4, status-text.test.ts 13/13, commands-status.test.ts error-handling 3/3. tsgo:core typecheck, oxlint (0/0), oxfmt, import-cycles all clean. The 6 pre-existing commands-status.test.ts environment failures (timeouts/EPERM) reproduce identically on pristine upstream/main on this Windows machine; CI is the reliable venue.

@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: blank-template Candidate: PR template appears mostly untouched.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants