Repository navigation
fix(knowledge): scribe retries repeat the request after a lost response - #198030
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR preserves scribe retry identities across failed sends and Gateway reconnects and adds incident citations to existing Granola instructions. Example: Knowledge Consolidation stays unchanged for three minutes, then a Try again response is lost.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review This PR fixes a current retry defect with focused changes and recorded real-Gateway results; no actionable findings remain, and current-head CI passes. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Knowledge Scribes page reads automation and conversation state, sends update requests through the authenticated plugin host, and watches the scheduler for the resulting changes. flowchart TD
A[Scribes page] --> B[Gateway scoped retry state]
B --> C[Current plugin host]
C --> D[Gateway chat send]
D --> E[Scribe conversation]
E --> F[Scheduler automation]
F --> A
Technical reviewBest possible solution: Keep the existing attempt map and replacement closure as owners, retaining each failed request identity across reconnects until its send succeeds. Do we have a high-confidence way to reproduce the issue? Current-main source exposes both identity-loss paths, and the supplied Gateway comparison records duplicate accepted inputs before the reconnect repair; this review executed no target code. Is this the best way to solve the issue? The change restores one request identity per failed send using existing owners, and its focused regressions cover the distinct automatic-update, replacement, and reconnect boundaries without unnecessary machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e711369ecfc3. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +19, Tests +26, Docs +5. Total +50 across 4 files. Added test files: 0. 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. 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 follows the weaker of proof and patch quality; ✨ 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 (1 earlier review cycle)
Reviewed November 13, 2026, 12:04 AM ET / 05:04 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…se (openclaw#198030) * fix(knowledge): scribe retries repeat the request after a lost response * fix(knowledge): keep scribe update attempts across Gateway reconnects
Related: #197391
What Problem This Solves
Fixes duplicate scribe update turns when Try again reaches the Gateway but its response is lost, and the update is sent again.
User Impact
Owners can retry automatic updates and run-message replacements after a lost response without starting a second turn for the same attempt. No stored-data format, permissions, generated run-message bytes, or visual presentation changes.
Why This Change Was Made
The final review of #197391 identified two P2s: late retries discarded their failed request identity, and new Granola instructions lacked an incident citation. This follow-up retains each retry identity until its send succeeds and adds the citation. The existing attempt map and replacement closure remain the owners; no new retry machinery or helpers.
The real-Gateway proof below found a third path: in the Control UI a lost response arrives as a dropped connection, and the page reconnects with a new plugin host. Attempts and pending updates were kept per host, so the reloaded page forgot the unsent retry and sent the update again under a new identity. They are now kept per Gateway (the Control UI base path), and Try again sends through the page that asks.
Evidence
Unit and static checks at
02995e6c49e7:457d4aa("Updating…" with a third send) and passes with the fix.git diff --checkpass.Real-Gateway proof on the Mac Studio
Isolated Gateways on loopback ports 19821–19823, each with its own state directory and token; real model turns through ClawRouter; headless Chromium driving the Control UI. The live fsn1 Gateway and the Studio's own Gateway were not touched. Builds:
v2026.11.3(847611dc), pre-#197391 main (69b3f27b), this PR (457d4aaand02995e6). Each upgrade stopped the old Gateway, ran the new build'sdoctor --fix --yes --non-interactiveon the same state, then started the new build.1. Released scheduler storage → this PR (
v2026.11.3→02995e6). Created throughv2026.11.3'scron.add: asession:<key>cron job with tz, stagger, pacing, trigger, model, thinking, timeout, fallbacks,lightContext,toolsAllow[2 tools], delivery none and failure alert {after 3, cooldown, includeSkipped}; a paused isolated interval job withtoolsAllow: []and failure alert off; a main-sessionatreminder. A forced run succeeded onv2026.11.3. After the upgrade, all three jobs compared field-for-field equal (excluding run state and revision), the paused job stayed paused, and forced runs succeeded on the new build: the session job answered inagent:main:kn-lane1-target, the tool-less isolated job in a freshcron:…:run:…session. (The built-inheartbeat-mainrecord migrated to its current form, as main does; not touched by this PR.)v2026.11.3has no Knowledge plugin, so this lane exercises scheduler storage only.2. Pre-#197391 Scribes → this PR (main to main; run twice, on
457d4aaand on02995e6). On69b3f27b, the Scribes page started Knowledge Consolidation (setup prompt edited to save model, thinkinglow, timeout 900, active hours, failure alert after 3 with a 2 h cooldown) and Learn from conversations (a hand-edited run message plus model, thinking, timeout,lightContext, exacttoolsAllowof 6 tools,idleOnly, pacing and a trigger), each onsession:<key>; both first runs succeeded, then Conversations was paused. After the upgrade, the first load of the Scribes page:current; replaced Consolidation's unedited generated run message; left the hand-edited Conversations message byte-identical;Then on
02995e6: Run now on Consolidation ran in a freshagent:main:cron:<job>:run:<id>session, calledknowledge_status(owner store, writes enabled), and the page showed its status line with an Open run link read from run history. Repair on Conversations after archiving its conversation restored the conversation, turned the automation on and sent no turn.3. Lost response on a real Gateway, both late retry paths. The page's
chat.sendframe was sent, then its WebSocket was closed before the answer (a lost response); on02995e6the conversation was also kept busy with a 90 s turn so the update stayed late; the page clock was advanced 3 minutes once the page showed "Updating…". Counted by update messages that reached the scribe conversation:457d4aa02995e602995e6Out of scope
scribe-runs.md; it changes neither generated run-message bytes nor outcome-status behavior, which shipped in fix(knowledge): keep scribes current after updates, with fresh runs and clear update prompts #197391 and is covered by its prompt and status tests. Its live check is the next Granola scribe run after the maintainer's rebuild. No private Granola account was used.Follow-up