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 agent skills, allowing skills to declare resources they occupy (e.g.,
Confidence Score: 5/5Safe to merge. The capability system is well-designed with comprehensive tests; the only concern is a missing exception guard in The core CapabilityRegistry, token-scoped release, and same-tool takeover mechanism are all correct and well-tested. The one rough edge is dimos/navigation/patrolling/module.py — Important Files Changed
Sequence DiagramsequenceDiagram
participant LLM as LLM Agent
participant MCP as McpServer
participant REG as CapabilityRegistry
participant SKILL as Skill
participant STREAM as ToolStream
LLM->>MCP: tools/call start_patrol
MCP->>REG: "acquire([movement], token=T1)"
REG-->>MCP: None (success)
MCP->>SKILL: "rpc_call(_mcp_context={acquire_token: T1})"
SKILL->>STREAM: start_tool stamps T1
SKILL-->>MCP: Patrol started
Note over MCP: lifecycle=background, caps_held=False
LLM->>MCP: tools/call turn_in_place
MCP->>REG: "acquire([movement], token=T2)"
REG-->>MCP: conflict (movement held by start_patrol)
MCP-->>LLM: Cannot start turn_in_place — call stop tool first
LLM->>MCP: tools/call stop_patrol
MCP->>SKILL: rpc_call stop_patrol
SKILL->>STREAM: "stop_tool emits dimos/tool_stopped token=T1"
STREAM->>MCP: dimos/tool_stopped via LCM
MCP->>REG: release_by_token(T1)
MCP-->>LLM: Patrol stopped
LLM->>MCP: tools/call turn_in_place
MCP->>REG: "acquire([movement], token=T3)"
REG-->>MCP: None (success)
MCP->>SKILL: rpc_call turn_in_place
SKILL-->>MCP: Turned 90 degrees
Note over MCP: lifecycle=instant, release in finally
MCP->>REG: release_by_token(T3)
Reviews (4): Last reviewed commit: "Merge branch 'main' into paul/feat/capab..." | Re-trigger Greptile |
6831efb to
635255d
Compare
635255d to
0abba03
Compare
Problem
Closes DIM-XXX
Solution
How to Test
Contributor License Agreement