Repository navigation
fix(knowledge): report real write access for a never-written store - #192073
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: needs maintainer review before merge. What this changesThis PR reports caller write access for an unprovisioned Knowledge store and removes the corresponding skill and scribe workarounds. Example: An owner agent calls knowledge_status with writesEnabled enabled before its first Knowledge use.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it corrects a misleading status on current main with a focused change, and source review found no concrete introduced defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherKnowledge tools resolve the caller's store and partition through the plugin service; status returns availability and access information, while subsequent authorized tool calls provision storage. flowchart TD
A[Agent or operator] --> B[Knowledge service]
B --> C[Principal and grant resolution]
C --> D[Store registry]
D --> E[Nonprovisioning status response]
D --> F[Authorized tool provisioning]
Technical reviewBest possible solution: Keep status nonprovisioning while using the existing access calculation for unprovisioned stores and removing the obsolete caller workarounds. Do we have a high-confidence way to reproduce the issue? Current-main source directly establishes the false status for unprovisioned stores; the PR also reports an affected real ingest turn, but this review executed no target code. Is this the best way to solve the issue? The patch fixes the reporting owner, preserves provisioning and authorization, and updates the shared guidance and generated consumers without introducing another policy path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1248bee4959b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4, Tests +22, Docs 0. Total +26 across 12 files. Added test files: 0. View PR surface stats
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 Reviewed November 3, 2026, 11:43 AM ET / 16:43 UTC. |
…penclaw#192073) * fix(knowledge): report real write access for a never-written store * test(knowledge): fold unprovisioned status check into passive discovery test --------- Co-authored-by: VACInc <[email protected]>
…penclaw#192073) * fix(knowledge): report real write access for a never-written store * test(knowledge): fold unprovisioned status check into passive discovery test --------- Co-authored-by: VACInc <[email protected]> (cherry picked from commit 96dc3b7) Private LOCAL11.8 preparation; canonical integration pending. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 73bf343bf33bbb837f82e5846d9ec60168d8eace)
Summary
High Level TLDR
A brand-new Knowledge store reported
writesEnabled: falsefromknowledge_statusuntil something wrote to it. The skills and scribe prompts already tell the model "that's normal, keep going", but a weaker model took the status at face value and stopped without saving anything. Status now reports the write access the caller's first call will actually have, so an empty store no longer looks like a blocked one.Root Cause
knowledge_statusopens the store withprovision: false(correct: status must not create stores). For any non-ready store it returned the sharednotReadyshape, which hard-codedwritesEnabled: false, even forunprovisioned, where the caller's very next Knowledge tool call creates the store and writes succeed. The ready path computed real access (policy.writesEnabledplus the caller's grant); the unprovisioned path skipped it.Callers papered over this in prose:
skills/shared/setup.md("A brand-new store reports …writesEnabled: false… That is normal: continue") and the scribe access step ("a vault that was never written reports writes off until its first write").Observed before: a "Learn from conversations"-style ingest run on a fresh store with
deepseek-v4-flashcalledknowledge_status, sawstore: "unprovisioned",writesEnabled: false, emptyvault, and ended withScribe status: failed — … no write could be authorized … the store unprovisioned … 0 claims and 0 pages were written.After a setup turn created the store, the same model and prompt ingested normally.Change
service.tsstatus: computecanWriteonce (unchanged logic) and report it forunprovisionedstores.initializing,unavailableandrecovery-requiredstill reportfalse. Status still never provisions.skills/shared/setup.md(+ regeneratedreferences/setup.mdcopies):writesEnabledon a new store already says whether you may write; stop only when it isfalse.scribes-catalog.tsaccess step: drop the "reports writes off until its first write" workaround.Scope boundary
No change to provisioning, grants, operator inspection, store states, the status schema, or when stores are created. Operators (who cannot write through status context) and read-only grants still see
false; pluginwritesEnabled: falsestill wins.Verification
extensions/knowledge/src/stores.test.ts"passive discovery…" now asserts a fresh store reportswritesEnabled: falseto an operator reader andtrueto an agent tool, and that status still creates no store directory. (Folded into the existing test so the PR adds no net test lines.)main(Expected true, Received false); passes with the change.node scripts/run-vitest.mjs run extensions/knowledge: 59/59 files pass.pnpm check:changed: everything passes except the dead export scan, which fails on files this PR does not touch (extensions/nostr/browser/components.tsx,ui/src/pages/channels/view.config.tsx,ui/src/pages/channels/view.shared.tsx; same onmain). Formatting fixed and rechecked.Real behavior proof
Self-hosted Gateway on a loopback port with an isolated state dir, Knowledge as the memory slot,
writesEnabled: true,deepseek-v4-flashas the agent model, fresh empty state. Before: the first ingest turn stopped atknowledge_statuswith 0 writes (status quoted above). The fix was validated at the tool contract level by the test above; the end-to-end model rerun on the patched build was not repeated.What was not tested
scope: "private"for every caller, as before. A conversation-audience caller without a grant would really write to its conversation partition; that pre-existing reporting gap is unchanged here.