Skip to content

feat(agents): API agent (MCP + skills) on capabilities + models/loop#30

Draft
pradeepvrd wants to merge 1 commit into
submit/4-agents-base-clifrom
submit/5-agents-api
Draft

feat(agents): API agent (MCP + skills) on capabilities + models/loop#30
pradeepvrd wants to merge 1 commit into
submit/4-agents-base-clifrom
submit/5-agents-api

Conversation

@pradeepvrd

@pradeepvrd pradeepvrd commented Jun 20, 2026

Copy link
Copy Markdown
Owner

The API/MCP agent used to live in pkg/agents/runner/api/ as a monolithic loop with the MCP client, skill discovery, and LLM-adapter dispatch intermingled; this refactors it into devops_bench/agents/api/ (agent.py harness, mcp.py, skills.py) built on the shared run_tool_loop and the models layer, with MCP/skills/rules and provider/model resolved from AgentConfig rather than env reads.

Behavior changes

  • MCP and skills are now independent gates: skills-only, MCP-only, both, or neither — previously they were coupled.
  • Capability bindings and provider/model flow from AgentConfig.capabilities instead of env reads (AGENT_TARGET, BENCH_USE_MCP); the orchestrator wires them explicitly.
  • The agent reuses the shared run_tool_loop (provider-agnostic; the caller pre-formats tools) rather than carrying its own loop.
  • Optional provider/MCP SDKs are imported lazily.

Bugs fixed

  • MCP server commands with arguments (e.g. uv run mcp-server) are parsed with shlex.split instead of being treated as a single executable.
  • Token usage is mapped across the Gemini/Claude/Ollama response shapes (totals computed when absent) instead of assuming one provider's field names.
  • Skill files are read on a worker thread instead of blocking the async event loop.

Comment thread devops_bench/agents/api/skills.py Outdated
@pradeepvrd pradeepvrd force-pushed the submit/4-agents-base-cli branch from d789dcd to c4a1093 Compare June 21, 2026 01:30
@pradeepvrd pradeepvrd force-pushed the submit/5-agents-api branch 3 times, most recently from ddf3ce9 to 307bb21 Compare June 23, 2026 05:04
@pradeepvrd pradeepvrd force-pushed the submit/4-agents-base-cli branch from 43c5d8f to 1962e0d Compare June 23, 2026 06:08
@pradeepvrd pradeepvrd force-pushed the submit/5-agents-api branch from 307bb21 to 915b68f Compare June 23, 2026 06:08
@pradeepvrd pradeepvrd force-pushed the submit/4-agents-base-cli branch from 1962e0d to 09c113b Compare June 23, 2026 06:37
@pradeepvrd pradeepvrd force-pushed the submit/5-agents-api branch from 915b68f to 885f8b8 Compare June 23, 2026 06:37
@pradeepvrd pradeepvrd force-pushed the submit/4-agents-base-cli branch from 09c113b to c785a87 Compare June 23, 2026 07:21
@pradeepvrd pradeepvrd force-pushed the submit/5-agents-api branch from 885f8b8 to 90261d8 Compare June 23, 2026 07:25
@pradeepvrd pradeepvrd force-pushed the submit/4-agents-base-cli branch from c785a87 to 4585a19 Compare June 23, 2026 18:09
The API/MCP agent used to live in `pkg/agents/runner/api/` as a monolithic loop with the MCP client, skill discovery, and LLM-adapter dispatch intermingled; this refactors it into `devops_bench/agents/api/` (`agent.py` harness, `mcp.py`, `skills.py`) built on the shared `run_tool_loop` and the `models` layer, with MCP/skills/rules and provider/model resolved from `AgentConfig` rather than env reads.

**Behavior changes**
- MCP and skills are now independent gates: skills-only, MCP-only, both, or neither — previously they were coupled.
- Capability bindings and provider/model flow from `AgentConfig.capabilities` instead of env reads (`AGENT_TARGET`, `BENCH_USE_MCP`); the orchestrator wires them explicitly.
- The agent reuses the shared `run_tool_loop` (provider-agnostic; the caller pre-formats tools) rather than carrying its own loop.
- Optional provider/MCP SDKs are imported lazily.

**Bugs fixed**
- MCP server commands with arguments (e.g. `uv run mcp-server`) are parsed with `shlex.split` instead of being treated as a single executable.
- Token usage is mapped across the Gemini/Claude/Ollama response shapes (totals computed when absent) instead of assuming one provider's field names.
- Skill files are read on a worker thread instead of blocking the async event loop.
@pradeepvrd pradeepvrd force-pushed the submit/5-agents-api branch from 90261d8 to 073719a Compare June 23, 2026 18:13
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