-
Notifications
You must be signed in to change notification settings - Fork 36
Add real MCP client identity instead of hardcoding all edits to agent 1 #37
Copy link
Copy link
Open
Labels
priority:p2Medium priorityMedium priority
Description
Problem
The HTTP interface supports agent registration, heartbeat, and advisory locking. The MCP interface does not expose agent identity and hardcodes all edits to agent 1.
This collapses multiple MCP clients into one logical writer and undermines the multi-agent coordination model already present in the codebase.
Why this matters
A core purpose of codedb2 is agent-driven codebase work. If MCP clients cannot identify themselves separately, lock ownership and provenance are not trustworthy under concurrent use.
Evidence
src/agent.zighas agent IDs, cursor/state, heartbeat, and advisory lockssrc/mcp.zighardcodesagent_id = 1inhandleEdit()- HTTP has explicit
/agent/register,/agent/heartbeat,/lock, and/unlock
Expected outcome
Introduce proper MCP-side agent identity, either by:
- exposing agent lifecycle/lock tools directly, or
- binding a stable agent identity to each MCP session/connection
Acceptance
- separate MCP clients do not share a synthetic writer identity
- lock contention is enforced correctly across MCP clients
- edit provenance records the real agent/session identity
- tests cover concurrent MCP edit scenarios
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority:p2Medium priorityMedium priority