Skip to content

refactor(agents): collapse per-task agents into flagship skills - #2995

Merged
kovtcharov-amd merged 9 commits into
amd:mainfrom
kovtcharov:feat/collapse-agents-to-skills
Aug 24, 2026
Merged

kovtcharov-amd merged 9 commits into
amd:mainfrom
kovtcharov:feat/collapse-agents-to-skills

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

GAIA shipped 19 agent packages and a user could reach two of them. Everything except email and the gaia flagship showed in the TUI as "not published on the Agent Hub yet" — no daemon sidecar spec, no launchable catalog row, no install path. Meanwhile several of those packages defined zero tools of their own: they were a system prompt wrapped in a wheel, and the prompt described tools the flagship already registers.

This deletes thirteen of them and moves the part worth keeping — the procedural knowledge — into SKILL.md files the flagship loads on demand. Adding a capability is now writing markdown, not shipping a package with a manifest, a CI workflow, a publish slot, and a docs page. Net: -98,000 lines.

Deleted: code, routing, blender, sd, emr, analyst, browser, docqa, doc-search, fileio, summarize, jira, docker. Kept: gaia (flagship), chat (its base class), email, plus hello-world / word-count / connectors-demo as teaching templates that are no longer catalog agents.

Two new skills carry the deleted prose forward — file-ops and summarize (its style tables and fold-forward chunking procedure). data-explore, research-report and document-brief already existed and cover analyst, browser and the two RAG duplicates.

Jira and Docker come back as connectors — scoped in #2989 and #2990. Docker needs a security decision first: docker build executes arbitrary code, and GAIA only grants a skill shell access through a reviewed per-binary policy.

What a user will notice

  • gaia analyze | browse | summarize | blender | sd | jira | docker and gaia mcp docker are gone, along with the gaia-code and gaia-emr console scripts.
  • gaia api now exposes exactly one model, gaia — the flagship. Its map previously held one entry, the routing agent, which routed to the code agent; both are deleted, so the endpoint is now pointed at the agent that actually ships. Any OpenAI-compatible client (VSCode, curl, an SDK) works against it.
  • gaia download --list and gaia init --profile no longer offer profiles for deleted agents, and the MCP bridge stopped advertising gaia.eval, which nothing has ever implemented.
  • The Agent Hub catalog and TUI agent list drop the eight rows that could never launch.
🔍 Also removed, and why

Dead weight that only existed to serve a deleted agent:

  • src/gaia/apps/{jira,summarize,docker} — standalone apps importing deleted agent classes.
  • src/gaia/mcp/blender_mcp_{client,server}.py — a Blender-addon socket protocol on port 9876, not MCP.
  • src/gaia/mcp/servers/docker_mcp.py — a thin wrapper around DockerAgent.
  • The MCP bridge's gaia.jira / gaia.blender.create / gaia.summarize tools and /jira /summarize endpoints, plus the multipart-upload path only /summarize used (mcp_bridge.py: 953 → 624 lines).
  • The blender extra (bpy), the data-lite / web-lite legacy registry aliases, stale FRAMEWORK_PATHS entries that would have filtered a user's own frames out of their traceback, and the blender/jira/docker Claude specialist definitions.

src/gaia/sd/mixin.py is kept — image generation stays available on ChatAgent behind the existing enable_sd_tools flag; only the standalone agent is gone.

Docs: 38 pages deleted, 39 edited, docs/docs.json pruned. All 194 nav entries verified to resolve to a real file.

Test plan

  • python util/lint.py --all — clean, exit 0

  • All 13 skills parse via parse_skill_file, and every tool each one declares in tools_required exists in the flagship's live registry (66 tools, 0 gaps) — verified by instantiating GaiaAgent and diffing, since tools_required is advisory and a gap fails mid-run rather than at load

  • gaia --help lists no deleted command; each removed command is rejected; gaia mcp --help has no docker

  • gaia api: /v1/models returns an empty list and a request for a deleted model 404s with an actionable message

  • MCP bridge boots with 2 agents / 3 tools; a deleted tool returns a clean "not implemented"

  • gaia api end to end: /v1/models lists gaia, registry.get_agent("gaia") builds the flagship with the SSE handler installed and 61 tools registered, and an unknown model 404s with an actionable message

  • cd tui && go build ./... && go test ./... — all packages pass

  • docs/docs.json: 194 nav pages, 0 missing files

  • pytest tests/unit full run, compared against the same run on unmodified main:

    main this branch
    passed 9098 9068
    failed 617 615
    errors 480 480

    Those failures are pre-existing and environmental: the sandbox this ran in blocks the loopback socket asyncio.new_event_loop() needs on Windows, tripping the repo's hermetic-network guard (tests/unit/conftest.py, untouched here). A set-diff of failing node ids found exactly one genuine regression — the starter-skill guard rejecting request_user_input — fixed in the second commit. Every other difference reproduces identically on main when run in isolation. The 30 fewer passes are tests deleted along with their agents.

  • Launch the flagship in the TUI and exercise a collapsed capability end to end — e.g. load data-explore and confirm it calls create_table/query_data instead of fabricating. Needs a machine with Lemonade running; not done yet.

Review notes

The riskiest edits are not the deletions — they are the three files that had a deleted agent threaded through shared logic: src/gaia/cli.py (dispatch + parsers), src/gaia/mcp/mcp_bridge.py (tool routing), and tests/test_api.py (every request now 404s at model_exists before reaching validation, so the live-server success-path tests were removed rather than left to rot).

Thirteen agent packages are gone: code, routing, blender, sd, emr, analyst,
browser, docqa, doc-search, fileio, summarize, jira, docker. Their capability
now comes from the flagship agent's tool surface driven by a SKILL.md, which is
where new capability belongs — a skill is a markdown file, an agent was a wheel
with a manifest, CI, docs, and a publish slot.

Most of them were never reachable: only email and gaia have a daemon sidecar
spec or a launchable TUI catalog row, so the rest showed as "not published on
the Agent Hub yet" and could not be installed at all. Several defined zero tools
of their own and consisted entirely of a system prompt already covered by the
flagship's 66 registered tools.

Two new skills carry forward the prose worth keeping: file-ops (from fileio) and
summarize (the style tables and fold-forward chunking from summarize's
prompts.py). data-explore, research-report and document-brief already existed
and cover analyst, browser and docqa/doc-search.

Also removed as dead weight: the jira/summarize/docker standalone apps, the
Blender MCP client/server pair, the Docker MCP server, the MCP bridge's
jira/blender/summarize surfaces and the multipart upload path that only the
summarize endpoint used, the bpy extra, and the blender/jira/docker Claude
specialist definitions.

Behaviour changes a user can see:
- `gaia analyze|browse|summarize|blender|sd|jira|docker` and `gaia mcp docker`
  are gone, as are the gaia-code and gaia-emr console scripts.
- `gaia api` exposes no models: AGENT_MODELS held one entry, the routing agent,
  which routed to the code agent.
- hello-world, word-count and connectors-demo stay as teaching templates and are
  no longer catalog agents.

Jira and Docker return as connectors, scoped in amd#2989 and amd#2990.
@github-actions github-actions Bot added documentation Documentation changes dependencies Dependency updates devops DevOps/infrastructure changes mcp MCP integration changes cli CLI changes tests Test changes electron Electron app changes agents agent::email Email agent changes agent::analyst Analyst agent changes agent::sd Stable Diffusion agent changes agent::fileio FileIO agent changes agent::emr Medical-intake (EMR) agent changes agent::docqa DocumentQA agent changes agent::browser Browser agent changes agent::summarize Summarizer agent changes agent::connectors-demo Connectors-demo agent changes agent::code Code agent changes agent::blender Blender agent changes agent::docker Docker agent changes agent::routing Routing agent changes agent::jira Jira agent changes agent::examples Hub tutorial/example agents (hello-world, word-count, doc-search) tui Go terminal UI (gaia-tui) labels Aug 18, 2026
Ovtcharov added 2 commits August 18, 2026 02:26
The starter-pack guard checks tools_required against the tools mixins
register plus a short whitelist of the tools ChatAgent registers inline. The
whitelist was missing request_user_input, so the new file-ops skill failed the
guard for declaring a tool the flagship really does register — asking the user
before a destructive write is the whole point of that skill.

Verified the same way as the rest of the list: the `def` must exist in the chat
agent's source, so a rename drops the name instead of silently passing.
`gaia api` started but served nothing: its model map held one entry, the
routing agent, which routed to the code agent — both deleted. It now exposes
the flagship as the model `gaia`, so any OpenAI-compatible client (VSCode,
curl, an SDK) drives the agent that actually ships. Verified end to end:
/v1/models lists it, the agent constructs with the SSE handler installed, and
an unknown model still 404s with an actionable message.

That needed one plumbing fix: ChatAgentConfig never forwarded `output_handler`
to the base Agent, so there was no way to hand a ChatAgent the SSE handler the
API server streams through.

Also stopped three commands describing things that no longer exist:

- `gaia download --list` advertised Code/Blender/Jira/Docker agent profiles.
  The SD entry stays but is relabelled — the SD tool mixin is still here, the
  standalone agent is not.
- `gaia init --profile code` installed models for a deleted agent.
- The MCP bridge advertised `gaia.eval`, which nothing has ever implemented —
  it was the last entry in the manifest with no handler behind it.

Docs updated to match: the API reference, spec, SDK page and VSCode guide all
said the model list was empty by default.
@github-actions github-actions Bot added llm LLM backend changes performance Performance-critical changes labels Aug 18, 2026
`execute_python_file` runs a .py file in a subprocess — arbitrary code
execution — but it was the one dangerous tool missing from the confirmation
gate. `run_shell_command` sits behind both the gate AND a read-only command
allowlist; this had neither, so it was the weakest link in the set.

It mattered little while the OpenAI-compatible server exposed nothing. Now that
it serves the flagship, an unattended caller reaches a 61-tool agent, so the gap
closes here. Verified: the tool is refused and the file does not run.

Also from review of this branch:

- Dropped `python-multipart` from core install_requires. It was there because
  the MCP bridge imported it at module load to parse multipart uploads for the
  summarize endpoint; that endpoint and the import are gone, and nothing else
  under src/ imports it. It stays in the `api` and `ui` extras, which do.
- Removed `send_sse_headers` and `stream_sse` from the bridge — the deleted
  summarize endpoint was their only caller.
- Corrected an ApiAgent docstring that claimed `GaiaAgent -> gaia`; the default
  it documents would produce `gaia-gaia`, and the flagship is served under the
  `gaia` key in AGENT_MODELS instead.
This was referenced Oct 19, 2026
huong8373tt-beep pushed a commit to huong8373tt-beep/gaia that referenced this pull request Nov 9, 2026
…#7025)

Memory discovery on Linux read `~/.local/share/recently-used.xbel`, a
file another application writes, with a parser that expanded any
entities it declared. A tampered file could inflate the parse or put
entity text into the recent-files signal. Now a DOCTYPE that declares
entities or points at an external DTD is refused before anything
expands. The scan logs a warning and skips the file, and normal bookmark
files parse as before.

Part 1 of the issue, the `shell=True` Prisma calls, needs no change: the
code agent that held them was deleted in amd#2995.

<details>
<summary>🔍 Technical details</summary>

- **Why no `defusedxml`:** the repo doesn't depend on it. Stdlib expat
isn't enough on its own. Billion-laughs protection arrived in expat 2.4,
and Linux Pythons (`python_requires>=3.10`) often link an older system
libexpat. Internal entities expand on every version, and amplification
limits don't stop quadratic blowup. Refusing the declarations with
expat's own `StartDoctypeDeclHandler` closes all of these with no new
dependency. This is the same approach as `defusedxml`'s `forbid_dtd`.
- A bare `<!DOCTYPE xbel>` declares nothing, so it is still accepted.
Some writers emit one.
- The old broad `except Exception` + `logger.debug` is narrowed to
`(ExpatError, LookupError, OSError, ValueError)` and logged as a
warning. `ValueError` covers the refusal and encodings expat cannot
read, and `LookupError` covers unknown encoding names.
</details>

## Test plan
- [x] `python -m pytest tests/unit/test_memory_discovery.py`: 124
passed, 5 skipped
- [x] 7 of the 9 new `TestLinuxRecentXbel` tests (internal entity,
billion laughs, external entity, external DTD, malformed file, Shift-JIS
and unknown encoding declarations) fail against `main`. The normal-file
and bare-DOCTYPE tests pass on both.
- [x] black, isort, flake8 (88 cols) clean on the changed lines

Closes amd#2952
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Nov 11, 2026
… agent framework (amd#7085)

The agent framework's confirmation, risk and document-tool tables listed
tools that don't exist, such as `run_cli_command` and
`query_indexed_documents`. The tables looked complete while describing
tools removed or renamed long ago, which hides real drift. A second,
unused path-permission cache also wrote `path_permissions.json` on every
session start, alongside the real tool grants. This removes the phantom
names, corrects one to the tool it was meant to match, and deletes the
dead cache and other uncalled code. Confirmation behaviour for real
tools is unchanged, and old session files still load.

Closes amd#7072

## Test plan
- [x] Tests touching the edited modules, the process-safety ratchet,
import-every-module and registry tests: 7,275 passed, 67 skipped.
- [x] Flagship package tests: 1,300 passed. 3 failed
(`test_full_tool_bundles` ×2,
`test_manifest_tools_count_matches_real_registry`); they fail
identically without this change, because the browser tools aren't
installed in the local environment.
- [x] New tests: an old session file that still has `path_permissions`
loads, and an existing `path_permissions.json` is left on disk.
- [x] TUI: `go build`, `go vet` and the `components` tests pass. Agent
UI: `tsc --noEmit` is clean and the permission-prompt tests pass (68).

<details>
<summary>🔍 Technical details</summary>

| Name | Outcome |
|---|---|
| `run_cli_command` | Removed from the Python tables, the TUI mirror,
`sse_translation.py` and `PermissionPrompt.tsx`. Its mixin went in
amd#2995; `run_shell_command` and `wait_for_condition` were already in
every table. |
| `query_indexed_documents`, `index_documents`, `session_findings`,
`read_document` | Removed. `index_document` already covers the prefix
match. |
| `index_dir` | Corrected to `index_directory`, the real tool it matched
by prefix. |
| `run_tests` | Removed from `chunk_index.py`. Kept in
`verification.py`, where the docs list it as a recognised test-run name.
|

- `gaia_agent/session.py`: `validate_path`, `validate_directory`,
`clear_path_permissions` and the `path_permissions.json` load/save are
gone.
- Also removed: unused audio refine helpers, `SkillDelta.is_overlaid`,
`STATUS_ORPHANED`, two unused snapshot defaults, and the unreachable
PyPDF2 fallback (`pypdf>=6.20` is pinned).
- Kept: `registry.py`'s warning for YAML-only agents, which a user with
an old agent folder still sees.
- No tool docstring or prompt changed, so no eval category is affected.
</details>

Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent::analyst Analyst agent changes agent::blender Blender agent changes agent::browser Browser agent changes agent::code Code agent changes agent::connectors-demo Connectors-demo agent changes agent::docker Docker agent changes agent::docqa DocumentQA agent changes agent::email Email agent changes agent::emr Medical-intake (EMR) agent changes agent::examples Hub tutorial/example agents (hello-world, word-count, doc-search) agent::fileio FileIO agent changes agent::jira Jira agent changes agent::routing Routing agent changes agent::sd Stable Diffusion agent changes agent::summarize Summarizer agent changes agents cli CLI changes dependencies Dependency updates devops DevOps/infrastructure changes documentation Documentation changes electron Electron app changes llm LLM backend changes mcp MCP integration changes performance Performance-critical changes tests Test changes tui Go terminal UI (gaia-tui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants