Repository navigation
fix: keep learning from chat history when a conversation disappears - #208098
Conversation
Treat a missing history as one skipped source without moving its checkpoint. Keep other Scribe failures visible. Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 5d705984-2146-451f-b8fc-607c74d6a351
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 4b63c554-03bc-4338-aa43-29d9ab153bd3
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: passed. What this changesThis PR skips vanished conversation sources and publishes each readable window’s lessons and checkpoint together, with incremental reads and published-window recovery. Example: A Scribe lists a temporary cron conversation and agent:main:harbor-clock, then the cron conversation disappears.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a demonstrated Scribe failure, and the current source resolves both prior findings. No definite remaining correctness or security defect was found; exact-head CI is still running. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherKnowledge Scribes consume agent-scoped session inventories and history, extract cited lessons, and publish claims and progress through Knowledge’s existing storage and mutation owners. flowchart TD
A[Scribe run] --> B[Agent scoped session tools]
B --> C[Conversation progress tracking]
C --> D[Knowledge conversation operations]
D --> E[Existing batch publication]
E --> F[Claims checkpoint and receipt]
Technical reviewBest possible solution: Keep missing-source continuation and atomic window publication while preserving existing cursors, agent scope, and ordinary mutation retry validation. Do we have a high-confidence way to reproduce the issue? Current-main instructions treat step failures as terminal without an unavailable-history exception, and the supplied isolated Gateway comparison demonstrates that a listed cron conversation can disappear before its history read. Is this the best way to solve the issue? The implementation preserves the existing session-access and batch-publication owners while making skipped sources and completed windows explicit; the focused tests cover legacy progress, pagination, replay, and premature settlement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6889eb07bb41. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +919, Tests +591, Docs +35, Other +2. Total +1547 across 32 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed November 29, 2026, 6:40 PM ET / 23:40 UTC (Revision 5). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Dependency graph guard clearedThis PR no longer has dependency changes awaiting review. A future dependency graph change requires an admin or SecOps member’s
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Security-sensitive guard clearedCurrent revision: This PR no longer changes files in the maintainer security-review tier. Separate CODEOWNERS requirements still apply to security policy and enforcement files. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Keep the observed session-list activity alongside the last message read. An unchanged listed source is already covered even when the session and message timestamps differ. Report the original request ID and resolve an already-published window through the source receipt without issuing a new mutation or counting its claims again. Publish each readable window with its lessons, skip only vanished sources, and keep the payload checks on unresolved and ordinary writes.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|




Related to #207960.
What this fixes
Learn from chat history can lose a conversation between listing it and reading it. Scribe skips a listed source that returns
No session foundand continues with the readable sources in the same agent-scoped list.Each readable window publishes its lessons and checkpoint together. The checkpoint records the last message read, the activity time observed during listing, and the publication request ID. Existing Markdown checkpoint entries retain their last-learned time. For a changed source, history supplies only messages newer than that time and stops paging when it reaches the saved cursor. An unchanged listing is covered on the next run. If listing activity changes without a new message, a verified reread refreshes that activity marker.
A duplicate delivery returns the original published receipt with
alreadyPublishedand adds zero claims. Pending mutations retain their original payload checks. This preserves the reason changed mutation retries are rejected and keeps checkpoints scoped to sources listed by the current run. Changed retries · Conversation scopeVerification
On a fresh AWS CrabBox, the calibrated Qwen2.5-32B-Instruct provider ran the real cron list/delete/read race against main and this PR.
16b04e24a41ee4a974558b2aalreadyPublished: true.The source activity time was 47 ms later than the saved message time. The replay's final text counted one conversation as learned and reported zero writes. The tool trace records the source as already covered, and the vault contained exactly one claim throughout replay.
A stable-to-head upgrade wrote a checkpoint and claim using v2026.11.12 and reopened the same vault on this head. The original claim, note and mutation receipt survived. Bullet, tab, whitespace and date-first entries retained their cursors. Updating the selected entry preserved the others. The incremental-history regression returned only the newer message on a page containing a clipped, previously learned message and stopped at the saved cursor. Stable release
The runtime build, 136 focused tests, type-aware lint, formatting, and core and Knowledge type checks passed. The PR allocates 191 test lines above the standard allowance for the opt-in real Gateway race and the storage, pagination and terminal-settlement regressions.
Contributor: @daniel-lxs
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by
🦞 Made with OpenClaw