Skip to content

fix: make Activity recaps readable and resilient - #147901

Merged
steipete merged 9 commits into
mainfrom
codex/activity-recap-shimmer
Sep 14, 2026
Merged

steipete merged 9 commits into
mainfrom
codex/activity-recap-shimmer

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Activity recaps were difficult to scan, overloads produced avoidable errors, cached recaps could also say “unavailable,” and row ages did not match the feed’s ordering.

Related: #147441.

User Impact

Activity now uses shimmer loading, keeps existing recaps through refresh failures, and asks for one to three clear sentences describing the work and its current state. Rows show the configured agent avatar, useful GitHub hover cards, and up to four expandable transcript images. Sessions sort newest first using the same activity timestamp displayed in the row.

No database migration or operator configuration is needed. Existing recaps refresh gradually while retaining their text and transcript coverage. Cold archived image previews become available after opening the session; scrolling Activity does not restore entire cold transcripts.

Why This Change Was Made

The existing recap owner now runs a bounded, coalesced FIFO with two active calls, provider-specific backoff, and up to three retries for temporary failures. Provider error metadata survives the isolated completion boundary so overload and rate limits can be distinguished from terminal/configuration failures. Conversation excerpts omit tool calls/results and favor final answers.

The accepted additive sessions.list activity ordering applies before pagination and preserves sidebar pin ordering. Image discovery extends artifacts.list with bounded, connection-scoped pages, reads canonical uploaded media alongside content and Markdown images, and reuses Chat’s media policy and image viewer. GitHub cards reuse authorized PR snapshots while the existing preview owner fetches richer details. The optional prose revision remains inside the existing version-1 recap cache in session metadata.

Evidence

The rebased Activity sources passed the UI production build, i18n verification, 370 Gateway integration tests, 726 UI tests across 21 files, and all six Activity end-to-end cases. The subsequent test-only correction also passed all 140 Custodian tests and the standard changed-file gates. The memory shutdown repair passed 155 owner/sibling tests, including two delayed-scan regressions that both failed on the original source. The complete build also passed before the final patch-identical rebase. Synthetic desktop/mobile before/after captures demonstrate shimmer, cached-refresh failures, agent identity, GitHub cards, and image expansion. The canonical uploaded-image regression was verified red before the fix and green afterward through real persistence and the artifacts RPC.

All seven Activity commits retain identical added/removed lines after rebasing onto main; the catalog conflict resolution preserves both Dreaming and GitHub preview copy. The cloud and Docker fixture repairs encountered during validation are now upstream and are excluded from this PR. CI before the final rebase passed. The next CI run exposed a memory shutdown race, repaired below. Pre-rebase CI passed the memory shard, but two unchanged worker-transform cases exhausted their 120-second budget on a two-CPU runner. All seven cases in that shard passed locally unchanged; the two transform cases completed in 44 and 28 seconds. Main then landed the equivalent Custodian fixture fix in #148444, causing a content conflict. The required rebase retains main’s fixture and drops our duplicate commit; git range-diff confirms all nine remaining commits are patch-identical. All 175 focused memory and Custodian tests passed again on the rebased head. Current-head CI passed on its first attempt for cb4fd431ce8e25bd42931d580f5196bafbab28d9, including both the memory and worker-transform shards. A later content conflict in the test inventory required the final rebase. Main already contained the wizard routing fix twice, so this branch keeps one canonical entry, preserves the other upstream additions, and extends the existing Wizard exclusivity check. The seven Activity patches retain identical file identities and changed lines. Independent reviews of the Activity changes and catalog conflict resolution found no actionable issues through P2.

Validation history and limitations

CI for the previous head passed on its first attempt. An earlier unchanged config-patch case timed out once; all 79 cases passed locally and its complete bundled shard passed a failed-jobs-only retry without assertion or timeout changes.

CI also exposed an unchanged wizard recovery fixture in the thread pool, where the host SQLite broker is unavailable. The same 391-test wizard group reproduced the error locally; after correcting its existing test routing, all 391 tests passed across the original lane and the forked lane. All 67 selected routing cases and the changed-file gates passed. After the required rebase and duplicate cleanup, all 69 routing cases, targeted formatting/lint, and fresh independent P2 review passed.

A later plugin-inspection fixture rejected its persisted config once in Linux CI. All 32 file tests passed locally, and the same case passed within the saved concurrent CI plan. The broader local replay hit unrelated macOS Unix-socket path limits and a worktree disk-reserve refusal; those cases passed in Linux. Its bounded hosted retry was superseded when main developed the content conflict and is not counted as passing evidence.

The new base also included a shared wizard-control change that replaced binary radios and Continue with immediate choice buttons. One omitted Custodian lifecycle fixture reproduced its obsolete-selector failure locally (19 passed, 1 failed). Updating its interaction to the visible Twitch button made all 140 Custodian tests pass, preserving typed answers, session rotation, and no-replay assertions without timeout changes. Independent P2 review is clean.

CI then caught a memory watcher teardown race: startup transcript discovery could resume after manager close and recreate the agent database directory. The existing operation lifetime now owns startup and background transcript discovery, drains accepted work, and stops new admission during close. Two deterministic delayed-scan regressions failed before the fix and passed afterward, including discovery failure; all 155 selected memory tests passed. The standard changed-file gates also passed, including production/test types, lint, boundaries, and import checks. Independent P2 review found no actionable issues. No cleanup retry, timeout increase, schema, or retention change was added.

The local UI package run initially encountered stale cached transforms bound to another Vitest instance. The identical full selector group passed with a fresh task-owned transform cache, preserving its source, assertions, isolation, and timing limits. An earlier broader local bundled-shard probe hit two command-palette readiness timeouts; both cases passed hosted CI.

A manual fallback exhausted a 6 GiB SDK-report renderer heap before producing a compatibility verdict. Its duplicate remainder was cancelled, diagnostics were retained, and that fallback is not counted as passing proof. No live Gateway deployment was performed.

Thanks to @onlyysaurabh for the fixture correction used during validation; credit is retained for the final merge.

Before

Activity before

After

Activity after

Mobile hover card and expanded image

GitHub hover card on mobile

Expanded transcript image on mobile

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 14, 2026 04:35
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling extensions: codex size: XL maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 2:56 PM ET / 18:56 UTC (Revision 17).

ClawSweeper review

What this changes

Improves Activity recap readability, retry handling, loading feedback, and ordering; adds image previews and richer GitHub cards; and drains memory transcript discovery before shutdown.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains useful work beyond current main, with no blocking defect identified. The previous upgrade concern is addressed by the compatible cache format, documented rollback behavior, and old-format refresh coverage.

Priority: P2
Reviewed head: cb4fd431ce8e25bd42931d580f5196bafbab28d9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, well-supported work with inspected visual evidence, meaningful boundary coverage, and no identified blocking defect.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after desktop and mobile captures demonstrate the changed Activity presentation and image viewer through the synthetic Gateway UI flow. Backend lifecycle and compatibility tests supplement that proof; live provider retry recovery is not claimed, and the maintainer-authored PR is exempt from that ordinary contributor gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after desktop and mobile captures demonstrate the changed Activity presentation and image viewer through the synthetic Gateway UI flow. Backend lifecycle and compatibility tests supplement that proof; live provider retry recovery is not claimed, and the maintainer-authored PR is exempt from that ordinary contributor gate.
Evidence reviewed 11 items Pinned scope and necessity: Reviewed checkout cb4fd43 against the supplied merge base. Current main retains the earlier recap implementation; the merged foundational PR #147441 does not implement this follow-up.
Upgrade concern resolved: The optional formatRevision preserves payload version 1. Tests exercise previously cached text with and without new work, retain coverage during restyling, retain text after failure, and reuse the refreshed result after service restart. The documented persistence contract remains the approved reconstructible session-metadata cache.
Released metadata compatibility: The v2026.9.4 entry normalizer retains unrecognized optional metadata through canonicalValue. This supports preserving the additive recap field on rollback; it does not establish that these Activity improvements shipped in that release.
Findings None None.
Security None None.

How this fits together

Activity presents recent sessions using Gateway session metadata, transcript images, and GitHub details. The Gateway generates shared recaps through the configured utility model, while the UI displays cached results and bounded image previews.

flowchart LR
  A[Session transcripts] --> B[Gateway recap queue]
  C[Configured utility model] --> B
  B --> D[Existing session metadata]
  A --> E[Authorized image paging]
  D --> F[Activity feed]
  E --> F
  G[GitHub preview owner] --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1029, Tests +1781, Docs +3, Other +31. Total +2844 across 59 files.

View PR surface stats
Area Files Added Removed Net
Source 31 1417 388 +1029
Tests 22 2154 373 +1781
Docs 4 7 4 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 2 33 2 +31
Total 59 3611 767 +2844

Review metrics

Metric Value Why it matters
Production versus test growth Production/tooling net +1,046; tests/support net +1,781 Production growth is explained by bounded image discovery, UI presentation, and recap scheduling; substantial regression coverage accompanies it.
Additive contracts 3 image-list inputs, 1 sort value, 1 optional cache field Existing artifact listing and sidebar ordering remain defaults, while recap payload version 1 stays readable.

Stored data model

Persistent data-model change detected: unknown-data-model-change: extensions/memory-core/src/memory/manager-session-sync-ops.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Keep recap generation in the existing Gateway owner, preserve cached text across refresh failures, and reuse canonical session ordering and media-access contracts.

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

Yes, source inspection identifies the prior timestamp mismatch and loss of retry metadata; focused tests and supplied before/after UI evidence cover the reported symptoms. This review did not execute a fresh runtime reproduction.

Is this the best way to solve the issue?

Yes. The patch extends existing recap, artifact, media, and lifecycle owners, with additive protocol behavior and compatible cached metadata rather than competing implementations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 99ed9acfeb49.

Labels

Label justifications:

  • P2: Improves Activity usability and bounded background reliability without evidence of an urgent core outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after desktop and mobile captures demonstrate the changed Activity presentation and image viewer through the synthetic Gateway UI flow. Backend lifecycle and compatibility tests supplement that proof; live provider retry recovery is not claimed, and the maintainer-authored PR is exempt from that ordinary contributor gate.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after desktop and mobile captures demonstrate the changed Activity presentation and image viewer through the synthetic Gateway UI flow. Backend lifecycle and compatibility tests supplement that proof; live provider retry recovery is not claimed, and the maintainer-authored PR is exempt from that ordinary contributor gate.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after desktop and mobile captures demonstrate the changed Activity presentation and image viewer through the synthetic Gateway UI flow. Backend lifecycle and compatibility tests supplement that proof; live provider retry recovery is not claimed, and the maintainer-authored PR is exempt from that ordinary contributor gate.

Evidence

What I checked:

  • Pinned scope and necessity: Reviewed checkout cb4fd43 against the supplied merge base. Current main retains the earlier recap implementation; the merged foundational PR feat: show rolling session recaps in Activity #147441 does not implement this follow-up. (src/config/sessions/activity-summary.ts:4, 99ed9acfeb49)
  • Upgrade concern resolved: The optional formatRevision preserves payload version 1. Tests exercise previously cached text with and without new work, retain coverage during restyling, retain text after failure, and reuse the refreshed result after service restart. The documented persistence contract remains the approved reconstructible session-metadata cache. (src/gateway/session-activity-summaries.retry.test.ts:110, cb4fd431ce8e)
  • Released metadata compatibility: The v2026.9.4 entry normalizer retains unrecognized optional metadata through canonicalValue. This supports preserving the additive recap field on rollback; it does not establish that these Activity improvements shipped in that release. (src/config/sessions/store-entry-shape.ts:56, 3a9d69db306c)
  • Bounded recap ownership: The queue limits active work to two calls, retains slots until owned work settles, and preserves lifecycle, utility-route, transcript-branch, and synchronous commit checks. Existing coverage includes delayed preparation, deletion, owner replacement, and queued-write invalidation. (src/gateway/session-activity-summaries.ts:113, cb4fd431ce8e)
  • Image access and continuation: Image requests pass through the existing authorized session resolver. Continuations are connection- and query-bound, expire, and reject reset transcripts; tests cover copied cursors, changed roles, retargeting, and denied session access. Rendering reuses Chat's media policy and authenticated download owners. (src/gateway/server-methods/artifacts.images.test.ts:200, cb4fd431ce8e)
  • Affirmative Codex dependency boundary: The bounded-turn change consumes native Codex error notifications and failed-turn metadata through resolveCodexPromptError, making the dependency's error protocol directly relevant. (extensions/codex/src/app-server/bounded-turn.ts:326, cb4fd431ce8e)

Likely related people:

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

History

Review history (16 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-14T10:45:34.122Z sha ce2d635 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T10:52:55.590Z sha ce2d635 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T11:59:56.012Z sha cace7fe :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T14:12:56.240Z sha fcd975c :: blocked before merge. :: none
  • reviewed 2026-09-14T14:23:44.270Z sha fcd975c :: blocked before merge. :: none
  • reviewed 2026-09-14T16:38:29.660Z sha bdad76281e2a9f7b7e08540051bb363a66fc1739 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T18:14:20.570Z sha b3c99595eb5acd17997b963eda2a77e90bbe3394 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T18:44:30.812Z sha ddc9b9cd2f44036c4ce0c4dc652902b7bf9cecfd :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 14, 2026
@steipete
steipete force-pushed the codex/activity-recap-shimmer branch from a9992d8 to a7eeb0e Compare September 14, 2026 05:26
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 14, 2026
@steipete
steipete force-pushed the codex/activity-recap-shimmer branch from c20d333 to aa69e57 Compare September 14, 2026 06:45
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 14, 2026
@steipete steipete self-assigned this Sep 14, 2026
@steipete
steipete force-pushed the codex/activity-recap-shimmer branch 3 times, most recently from 21afc66 to ce2d635 Compare September 14, 2026 09:49
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The previous exact-head review stopped during source preparation with retryable review_blobs_unavailable / ETIMEDOUT, before code review. Please review the current head.

@clawsweeper

clawsweeper Bot commented Sep 14, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@steipete
steipete force-pushed the codex/activity-recap-shimmer branch from cace7fe to fcd975c Compare September 14, 2026 13:36
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review current head fcd975c. All seven Activity commits are patch-identical after rebasing onto main; the duplicated CI fixture repairs are now upstream and excluded from this PR. The refreshed base passed the full build, 370 Gateway tests, 726 UI tests, and all six Activity E2E cases. The PR body contains the current evidence and screenshot links.

@steipete
steipete force-pushed the codex/activity-recap-shimmer branch from ddc9b9c to cb4fd43 Compare September 14, 2026 18:49
@openclaw-barnacle openclaw-barnacle Bot added the extensions: memory-core Extension: memory-core label Sep 14, 2026
@steipete
steipete merged commit 540476d into main Sep 14, 2026
207 checks passed
@steipete
steipete deleted the codex/activity-recap-shimmer branch September 14, 2026 19:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
Make Activity recaps concise and resilient, with shimmer loading, retained cached text after refresh failures, and a bounded generation queue with backoff and transient retries. Recaps describe the work and its state in one to three sentences using conversation text rather than tool noise.

Show configured agent identities, cached GitHub hovercards, and up to four expandable transcript images. Sort sessions by the same activity timestamp shown in each row. Recap storage uses the existing SQLite metadata cache and requires no database migration.

Keep the canonical database-worker test inventory unique and verify Wizard exclusions after main incorporated the recovery-fixture routing fix. Preserve all assertions and production guards.

Drain background memory transcript discovery through the existing manager operation lifetime before close releases its database. Prevent delayed startup and event scans from reopening the store during teardown; cover successful and failed delayed discovery with regression tests.

Follow-up to openclaw#147441. The cloud, Docker, and Custodian fixture repairs encountered during development are now on main. Thanks to onlyysaurabh for the fixture correction used during validation.

Co-authored-by: onlyysaurabh <[email protected]>
steipete added a commit that referenced this pull request Sep 15, 2026
Keep Activity recaps moving when the visible session list changes during a request or the tab returns from interrupted background work. Reuse the existing request attempts and refresh coordinator.

Retain the last usable screenshot grid during refresh failures and retries, preserve initial partial results, and clear images after a successful empty response or a session/connection change. Keep shared GitHub preview success with its connection and agent so changing one provider does not invalidate another row.

Exclude legacy metadata-owned subagents before pagination and people facets while keeping ordinary forks visible. Remove redundant shared invalidation, a single-use snapshot closure, and an unnecessary cast; shrink its assertion baseline.

Follow-up to #147901. Validation includes 320 Gateway tests, 212 UI tests, nine Activity browser cases, complete changed-file checks, independent P2 review, and inspected before/after desktop and mobile screenshots.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
Keep Activity recaps moving when the visible session list changes during a request or the tab returns from interrupted background work. Reuse the existing request attempts and refresh coordinator.

Retain the last usable screenshot grid during refresh failures and retries, preserve initial partial results, and clear images after a successful empty response or a session/connection change. Keep shared GitHub preview success with its connection and agent so changing one provider does not invalidate another row.

Exclude legacy metadata-owned subagents before pagination and people facets while keeping ordinary forks visible. Remove redundant shared invalidation, a single-use snapshot closure, and an unnecessary cast; shrink its assertion baseline.

Follow-up to openclaw#147901. Validation includes 320 Gateway tests, 212 UI tests, nine Activity browser cases, complete changed-file checks, independent P2 review, and inspected before/after desktop and mobile screenshots.
obviyus added a commit that referenced this pull request Sep 19, 2026
Closes #151111

## What Problem This Solves

Fixes tool-free background completions stopping on a quota-exhausted account even when their prepared authentication plan already includes a healthy backup.

## User Impact

Completions using prepared profiles can recover from returned quota, rate-limit, or billing failures through an eligible backup account. Explicit account selections stay pinned. There are no configuration or public API changes, no cross-model fallback, and no new profile planning for the separate host-only single-credential path.

## Why This Change Was Made

The existing profile loop handled thrown failures but accepted returned error-valued assistant messages before validating them. The repair classifies quota failures inside that same loop, preserves their failure cause, and shares one inference budget across attempts. It rechecks caller authority and cancellation before another credential can be used; terminal and tool-bearing results do not authorize replay.

This retains the contributor's implementation and original commit. The pin regression now exercises the real authentication planner instead of asserting a mocked forwarding call, and the terminal-output case includes partial text. Related fixes #122163, #147901, #145853, and #151241 keep their existing responsibilities.

## Evidence

Verified through the shipped CLI, not a direct import of the completion owner:

`pnpm openclaw quota-proof run` → registered plugin `api.runtime.llm.complete({ execution: { mode: "isolated-agent-runtime" } })` → configured V2 harness → public SDK `runHostPreparedIsolatedCompletion` → loopback OpenAI-compatible HTTP provider.

The disposable plugin uses two synthetic API-key profiles in the native auth store, a private home/state/workspace, and an OS-assigned loopback port. It does not replace the completion transport.

| Scenario | Observed result |
| --- | --- |
| Main `90ab8619b3ec`: first account returns HTTP 429 / `usage_limit_reached` | One request; returned assistant error; caller receives `LLM_COMPLETION_OUTPUT_REJECTED`; backup is never requested. |
| Same main, healthy first account | One HTTP 200 request; exact expected text and selected harness owner. |
| Candidate `0c0f7e8b834c`: first account returns the same quota error | First account 429, backup account 200; returns `Recovered with backup profile.` Remaining inference budget decreases from 20,000 to 19,940 ms. |
| Candidate with explicit first-account pin | One HTTP 429 request and rejected output; no backup request. |

All observed model requests exposed no tools or functions. Listener identity and shutdown were verified. The pin proof uses production files byte-identical to the final head.

Focused verification: **67 tests passed** across isolated completion, resource ownership, and prepared/native-auth contract coverage, including cancellation, retired callers, shared deadlines, exhausted profiles, and terminal/tool-bearing output. Four-file type-aware lint completed with zero warnings/errors; formatting, whitespace checks, and the supported CLI runtime build passed.

Not tested: native Codex execution, live subscription credentials, a production Gateway, a production Dreaming sweep, or ordinary chat fallback. The proof harness is a synthetic registered adapter using the real host-prepared HTTP route.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…law#151133)

Closes openclaw#151111

## What Problem This Solves

Fixes tool-free background completions stopping on a quota-exhausted account even when their prepared authentication plan already includes a healthy backup.

## User Impact

Completions using prepared profiles can recover from returned quota, rate-limit, or billing failures through an eligible backup account. Explicit account selections stay pinned. There are no configuration or public API changes, no cross-model fallback, and no new profile planning for the separate host-only single-credential path.

## Why This Change Was Made

The existing profile loop handled thrown failures but accepted returned error-valued assistant messages before validating them. The repair classifies quota failures inside that same loop, preserves their failure cause, and shares one inference budget across attempts. It rechecks caller authority and cancellation before another credential can be used; terminal and tool-bearing results do not authorize replay.

This retains the contributor's implementation and original commit. The pin regression now exercises the real authentication planner instead of asserting a mocked forwarding call, and the terminal-output case includes partial text. Related fixes openclaw#122163, openclaw#147901, openclaw#145853, and openclaw#151241 keep their existing responsibilities.

## Evidence

Verified through the shipped CLI, not a direct import of the completion owner:

`pnpm openclaw quota-proof run` → registered plugin `api.runtime.llm.complete({ execution: { mode: "isolated-agent-runtime" } })` → configured V2 harness → public SDK `runHostPreparedIsolatedCompletion` → loopback OpenAI-compatible HTTP provider.

The disposable plugin uses two synthetic API-key profiles in the native auth store, a private home/state/workspace, and an OS-assigned loopback port. It does not replace the completion transport.

| Scenario | Observed result |
| --- | --- |
| Main `aba3ae6576a8`: first account returns HTTP 429 / `usage_limit_reached` | One request; returned assistant error; caller receives `LLM_COMPLETION_OUTPUT_REJECTED`; backup is never requested. |
| Same main, healthy first account | One HTTP 200 request; exact expected text and selected harness owner. |
| Candidate `0c0f7e8b834c`: first account returns the same quota error | First account 429, backup account 200; returns `Recovered with backup profile.` Remaining inference budget decreases from 20,000 to 19,940 ms. |
| Candidate with explicit first-account pin | One HTTP 429 request and rejected output; no backup request. |

All observed model requests exposed no tools or functions. Listener identity and shutdown were verified. The pin proof uses production files byte-identical to the final head.

Focused verification: **67 tests passed** across isolated completion, resource ownership, and prepared/native-auth contract coverage, including cancellation, retired callers, shared deadlines, exhausted profiles, and terminal/tool-bearing output. Four-file type-aware lint completed with zero warnings/errors; formatting, whitespace checks, and the supported CLI runtime build passed.

Not tested: native Codex execution, live subscription credentials, a production Gateway, a production Dreaming sweep, or ordinary chat fallback. The proof harness is a synthetic registered adapter using the real host-prepared HTTP route.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation extensions: codex extensions: memory-core Extension: memory-core gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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