Repository navigation
fix(knowledge): keep scribes current after updates, with fresh runs and clear update prompts - #197391
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR refreshes scribe instructions, starts scheduled runs in fresh sessions, and shows update progress and actual run results. Example: Learn from conversations has an earlier generated message and a daily 4:00 AM schedule.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain This PR addresses a current scribe lifecycle problem and fixes the prior failure-reporting finding, but retry identity handling still needs correction. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Knowledge plugin’s Scribes page reads conversations and scheduler records, sends owner-authorized setup or update turns, and displays automation state and run transcripts. flowchart TD
A[Scribes page] --> B[Conversation and job reads]
B --> C[Instruction comparison]
C --> D[Owner conversation update turn]
D --> E[Existing automation]
E --> F[Fresh run session]
F --> G[Run history and status]
Technical reviewBest possible solution: Keep the existing conversation and scheduler owners, preserve failed retry identities, and complete the focused behavior and upgrade evidence. Do we have a high-confidence way to reproduce the issue? Current-main setup prompts install conversation-targeted runs without instruction reconciliation, establishing the reported stale-history path from source; no target code was executed during this review. Is this the best way to solve the issue? Using existing scheduler child sessions and owner-conversation redeclaration fits the established authority contract, while exact template matching protects edited messages; the remaining retry defect has a small repair within the existing attempt owner. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9cfa4b5ff744. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +776, Tests +339, Docs +65. Total +1180 across 12 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: No label 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 (7 earlier review cycles)
Reviewed November 12, 2026, 8:27 PM ET / November 13, 2026, 01:27 UTC (Revision 8). |
8b24c64 to
40139e5
Compare
…nd Granola pending rules
…te, and stop with the page
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…place retries repeat the same request
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Fixes: after an OpenClaw update, Knowledge scribes keep running the run message they were set up with and an ever-growing conversation. They miss new scribe behavior and follow stale copies of skill text; one consolidation conversation reached about 590k tokens, and a weekly run read about 13M. On main, scribes already switched to
sessionTarget: currentare not paired with their conversations on the Scribes page. Learn from Granola could also stop with meetings leftpendingfor no external reason and still reporton.User Impact
Opening the Scribes tab brings existing ongoing scribes up to date. Each run now starts in a fresh session of the scribe's conversation, and an earlier generated run message that is unchanged is replaced with the new one. A saved run message that differs from what this version generates is never overwritten. When it still carries replaced wording, the scribe shows New run instructions, and Replace with new… shows only the lines that change. After an update, Replace or Repair turn, the scribe shows Updating… and refreshes when its automation changes, with a visible note if nothing changes within 3 minutes. The last-run summary shows only real scheduled or Run now results, never setup, repair or update answers. A Granola run that leaves meetings pending without an outside reason now reports Needs attention instead of On.
Why This Change Was Made
Versioned run message.
scribes-catalog.tskeeps every wording a released run message was generated from inRUN_WORDINGS.checkRunMessageclassifies the stored message as:currentcustomoutdated: an unchanged earlier message, upgraded automaticallydiffers: carries replaced wording, so new instructions are offeredAdding the Granola needs-attention rule added a wording entry, so unchanged Granola messages upgrade too.
Fresh run per session:
currentsession target. Each run is a newcron:<job>:run:<id>session. The automation still belongs to the scribe conversation, so the Scribes page pairs them, and Run now, Pause, Turn off and Repair act on the same job. Run transcripts no longer land in the conversation, so the page reads a run's status line fromcron.runs/cron.historyand links runs to Automations. Resetting the conversation before each run was rejected: it changes the conversation's lifecycle revision, which unlinks the automation and denies private Knowledge access.The Scribes page owns the upgrade, through a turn in the scribe's conversation. A direct
cron.updatewould drop the job's operator source on an executable edit and lose owner-private access. Instead the conversation re-declares its automation with the owner's turn authority, as setup does. The page asks once per automation revision, then watchescron.inventory.changed, with a 10s poll and a 3-minute bound, until the revision changes and the change landed. A target-only intermediate write doesn't count as done or trigger a second turn. Pending updates are tracked per Gateway connection and per agent. The watch stops when the tab is left or the page is closed.Re-declaration keeps what it doesn't set, and stays in this agent. Re-declaring through
applyDeclarativeJobSpecreplaces the payload and drops omittedactiveHours,pacingandidleOnly. Update and repair prompts therefore pass the automation's saved options back exactly as written: payload model, thinking and other run options, an explicittoolsAllowpassed withtoolsAllowMode: "exact"so it is not broadened (a generated default list is left to its owner),activeHours,pacing,idleOnly,trigger,deliveryandfailureAlert. An existing automation keeps its delivery and failure alert instead of getting new-job defaults. The cleanup step lists automations for the Runtime agent only, and leaves another or missing owner agent untouched. This applies the [Bug]: Knowledge scribe setup for one agent removes other agents' scheduled scribes #196224 scoping (same wording as fix(knowledge): preserve other agents' scribes during setup #196238), which matters more now that opening the tab can send the turn. A send that fails is retried on the next load. A turn that left the automation unchanged shows Try again after 3 minutes. Try again sends the turn as a new request (fresh idempotency identity), so the Gateway can't answer it from the first request's record. A transport retry after a failed send keeps the same identity, for automatic updates and for confirming Replace with new again in the same dialog. An update that is still landing is never asked twice.Last-run result vs. state. The state still follows the newest answer, so a failed repair shows Failing. The shown result comes only from a run: the latest run's own transcript, or for legacy in-session jobs a status line answering a
Scheduled run of the Knowledge scribeturn.Granola pending rules (
knowledge-meeting-ingest/references/scribe-runs.mdand the Granola run message):pendingis only for reasons outside the run: still recording, no transcript yet, or verification that still fails after a fix attempt.Scribe status: needs attention, which the page parses as a new state.No "stop when context runs short" rule is reintroduced (fix(knowledge): drop the Granola scribe's stop-when-context-is-short rule #197890).
Evidence
Real isolated Gateway (separate state and port, real model), driven through the Control UI. Before is the previous PR build; after is this head with the same state.
Before, Learn from conversations showed an update turn's answer ("each run's message now has the updated access check…") as its last result. After, it shows the scheduled run's counts and New run instructions. Consolidation's earlier claims-only message was upgraded to the five-step one when the tab loaded.
Saved message that differs (earlier access wording plus one added line):
Replace with new… shows only the changed lines:
After confirming, the page shows Updating…:
The conversation re-declared the automation. The page refreshed on the cron change and cleared without a manual reload. The job now has the new message and
sessionTarget: current.(Model values redacted.)
Checks:
scribes-state.test.ts,scribes-view.test.tsandskill-packaging.test.tspass.pnpm tsgo:extensionsandpnpm tsgo:extensions:testpass.git diff --checkpass.sync-skill-references.mjs --checkpasses.Upgrade compatibility on existing data: the isolated Gateway's state came from the previous PR build, and the jobs began as earlier releases created them (legacy
session:<key>target, earlier generated messages, and one changed message). On this build they loaded and paired, then migrated or offered New run instructions as shown above, keeping schedule, enabled state, operator source and silent delivery. Scheduled runs succeeded both before and after.ClawSweeper's review of
615bd0efound three issues, all fixed with regression tests:The re-review of
6e8156cadded two more issues, both fixed with tests:The re-review of
16825c7found that reopening reused the same request identity. Retry is now an explicit Try again with a new identity, and the test asserts the second key differs.The re-review of
3c29bd4found two more issues, both fixed with tests:toolsAllowcap could be broadened.The re-review of
c743638found that a failed Try again send was shown as Updating. It now stays late, with the error, and can be tried again. The test fails without the fix.The failed-send test fails without the fix. The CI assertion-safety ratchet failure was caused by this PR and is fixed (typed
choicesOfwith a SAFETY note). Theeager-import-closuretooling-shard failure is inherited:#197697broke the PR-wrapper inventory on main,#197976fixed it, and it passes locally on current main (6c32a157).Independent review found three P2 issues in the update watcher, all fixed:
Accepted edge cases: