feat(agents): add exclusive cabilities#2279
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Greptile SummaryThis PR introduces an exclusive capability system for skill-level mutual exclusion: skills declare
Confidence Score: 5/5Safe to merge; the capability system is well-structured with no correctness gaps in the core acquisition/release path. The token-scoped registry, same-tool takeover, and always-emitting stop frame work correctly together. All early-return paths in the updated skills call dimos/utils/cli/human/humancli.py — the Important Files Changed
Sequence DiagramsequenceDiagram
participant LLM as LLM / McpClient
participant MCP as McpServer
participant REG as CapabilityRegistry
participant SKILL as Skill (background)
participant STREAM as ToolStream
participant SSE as _fan_out_to_sse_queues
LLM->>MCP: "tools/call {name, args}"
MCP->>REG: acquire(caps, tool_name, token, timeout)
alt cap free or same-tool takeover
REG-->>MCP: None (success)
MCP->>SKILL: "rpc_call(_mcp_context={acquire_token})"
SKILL->>STREAM: start_tool(name) stamps token
SKILL-->>MCP: "Patrol started."
Note over MCP: caps_held=False (background) cap stays with ToolStream
MCP-->>LLM: result text
loop background work
SKILL->>STREAM: tool_update(name, msg)
STREAM->>SSE: notifications/message
end
SKILL->>STREAM: stop_tool(name)
STREAM->>SSE: "dimos/tool_stopped {token}"
SSE->>REG: release_by_token(token)
REG-->>SSE: ["movement"] released
else cap held by different tool
REG-->>MCP: (cap, holder_tool)
MCP-->>LLM: "Cannot start X: capability Y is held by Z. Call stop tool first."
end
Reviews (3): Last reviewed commit: "feat(agents): add exclusive cabilities" | Re-trigger Greptile |
6831efb to
635255d
Compare
|
|
||
| if lifecycle == "background": | ||
| # Hand ownership of the caps off to the tool-stream lifecycle. | ||
| caps_held = False |
635255d to
0abba03
Compare
Problem
Closes DIM-XXX
Solution
How to Test
Contributor License Agreement