Repository navigation
fix: make Activity recaps readable and resilient - #147901
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 2:56 PM ET / 18:56 UTC (Revision 17). ClawSweeper reviewWhat this changesImproves 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 Review scores
Verification
How this fits togetherActivity 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1029, Tests +1781, Docs +3, Other +31. Total +2844 across 59 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (16 earlier review cycles; latest 8 shown)
|
a9992d8 to
a7eeb0e
Compare
c20d333 to
aa69e57
Compare
21afc66 to
ce2d635
Compare
|
@clawsweeper re-review The previous exact-head review stopped during source preparation with retryable |
|
🦞🧹 I asked ClawSweeper to review this item again. |
cace7fe to
fcd975c
Compare
|
@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. |
ddc9b9c to
cb4fd43
Compare
|
Merged via squash.
|
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]>
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.
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.
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]>
…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]>
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.listactivity ordering applies before pagination and preserves sidebar pin ordering. Image discovery extendsartifacts.listwith 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-diffconfirms 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 forcb4fd431ce8e25bd42931d580f5196bafbab28d9, 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
After
Mobile hover card and expanded image