Skip to content

Agent identity on every core MCP tool, and write verbs that point the right way - #368

Merged
samrusani merged 1 commit into
mainfrom
fix/mcp-agent-identity-and-write-verb-clarity
Aug 15, 2026
Merged

Agent identity on every core MCP tool, and write verbs that point the right way#368
samrusani merged 1 commit into
mainfrom
fix/mcp-agent-identity-and-write-verb-clarity

Conversation

@samrusani

@samrusani samrusani commented Aug 15, 2026

Copy link
Copy Markdown
Owner

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_explain and alice_memory_correct had additionalProperties: false with no identity properties, while the other six accepted them. An agent that stamps agent_id on every call, which the commit tool's own schema invites, got a hard tool_request_failed on every one.

Note alice_memory_correct is a write verb, so this was not only a read-path problem.

Verified against the shipped binary:

before:  alice_recall {query, agent_id} -> isError=true
after:   alice_recall {query, agent_id} -> isError=false, count=1

2. The descriptions steered agents into the review queue

tool said problem
alice_capture "use this whenever you learn something worth keeping" but it is review-gated, so nothing becomes recallable
alice_memory_commit "on the user's instruction ('remember this')" tells the agent to wait to be asked

So 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 that alice_recall never returns.

alice_capture behaviour is unchanged. It is review-gated by design and no persona alters that, confirmed on fresh stores with and without ALICE_MEMORY_PERSONA. Only the wording changes: capture now states plainly that alice_recall will 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 HEAD and 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_explain errors on every call, with and without identity, verified identical on stashed HEAD. Pre-existing and unrelated; separate PR.

Verification

4544 unit passed, 2 skipped.

Upgrade Overview

Protected Areas

  • continuity APIs
  • memory schema
  • evidence pipeline
  • trust rules
  • promotion logic

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_failed
to 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_capture behaviour is unchanged: it remains
review-gated and its content is still not returned by alice_recall, which the
new 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_id
on every call previously failed on alice_recall, alice_resume,
alice_recent_decisions, alice_explain and alice_memory_correct, and now
succeeds. 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 mcp binary over stdio, on a fresh
data directory, with no agent key and no environment variables:

before:  alice_recall {query, agent_id} -> isError=true  tool_request_failed
after:   alice_recall {query, agent_id} -> isError=false count=1

Before updating the definitions digest, all 11 core tools were diffed between
HEAD and this branch: exactly 5 changed, each gaining only the agent identity
properties, 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.

…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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@samrusani
samrusani merged commit 2184546 into main Aug 15, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant