Agent identity on every core MCP tool, and write verbs that point the right way - #368
Merged
Merged
Conversation
…erbs the right way
Two defects found while testing whether an agent can install Alice and use it
unattended, which is the distribution model these tools have to serve.
Five of the eleven core tools rejected agent identity while the other six
accepted it. An agent that stamps agent_id on every call, which the commit
tool's own schema invites, got a hard tool_request_failed on alice_recall,
alice_resume, alice_recent_decisions, alice_explain and alice_memory_correct.
The last of those is a write verb, so this was not only a read-path problem.
All eleven now take the identity properties. Verified against the shipped
binary: agent_id on recall went from isError true to a correct result.
The descriptions were steering agents into the review queue. alice_capture said
"use this whenever you learn something worth keeping" while also saying it only
becomes trusted memory after review, and alice_memory_commit said "on the user's
instruction ('remember this')". So the tool that invited ambient use was
review-gated, and the tool that works unattended told the agent to wait to be
asked. An agent recording something it just learned took the path where nothing
becomes recallable, and got status "imported" with isError false while the
content stayed invisible to alice_recall.
alice_capture is not broken and is unchanged in behaviour. It is review-gated by
design, and no persona setting alters that, which was confirmed on fresh stores
with and without ALICE_MEMORY_PERSONA. Only the descriptions change: capture now
says plainly that alice_recall will not return the text and names commit as the
verb for immediate recall, and commit now says to use it whenever you learn
something worth keeping, including when the user has not asked.
The frozen-definitions digest moves because the definitions moved. Before
updating it, all eleven core tools were diffed between HEAD and this branch:
exactly five changed, each gaining only the agent identity properties, six
untouched. The guard was then re-checked for vacuity by deleting one splice and
confirming the count actually dropped from 11 to 10 before running the test,
because an earlier attempt at that check used a non-matching string, changed
nothing, and passed for the wrong reason.
Not fixed here, pre-existing and unrelated: alice_explain errors on every call,
with and without agent identity, verified identical on stashed HEAD.
Verified: 4544 unit passed, 2 skipped.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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.
Two defects found while testing whether an agent can install Alice and use it unattended, which is the distribution model these tools have to serve.
1. Five of eleven core tools rejected agent identity
alice_recall,alice_resume,alice_recent_decisions,alice_explainandalice_memory_correcthadadditionalProperties: falsewith no identity properties, while the other six accepted them. An agent that stampsagent_idon every call, which the commit tool's own schema invites, got a hardtool_request_failedon every one.Note
alice_memory_correctis a write verb, so this was not only a read-path problem.Verified against the shipped binary:
2. The descriptions steered agents into the review queue
alice_capturealice_memory_commitSo the tool inviting ambient use was gated, and the tool that works unattended told the agent not to use it unprompted. An agent recording something it learned got
status: "imported",isError: false, and content thatalice_recallnever returns.alice_capturebehaviour is unchanged. It is review-gated by design and no persona alters that, confirmed on fresh stores with and withoutALICE_MEMORY_PERSONA. Only the wording changes: capture now states plainly thatalice_recallwill not return the text and names commit as the verb for immediate recall; commit now says to use it whenever you learn something worth keeping, including when the user has not asked.On the frozen-definitions digest
It moves because the definitions moved. Before updating it, all eleven core tools were diffed between
HEADand this branch: exactly five changed, each gaining only the identity properties, six untouched.The guard was then re-checked for vacuity by deleting one splice and confirming the count actually dropped 11 → 10 before running the test. An earlier attempt used a non-matching string, changed nothing, and passed for the wrong reason.
Not in scope
alice_explainerrors on every call, with and without identity, verified identical on stashedHEAD. Pre-existing and unrelated; separate PR.Verification
4544 unit passed, 2 skipped.
Upgrade Overview
Protected Areas
Compatibility Impact
Additive only on the request side. Five core MCP tools gain optional agent
identity properties they previously rejected; no property is removed, renamed or
made required, and no response shape changes. Callers that never sent identity
are unaffected. Callers that did send it moved from a hard
tool_request_failedto a successful call, so the only behavioural change is that previously failing
requests now succeed.
Two tool descriptions change text. No tool is added, removed or renamed, and the
core tool count stays 11.
alice_capturebehaviour is unchanged: it remainsreview-gated and its content is still not returned by
alice_recall, which thenew wording now states explicitly instead of implying the opposite.
Migration / Rollout
None required. No database migration, no schema change, no configuration change,
no data backfill. The change is contained in the MCP tool definitions and takes
effect when the process restarts.
Operator Action
None. Operators do not need to change environment variables, configuration files
or deployment settings.
Worth knowing for anyone integrating an agent: an agent that stamps
agent_idon every call previously failed on
alice_recall,alice_resume,alice_recent_decisions,alice_explainandalice_memory_correct, and nowsucceeds. If any integration carried a workaround that strips identity fields
before read calls, that workaround is now unnecessary, though harmless.
Validation
4544 unit tests passed, 2 skipped, including the frozen-definitions guard
test_mcp_registry_order_definitions_and_alias_identity_are_frozen.Verified against the shipped
alice-memory mcpbinary over stdio, on a freshdata directory, with no agent key and no environment variables:
Before updating the definitions digest, all 11 core tools were diffed between
HEADand this branch: exactly 5 changed, each gaining only the agent identityproperties, 6 untouched. The guard was then re-checked for vacuity by deleting
one splice and confirming the count dropped from 11 to 10 before running the
test.
Rollback
Revert the commit. There is no persisted state, no migration and no artifact
tied to this change, so a revert fully restores the previous behaviour with a
process restart. Agents that had started sending identity on read calls would
return to receiving
tool_request_failed, which is the pre-change behaviour.