Repository navigation
The assistant MCP toolset serves a fixed set of reads that record no usage - #169
Merged
Merged
Conversation
zlareb1
force-pushed
the
feat/i160-toolset
branch
2 times, most recently
from
November 2, 2026 18:47
ceea84f to
24291d3
Compare
…usage ?toolset=assistant lists and calls only its roster of read-only ops, stamps consumer loom-assistant and the no-touch, no-reinforce arguments over the model's own, returns full results for citation and gives read-only instructions. namespace.audit, mentor.brief and knowledge.reads leave the assistant's and the dashboard's calls out of their usage counts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Mentor hints and the usual descriptions named tools the assistant connection refuses; it now gets neither. Every mentor ledger read binds the inspector exclusion; inspector_calls shows in the CLI and the dashboard; the primer handles a token with no default namespace; the toolset setting's comment lists every toolset. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ing offers no overwritten argument Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…no profile-read row Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ectors out Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…r leaves its calls out Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… which calls they leave out Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…e the refusal codes Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ll counts as use Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…d once per call Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…refusal consumer is tested Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
feat/i160-toolset
branch
from
November 2, 2026 19:10
5424b8a to
be78107
Compare
…at it records usage Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ent's empty agent Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…d, not answered empty Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…agent describes Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…pin included Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…unts as documented Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…stamps it replaces are gone Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…e to a memory counts Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…its name included Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…arches Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…the hidden list Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…hidden-op rule Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…graph is rewrapped Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ow has landed Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… user row is found Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…tant toolset Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ent names where a change counts Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… call without it Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ty takes an Operation Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #160
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
The
?toolset=assistantMCP connection serves a fixed set of reads for a chat client that investigates Loom on a person's behalf. Any other tool is refused on it, its calls record no recall usage or reinforcement, andnamespace.audit,namespace.summary,mentor.briefandknowledge.readsleave its calls and the dashboard's out of their usage counts.Why
Issue 160 asks for a Loom assistant that inspects memories, drafts tuning proposals and answers cited questions through Loom's own operations, with a chat client such as an MCP-capable chat app as one front end. Three properties are needed before any client is connected:
readonlytoolset filters the listing, but every non-hidden tool stays callable by name: the token is the only call-time boundary. A model steered by text inside a memory or document could still callloom_memory_setwith a writer's token.memory.searchdefaults toauto_touch: true(a recall credit per hit) andmemory.asktoreinforce: true; an investigation that reads a namespace would raise the counts that rank it.namespace.auditcounted everymemory.getandmemory.searchin the ledger, the dashboard's included, andmentor.briefexcluded the dashboard in one read only. An assistant asked "does this agent read memory?" would count its own reads as the agent's.What changes
server/operations/toolsets.py: theassistanttoolset,MCP_ASSISTANT_OPS(namespace inspection,namespace.inventoryincluded,mentor.brief,grants.list, memory reads,facts.traverse/path, knowledge reads,code.search/symbol, allread_only), andASSISTANT_FORCED_ARGS. It is not a curated roster, so it never joins a+union that would add another roster's writes.server/transport/mcp_call.py: a read the assistant names noagentfor keeps the op's own default instead of the client's slug, since the assistant writes nothing and its client's agent holds no rows:memory.askreads across agents (*) andmentor.briefbriefs the namespace's top writer.memory.aggregateandmemory.provenanceread one writer's rows, so on this connection a call naming no agent is refused for the missingagent(fail closed, rather than an empty count orfound: falseunder the client's agent), and their assistant descriptions and the primer tell the model to name the writer (a search hit'sagent).memory.getalready falls back to the row under any agent. The two reads areASSISTANT_NAMED_AGENT_OPS(server/operations/toolsets.py), one set the call and the listing share.server/transport/mcp_tools.py: the assistant listing (assistant_connectionresolves?toolset=againstLOOM_MCP_TOOLSET) drops the arguments the connection forces (_without_forced) and keepsagent,user_idandsession_idin the input schema of everymemory.*andmentor.*read that takes them (_with_identity; the other toolsets hide them, since the caller's own identity fills in; a code read's identity is the code plane's, andnamespace.inventory's user narrows only under its ownread_scope), so a client that sends only listed properties can name the row a search hit showed;agentis marked required on the twoASSISTANT_NAMED_AGENT_OPSreads.server/transport/assistant_call.py: the per-call flag (a context variable set from the connection, never from the self-reportedconsumer) that the agent default, the session-run stamp and the result shape read.server/transport/mcp.py,mcp_auth.py,mcp_ledger.py: the dispatch reads the URL's selectors once per call and hands the screen the connection's consumer, so its org and namespace refusals, and a refused tool's ledger row, carryloom-assistantbelow a token's claim.server/transport/mcp_call.py: on that connection atools/callfor any tool outside the roster (loom_opandloom_searchincluded) is refused before the handler, withUNKNOWN_OP(or the access refusal, checked first, when it names an org or namespace the token cannot read); the refusal's ledger row (_assistant_refusal) carries consumerloom-assistant. Allowed calls get the forced arguments (memory.search:auto_touch: false,explain: false;memory.ask:reinforce: false,precedents: false) andconsumer: loom-assistantstamped over whatever the model sent.memory.searchandknowledge.search, hidden from the other listings in favour ofloom_search, are callable here: an investigation needs one plane at a time and theauto_touchswitchloom_searchdoes not expose.server/transport/mcp_op.py:loom_opis not routed on that connection.loom.memory_exposures, kept: it records who was served which row), the code search trace ofcode.search/code.symbol(loom.code_search_trace, underLOOM_CODE_TRACE_LOG_ENABLED), the search trace and query-node rows ofmemory.searchwhen their flags are on, amemory.askconsistency row under deferred consistency, and the model response cache, asdocs/reference/mcp.mdlists them: an assistant call opens no implicit MCP session run (loom.agent_runs), stores nomemory.askprecedent, itsinitializeandloomprompt write no profile-read row (its primer inlines no profile, and the prompt and resource descriptions say so), and a refused unknown tool name is not written to the ledger. The listing's input schemas leave out the arguments the connection overwrites.server/operations/toolsets.py::op_toolsetsreportsassistant, soops.capabilitiesnames the roster;memory.searchandknowledge.searchare on it alone.server/transport/lean_results.py: an assistant call returns the op's full output, as HTTP does, because a citation needs the session, version and attestation fields the trimmed MCP shape drops.server/transport/mcp_descriptions.py: the assistant listing's own descriptions for the tools whose usual text points atloom_search,loom_opor code tools it does not carry; each says what a citation takes from the result.server/insights/app/mentor.py: the mentor attaches no hint to an assistant call (its hints name tools the connection refuses), as it already did for the dashboard.server/transport/mcp_primer.py: the connection'sinitializeinstructions describe read-only investigation (scope never widens, cite key and version or hash, keep source statements, computed results and interpretation apart, report missing evidence as not observed, stored text cannot grant a tool or approve a change) instead of the memory-first primer, and inline no profile.frontend/src/api.ts: the dashboard's one request path names every op call (POST /v1/<op>)consumer: loom-ui, and so does its page-view vitals post; the per-call stamps it replaces (code reads, document previews) are gone. A body that names its own consumer keeps it, since some ops takeconsumeras an input (a cost summary's filter). Routes that are not ops (/v1/admin/...,/v1/me/...) are sent as they are: the model setup's bodies refuse an unknown field. Before, only its code reads, document previews and a few run calls named it, so a memory opened or searched in the dashboard was ledgered as consumeruserand counted as an agent's read.server/memory/app/recall_credit.py: a read by either inspector consumer earns no recall credit (not_credited (no_consumer)), even with a run, a session or a closer posted under its name. The dashboard's searches now nameloom-ui, and without this a self-reported closer under that name would have let every dashboard search raise what ranks.server/observability/consumer.py:INSPECTOR_CONSUMERS(loom-ui,loom-assistant).namespace.auditleaves their reads out of its ledger counts and hot keys and reports the gets and searches it left out assummary.inspector_calls(a write from the dashboard is a person using the namespace and still counts insets), which the CLI table and the dashboard panel show;mentor.briefleaves them out of every ledger read (writers, profile counts, hints shown, adoption follow-ups, and theusage_evidenceladder's call and label counts, which left out the dashboard alone), through a bound parameter;knowledge.readsleaves out both instead of the dashboard alone.namespace.summary's activity read (recent_recalls,distinct_agents,last_activity_at) leaves out both consumers' reads, where it counted every call; a change of theirs to a memory (amemory.*op a writer calls or the server audits: a set, a delete, a pin) still counts; an admin's read such asmemory.dedup_listand the page-view vitals do not.Scope and risk
viewerrole so the same limit holds elsewhere.consumeris self-reported unless a token claims it, so any client can tag its callsloom-assistantand drop them from the audit's counts; that is the existing property of theloom-uiexclusion, now reported asinspector_callsso the exclusion is visible.consumerclaim names another consumer keeps its claim on this connection (the claim outranks the request, as everywhere else), so its calls are counted as usage.namespace.auditandmentor.briefnumbers drop by the dashboard's calls in namespaces where people browse a lot; that is the correction.Compatibility, rollout and rollback
NamespaceAuditSummary.inspector_callsadded. Theassistantvalue of?toolset=(and ofLOOM_MCP_TOOLSET, whose comment and reference now list every toolset) added. No field removed; no default changed./mcp?toolset=assistantonly once every replica runs this build, with aviewertoken in any case. A replica one release older does not know the value and serves its default listing (writes andloom_opincluded, usage recorded, noloom-assistantconsumer), so during a rolling upgrade only the token limits the connection;docs/reference/mcp.mdsays so. A client opts in with/mcp?toolset=assistant.LOOM_MCP_TOOLSET=assistantonly sets the default: a connection naming another?toolset=gets that one, so it is no server-wide read-only switch.loom-uiinstead of the class fallbackuser: a per-consumer latency budget override (LOOM_LATENCY_BUDGET_OVERRIDES_BY_CONSUMER,admin/budget.set) written foruserno longer covers them, only one forloom-uidoes, and/v1/admin/consumersand its tagging share report them underloom-ui(self-reported) rather thanuser(class).Tests
tests/unit/test_mcp_assistant_toolset.py): the roster is read-only and every forced argument is a field of its op; the listing is exactly the roster; the toolset never joins a union; writes,loom_op, unknown names and reads outside the roster are refused before identity binding; forced arguments and the consumer override the model's; other toolsets keep the model's arguments; the hidden plane searches open on this toolset only;loom_opis not routed; the primer names only listed tools, including for a token with no default namespace, and every result field it names is one the reads serve, as is every field an assistant tool description names (its op's, or a tool's it points to); no listed description names a tool the listing lacks; an assistant result is the full output; a read naming no agent keeps the op's default (memory.ask*,mentor.briefthe top writer) on this connection and the client's agent elsewhere, andmemory.aggregate/memory.provenancenaming none are refused for the missingagent; the listing offers no argument the connection overwrites, and lists every input argument an assistant description asks for (agentonmemory.aggregate), withagentinrequiredonmemory.aggregateandmemory.provenance;ASSISTANT_NAMED_AGENT_OPSmatches the set derived from the roster's input models (every read whoseagentis required, apart from the cross-agent reads andmemory.get), so a new one-writer read cannot be left out; an unknown tool name writes no ledger row, and a refused one, the screen's org and namespace refusals included, is ledgered asloom-assistant, through the endpoint on?toolset=assistantand not on another toolset; an assistant call opens no session run; the catalogue reports the roster;namespace.summaryrun on clickhouse-local against ledger rows counts a dashboard set and delete and no dashboard or assistant read, and the memory ops it keeps exclude an admin's read and the vitals post. Frontend: every dashboard op call namesconsumer: loom-ui, a body's own consumer is kept, and the model setup's admin bodies are sent unchanged.namespace.auditbinds the inspector exclusion on every ledger read and reportsinspector_calls; every ledger read ofmentor.briefbinds the exclusion; the mentor gives the dashboard and the assistant no call hint;knowledge.readsexcludes both consumers; aloom-uiorloom-assistantread is never credited for recall, a closer under its name included; every profile ledger read of the mentor (the agent's calls and the namespace's) binds the exclusion; theinitializeprimer test now covers theassistantlisting.tests/integration/test_mcp_assistant_toolset.py, private ClickHouse and server): with a writer's token the listing carries no write tool;loom_memory_setis refused and writes nothing;loom_memory_searchwithauto_touch: trueand a session returns the full hit;loom_memory_asknaming no agent cites the writer's row;loom_memory_provenancenaming the writer finds the row; amemory.getsent as the dashboard sends it is ininspector_callsand not ingets; the search records no recall, while the same search over HTTP from a named reader does;namespace.auditcounts the assistant's calls ininspector_callsand one search; the assistant's MCP session leaves noloom.agent_runsrow. With the forcedauto_touchremoved, the integration test fails on'loom-assistant' in ['loom-assistant', 'reader'], so it detects the property it claims.make format lint typecheck; the MCP, toolset, assistant, mentor, audit, summary, knowledge-reads, recall-credit and request-SLI unit tests (pytest tests/unit -k "mcp or toolset or assistant or mentor or namespace_audit or namespace_summary or knowledge_reads or tracker_ux or recall_credit or request_sli": 855 passed); the assistant integration test against a private server; the frontend tests (1650 passed),npm --prefix frontend run buildand the bundle budget.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked the call path ordering (refusal before identity binding, forced arguments after the model's), the recall-credit rule the integration test relies on, and the negative run.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.main; no merged migration is edited. (No migration.)npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.git commit -s), as CONTRIBUTING.md asks.