Agent architecture and tools
How the xcodon agent loop fits together, what tools exist, how planning discovers domain skills, and how Coala (Model Context Protocol (MCP) toolsets + coala-runtime) plugs in.
High-level flow
A project runs in one of two modes. Plan mode drafts a stepped plan (outputs/research_plan.md) and works through its checklist, and the step validation reviews each step. Direct mode drafts no plan: one conversation does the task, then fresh conversations review it (Direct mode). Both modes use the same agent loop and tools.
A single agent loop handles each user turn. Tool calls run with cwd = project root; each LLM round's tool output is capped by a round tool-output budget (llm_round_tool_output_max_chars, llm_round_max_tool_calls) and per-tool clipping (checkpoint_tool_content_max_chars); state is written back to the checkpoint, the LangGraph thread (state/deepagents.sqlite), the harness notebook, checklist progress, the provenance ledger, and the gate tables under state/ — a zone the agent itself may not write. When the thread grows large, Deep Agents SummarizationMiddleware compacts older turns (automatic near context limits or on demand via /compact); summaries also feed outputs/plan_context_digest.md.
Major runtime features
| Area | Behavior |
|---|---|
| Direct mode | No plan: one conversation does the task, fresh conversations review each condition the task names, and code checks the files. Default for your own plan or typed task in the TUI and web UI. Details: Direct mode. |
| Super mode | xcodon run --super or super_mode: true: disables execution approval and human-in-the-loop pauses; autonomous checklist pacing with continuation nudges (super_mode_max_continuations). |
| Harness | Append-only outputs/<project_id>_notebook.md (legacy harness_notebook.md is migrated automatically); outputs/<project_id>_report.md is derived for the Report tab (optional LLM pass per step via harness_solution_llm). Rebuild with /codon report (fast = heuristics only). |
| Gate → judge → referee | Each completed step first passes a deterministic gate whose pass/fail table is persisted under state/gate/ and shown to the agent with no LLM call. Green analysis/synthesis steps then go to the LLM judge; a fail_fixable verdict triggers a solution-LLM revision, a red gate an agent retry. Before a run may stop, one referee review reads the graded deliverables and can only append checklist steps for a missing piece. Switches: harness_gate_enabled, harness_judge_enabled, harness_final_review_enabled and their *_max_rounds (Configuration). Details: Step validation. |
| Provenance | Every execution is recorded in state/provenance/ledger.jsonl: the files it read and wrote, the programs it started, the modules it imported, the hosts it reached, and whether it succeeded. The gate reads the ledger, not the agent's claims. Switch: tools.trace_executions (default true). Details: Provenance. |
| Checkpoint | state/checkpoint.json resumes the session; LangGraph thread in state/deepagents.sqlite. Older tool bodies may be truncated in the checkpoint while full I/O remains in the notebook. |
| Compaction | Deep Agents SummarizationMiddleware (~85% context) + the on-demand compact_conversation tool and TUI /compact; side effects via XCodonCompactionHooksMiddleware → outputs/plan_context_digest.md, harness compaction log, memory hooks. XCodonToolPairRepairMiddleware repairs orphaned tool-call pairs before a request is sent. |
| Prompt cache | Stable system prefix + trailing volatile session block. Only Claude models get a LiteLLM cache_control marker on the stable prefix (prompt_cache.enabled), because Claude caches nothing unmarked. Gemini and OpenAI cache a repeated prompt start on their own; a marker would shrink Gemini's cache to the marked part. chatgpt/ calls share one session per process, so the backend reuses the cached prompt. Hot-load / compaction invalidate as expected. |
| Skill discovery | Planning and each focused checklist step search skills.sh for a matching domain skill, gate it with an LLM, and install it into .agents/skills/ — see below. |
| Library skill prefetch | When tools.library_skill_prefetch is true (default), xcodon runs coala_search → coala skill → fetch_local_skill before the first write_workspace_file that imports a library in an analysis script, and before the first coala_execute_* whose packages are undeclared, deferring the write/execute until SKILL.md is loaded. A CLI the script installs itself counts as a dependency as well — a conda/mamba/micromamba create|install or apt/yum/dnf install command opening a string, an argv list or a script line — so a hand-rolled micromamba create … hisat2 takes the same route rather than bypassing Coala entirely. |
| Missing tool → registry | With tools.allow_coala_cli, a run_shell or coala_execute_* result that shows a CLI is missing (X: command not found, X not found, which: no X in, or a shell which X that prints no path) gets a note when the Coala registry has an MCP toolset named exactly X: import it with coala_invoke ["coala","mcp","X"] rather than download it. A curl/wget of a program's release archive, or a git clone of its repository, is deferred once for the same reason; the same command runs on the next call. Each name is searched once per session. |
| Redundant-read short-circuits | Reading the checklist state, the notebook or the plan back returns a pointer instead of the body, and a session-scoped read cache answers repeated single-file reads. |
| Repeat guard | Identical (tool, arguments) calls beyond same_tool_max_repeats (default 5) are blocked in a turn; the block quotes what the latest identical call that ran returned. A call a guardrail deferred did not run, so it does not count as a repeat. After three blocks of one call the turn ends. In super mode a loop stop always starts a recovery turn with a message that names the call ("Loop stopped"), charged to super_mode_max_continuations. Before every model call, a run of identical call/result pairs is shown to the model as one pair with a count; the saved history is unchanged. |
| Script lint | Agent-written analysis scripts are linted for swallowed exceptions and half-open-interval bugs; findings are attached as a note to the coala_execute_* call. |
| Reflection | After a clean turn (no tool calls), optional LLM reflection (reflection_enabled) records a lesson in project memory/reflections/SKILL.md, only when the turn shows a finding a later run could not work out again from its files: a strategy that worked, a checked rule, a tool quirk or a fix that took several tries. Details: Memory and lessons. |
| Memory hooks | Deterministic ## Memory hook — appends to memory/hooks.md on failed-looking tool output and after compaction (memory_hooks in YAML). No LLM call. |
| Host memory | ~/.xcodon/memory/ holds short, linked pages shared by all projects. Runs only read it. Dreaming (xcodon dream, /codon wrap) checks the pages against finished projects and updates them; /codon tidy only reorganizes them. Details: Memory and lessons. |
| CWL failures | Terminal failures from CWL-backed MCP tools can append structured debug blocks to outputs/cwl_failures.md (cwl_failure_reflection_enabled); an auto-repair pass and a two-attempt retry policy run first. |
Execution approval (default on) keeps only read-only tools available until the user unlocks execution. Exact phrases such as run it, execute, approved, ok to run, go ahead always unlock; soft words (proceed, ok, go, yes, run) unlock only when the previous assistant turn showed fenced commands. Super mode skips the gate.
TUI and slash commands
Tabs: Chat (Ctrl+1), Notebook (Ctrl+2 — the append-only harness notebook), Report (Ctrl+3 — the derived report), Terminal (Ctrl+5 — project-root shell), Log (Ctrl+6). Tab switches and many slash commands work while a turn is in progress; sending a new agent message waits until the turn ends. The browser workbench accepts the same /codon … commands.
| Command | Purpose |
|---|---|
/help, /exit / /quit | Help; quit. |
/new (/fresh, /restart_session, /reset) | Archive the session under state/archive/ and start fresh. |
/model [ID], /max-steps N (/steps) | Change the model (opens the model wizard) or the per-message round cap. |
/mcp, /skill | Reload MCP servers / list and fetch skills. |
/compact, /reflect [focus], /cancel | Compact the thread; record a lesson from the last turn (multi-try fixes only); cancel a wizard step. |
/chat, /output (/runtime, /mcplog), /report, /log, /terminal (/term, /shell) | Switch tabs. |
/codon list, /codon goto [N], /codon whereami | Print the checklist; select a step; show focus, sub-tasks, harness status and next action. |
/codon done N, /codon pending N, /codon undo [N] | Mark a step done / not done / undo the last mark. A step you reopen closes again only after a run of the step writes a result again. |
/codon split [N] [a | b …] | Add nested sub-tasks (manual titles or LLM auto-split). |
/codon validate [N | ignore] | On-demand scientific validation of a step; ignore records an override. |
/codon plan [focus], /codon solution N | One-shot plan call; print #### Solution for step N. |
/codon skill-domain [1 3 | owner/repo@skill | none | local <path> | apply | keep] | Resolve a pending domain-skill choice: accept discovered skills.sh candidates by number, name one, decline, pin a local skill for the whole plan, or accept / decline a proposed checklist re-partition. Bare: list what is pending. |
/codon skill-import <name | path> [--step N] [--remove] (alias /codon skill) | Attach your own skill to one checklist step (default: the step in progress); its SKILL.md and scripts/ list go into that step's prompt, with no LLM fit check. A path outside the project is copied into skills/. Bare: list your skills and what is attached. |
/codon skill-gen [N …] [-m "prompt"] [--name NAME] [--force] | Write a reusable skill to skills/<name>/ (SKILL.md + scripts/) from the Solution and Output of steps N, a prompt, or both. Project paths and values become script arguments; scripts are syntax-checked, never run; nothing is attached. |
/codon report [fast] [N], /codon sync-harness | Rebuild the report; rebuild the notebook from state/deepagents.sqlite. |
/codon wrap, /codon tidy | Dream this project into host memory ~/.xcodon/memory/ (check the pages against its record, then tidy them); only tidy the pages. |
/codon <agent> | External agent handoff (gemini, gemini-cli, codex, antigravity / agy, or a handoff_cli_presets key); see External CLI handoff. |
Ctrl+Shift+C cancels the current run. Ctrl+Q quits.
First launch without a checkpoint runs onboarding: subject (PDF, article URL, your own plan markdown, a research template, or a software project URL — the last two write inputs/research_template.md or inputs/software_project_*) → data source (paper vs own-data) → skill choice → outputs/research_plan.md → plan review. That is the plan-mode path. Your own plan or typed task runs in direct mode by default: subject → skill choice → type start, or plan to switch to plan mode. PDFs are copied to inputs/ and converted to <stem>.md plus optional <stem>_figures/ (one PNG per figure) and <stem>_tables/ (CSV). Article URLs write article_page.md with the same figure/table folders. Headless onboarding (no TUI) uses xcodon run --super with --subject-kind, --subject, and --reproduction-mode — see Guide. With checkpoint messages, the session replays from the checkpoint tail.
Plan review. After planning, the TUI stops before step 1. Type a change (for example merge steps 3 and 4) or a question about the plan. One LLM call answers the question, or rewrites the whole plan and shows a short summary. A revision with no checklist steps, or a cut-off reply, is not saved. The previous plan is kept as outputs/research_plan.prev.md, and each step's Tools: and Sources: lines are declared again. Type start to begin step 1, checklist to show the checklist again, or back to rechoose the data mode. You can also edit the file by hand; start reads it from disk. A restarted TUI returns to the review if it was still open. The browser workbench offers the same edits in an Edit the plan chat box on the research session page. Headless runs do not stop.
Plan style. plan_style sets what a plan fixes. With the default goal, a step states its goal, its expected result and what the sources name. For each analysis the sources leave open, a Standard practice line names the field's default method, and the Tools: line names one package for it. The step chooses every number and setting after it looks at the data. With method, each step carries its full method, with parameters and cut-offs, before any code runs. The planner of a goal plan gets the method tables of the bundled analysis-method-selection skill. The planner of a method plan gets bundled scientific-basics and the host memory domain pages (~/.xcodon/memory/, kind domain) instead.
Plan generation runs with plan_reasoning_effort (default high) on plan_model when set (otherwise the session model). The agent loop's own budget is agent_reasoning_effort, and the judge's is validation_reasoning_effort; both default to high. null sends no effort and leaves the provider's default. xcodon sends an effort only to models that LiteLLM lists with a reasoning mode. A common split is a fast model for the loop with a stronger plan_model and harness_validation_llm_model for planning and review. The TUI /model menu and the browser workbench's model picker (New project, Project settings) offer the same model list; any LiteLLM model id also works.
Each plan step carries two one-line fields that the gate's tools checks read (off by default; see Gate). Tools: names the software the step runs, spelled as invoked, or none. A goal plan names one package per method; a method plan may write alternatives as a or b. Sources: names the network hosts the step downloads from, or none. The planner writes them. For a method plan, a pass on the final plan fills or corrects them. The plan's Paper digest ends with a numbered Main conclusions list; without paper text the planner marks them unknown rather than inventing them.
Command line
xcodon init myproject [--base DIR] [--model|-M MODEL] [--max-steps N] [--container-engine ENGINE] [--runtime-r-image IMAGE] [--runtime-python-image IMAGE] [--run-mode auto|plan|direct]
xcodon run myproject [-m "…"] [--super] [--preset paper|reproduce|strategy] [--resume|--fresh|--reinit]
xcodon serve|onboard [--host 127.0.0.1] [--port PORT] [--base DIR] [--frontend-dist DIR] # onboard: --rebuild --skip-build --no-open
xcodon list [--base DIR] [--json]
xcodon import PATH
xcodon webapp run NAME -p ID [--set id=value]
xcodon rules PROJECT [--write [--force]] # gate checks and judge rules, and whether each is on
xcodon dream PROJECT… [--dry-run] # update host memory from finished projectsDefault project folder is ./<project_id>/ relative to the current directory; --base DIR (on init, run, serve, onboard, list, codon, rules, dream) uses another parent. The TUI continues from state/checkpoint.json when it exists; --fresh starts a new run instead, and one-shot run -m also takes --resume to force it. Without --port, serve and onboard use the first free port from 8420 up and say so; a busy port named with --port stops the command. Release wheels ship the built web UI under xcodon/web/static/; XCODON_WEB_DIST points at an alternative dist directory.
Fresh and reinit. --fresh starts a new run, in the TUI as well as one-shot and headless runs. It moves the previous run's conversation, notebook and report, checklist progress, blocked steps, validation rounds, gate state and graded files out of the project, to a sibling <project>.pre-fresh-<UTC>/ folder. Workspace files, the plan and the provenance ledger stay; the per-step tool and source checks then count only this run's commands. --reinit implies --fresh and starts the project over: it moves workspace/, outputs/, state/, skills/, .agents/, handoff/ and memory/ to a sibling <project>.pre-reinit-<UTC>/ folder. It keeps inputs/, agent.yaml and the MCP config. Both refuse while a run of the project is live. Nothing is deleted.
Crash resume (super mode). While a run --super is live it holds state/run.lock; only a normal return removes it. Rerun the same command after a crash (out-of-memory kill, Ctrl-C, reboot) and xcodon resumes it: it stops shell jobs the dead session left running (each job is recorded in state/jobs/<id>/job.json), moves empty files the crash cut off from workspace/ and outputs/ to state/resume/<stamp>/quarantine/, and puts a resume brief in front of the first message — done steps, the step to resume at, stopped jobs, quarantined and possibly incomplete files, and graded deliverables present or missing. The brief is saved as state/resume/<stamp>/brief.md and logged to the notebook. The conversation continues from state/deepagents.sqlite. A second run of a project whose run is still live exits with an error, even with --fresh; --fresh after a crash stops the leftover jobs instead of resuming.
Checklist commands (xcodon codon, no agent loop; -p/--project is the default for every subcommand, bare xcodon codon -p ID prints the checklist):
xcodon codon whereami -p ID # focus, nested sub-tasks, harness status, next action
xcodon codon goto -p ID [N] # list steps, or select step N (saves state/tui_state.json)
xcodon codon done|pending|undo -p ID --step N
xcodon codon split -p ID N [titles…] # nested sub-tasks (manual titles or LLM auto-split)
xcodon codon validate -p ID N # on-demand scientific validation of step N
xcodon codon plan -p ID [-m "focus"] [--model M]
xcodon codon solution -p ID N # print `#### Solution` for step N from the report
xcodon codon sync-harness -p ID # rebuild outputs/<id>_notebook.md from state/deepagents.sqlite
xcodon codon skill-domain -p ID [CHOICE] # resolve a pending domain-skill choice
xcodon codon skill-import -p ID NAME [--step N] [--remove] # alias: codon skill
xcodon codon skill-gen -p ID [N …] [-m PROMPT] [--name NAME] [--force]Direct mode
Direct mode runs a task with no plan and no checklist. One conversation goes from the first look at the data to the final files. Fresh conversations then review the result, and code checks the files. The gate, judge and referee of plan mode do not run.
When it is used.
- In the TUI and the browser workbench, your own plan or typed task runs in direct mode by default. You can pick plan mode instead at the setup step.
- A paper, a research template or a software project always runs in plan mode.
run_modeinagent.yamlsets the default:auto(default) anddirectwork as above;planruns every subject in plan mode. Setup writes the result todirect_mode.- Headless runs read only
direct_mode. Set it withxcodon init myproject --run-mode directordirect_mode: true. The task comes from--subject(with--super --subject-kind own-plan) or from-m "…".
How a run goes.
- Work turn. One conversation does the task, in at most
direct_mode_stepsmodel calls (default 150). When a deliverable the task names is missing, the run sends it back to finish, at most twice. - Reviews. One model call lists the conditions the task names. A condition is a state a unit of the data can be in, such as a faulty sample. Each condition gets its own fresh conversation. It searches for that condition, compares what it finds with the deliverables and fixes them. A last review checks units with two conditions, and the files. A task that names no condition gets no review.
direct_mode_check_steps: 0turns every review off. - Hard-fact checks. Code checks that each deliverable the task names exists and can be read. It also checks that identifiers in a deliverable come from the inputs. A failure goes back to the work conversation, at most
direct_mode_fix_roundstimes (default 2).
state/direct_mode.json keeps the stage, so a stopped run resumes where it was. At the end, a one-step outputs/research_plan.md records the run, so the project opens in the TUI like any other. A headless plan-mode run gets the same reviews once its checklist is complete (plan_review, default true). This needs a task text that names a condition, and one recorded script that writes the task's files.
What the agent gets.
- A short system prompt and three tools:
coala_execute_python,coala_execute_randrun_shell. Each script's plain output is the tool result, with no per-round digest. - Tool search (
direct_mode_tool_search, default on). The run lists the task's methods and searches the Coala index for a packaged tool for each. It also getscoala_searchandcoala_invoke. - Method rules (
direct_mode_method_rules, default on). The first message carries, after the task, the method rules of the bundled skillsscientific-basicsandanalysis-method-selection. - Domain skills (
direct_mode_domain_skills, default on). These are the skills you chose on the setup page's skills step, or else a skills.sh lookup on the task text. The first message lists them as files to read, beside the matching host memory domain pages.
Turns on an ACP agent (after v0.6.1). ACP is the Agent Client Protocol, which lets a program drive a coding agent. Set direct_mode_agent to a /codon handoff preset with protocol: acp, such as the built-in antigravity (it runs agy acp). A model id acp/<preset> does the same; the web model picker offers Antigravity this way. Every turn and side call then goes to that agent instead of xcodon's own loop. No LiteLLM model or key is needed. Sign in to the agent once in a terminal first (Antigravity: run agy).
- The agent works in the project root with its own shell and file tools. It also gets xcodon's script and tool-search tools as an MCP server, unless the preset sets
xcodon_tools: false. - It gets only the skills chosen on the setup page; the automatic lookup is skipped.
- An agent cannot be held to a number of model calls. Each turn gets a time limit instead:
direct_mode_agent_sec_per_step(default 60 s) for each call the turn would have had. The turn also stops at the first tool call past its budget. direct_mode_reviewssets the reviews:each(one per condition, then the last review),one(the last review only) orauto(default:onefor an ACP agent,eachfor xcodon's own loop).- Each turn goes to the project notebook and to
state/acp_turns.md.outputs/run_manifest.jsonlists the turns, with no token counts. - An ACP agent runs only in direct mode. A paper, template or software project needs a LiteLLM model.
Every field and its default: Configuration and the config reference. Internals: Agent backend.
Step validation
Step validation applies to plan mode; direct mode has its own reviews. The agent closes each step with Checklist step N is complete. and a Results: block right after it. The block has one bullet per item the step's Expected output names: its value, or the file and column that holds it. The report copies this list into the step's Output word for word.
Gate
The gate is deterministic: the same files on disk give the same rows. Each row is pass, fail, skip or unbound, with a one-line fix. Each check family belongs to a group. Only the core and integrity groups run by default; harness_gate_groups turns on plan_binding and tools, and a project's harness_rules.yaml switches single checks (Harness rules). xcodon rules PROJECT lists every check and whether it is on. Besides artifacts, declared checks, restrictions, plan numbers, Output consistency, claims and deliverables, the gate checks:
| Family | Group | Checks |
|---|---|---|
row_key | plan_binding | An output's row keys have the format of the task's example identifiers (for example, no version suffix when the examples have none). |
tool_ran | tools | Every tool on the step's Tools: line ran successfully in that step. The line is frozen at the gate's first look, so a tool dropped later is still owed. A probe (which, --version, --help) is not a run. A subcommand the Method names (cellranger-arc count) must itself run. |
source_used | tools | Each host on the step's Sources: line was reached by a run of the step. |
lineage | core | Each data file the step's Output declares traces back to input data or a download. A file the agent typed is not a result. |
workload | tools | The share of the named data that reached an output is plausible, unless the plan says it subsamples. |
fabrication | integrity | Code the step ran draws random or hashed values for a result file. Seeds are excepted. |
id_values | integrity | An identifier column in a deliverable table holds only values, and pairs, that the input tables hold. |
method_test | core | Each method module in workspace/methods/ has a planted-truth test that passes, and that fails against a stand-in returning its input. |
visual_check | integrity | A step that claims a visual check of a figure opened the current version of that figure. Only models that take image input get this row; the system prompt tells them to open the figures a conclusion rests on. |
expected_coverage | plan_binding | Each identifier the Expected output names appears in the step's report or in the files it names. A missing item is a reporting gap unless it is a result the step owed. |
quarantine | core | The step re-created a file quarantined as fabricated. |
tool_ran, source_used, lineage, workload and fabrication read the provenance ledger. They are evidence, not verdicts. A step red only on them still goes to the judge, which decides. A fabrication hit is a lead: the judge's verdict stands, a pass included. A missing file under inputs/ never fails a step, because a step cannot create inputs.
Judge
The judge reads the gate table, the agent's step report and the code that wrote the step's results. It also gets the plan's Paper digest and Expected results. Each major result must appear beside its published value. Each paper conclusion the step bears on gets a verdict: reproduced, partly, not reproduced, or not testable here. A missing comparison, a missing verdict or a hidden divergence fails the step. A divergence reported plainly, with its cause investigated, passes. The judge never recommends tuning a setting until a result matches. The judge's Important notes on a passed step reach the agent once, without reopening the step.
Blocked, substituted and unresolved steps
- Blocked. When a step cannot be computed honestly, the agent writes
Checklist step N is blocked: <reason>.and writes no stand-in. Valid reasons: an input file is not there, the declared tool was tried and cannot run here, or a run did not finish within the compute or rounds left. The reason must name the failed run or the missing file. Missing documentation is not a block. A block that cites compute limits stands only when a run of the step was killed or timed out. Steps that need a blocked step are blocked too. The run moves on, andoutputs/run_manifest.jsonlists the step underblocked_steps. - Substituted. When only the declared tool cannot run here, the agent tries it first, then writes
Checklist step N substitutes <tool> for <declared tool>: <reason>.Thetool_ranrow becomes a warning only when the declared tool failed on record and the substitute ran in the step. The judge passes the swap only for a published alternative that computes the same quantity from the same inputs, with the swap stated in the Output. - Reviewed. The judge reviews each new block or substitute once against the step's Method and recorded runs. A claim the record does not back is refused with the judge's fix, and the step reopens. After two refusals the claim stands and the step is listed as unresolved. A review that cannot run accepts the claim.
- Fabricated. Fabricated results are never accepted. The judge tags such a finding
[data] fabricated. It gets up to three fix rounds outside the run's validation budget. Then xcodon blocks the step and moves the files whose last writer ran in that step tostate/quarantine/fabricated/step_N/. At run end, the validation model reviews each flagged graded file before it is moved out. - Unresolved. A step is sent back for fixes at most twice. When its rounds run out, or the same failure (the same failing gate rows, or the same Critical findings) returns unchanged after a fix was asked for, the step is closed as unresolved. It stays marked done so the run goes on. It stays failed in the report, shows as unresolved in
/codon list, and is listed underunresolved_stepsinrun_manifest.json. The end-of-run nudges ask the trace and the answer to say so.
Stale steps
xcodon records when each step completes. Suppose an earlier step K is completed again after a later step M, and a run of K rewrote a file that M read, wrote or names. Then M is stale: xcodon reopens it, records it in state/gate/stale_steps.json, and tells the agent which files changed and to redo M in order. The judge does not take a stale step's old text as evidence. run_manifest.json lists steps still stale under stale_steps.
Tasks that ask for one answer
These rules apply only when the task asks for an answer: a graded answer file, or an ## Answer section in the task instruction. Open research is unchanged. The agent is told to name the candidates, report the margin over the runner-up, and resolve contrary evidence in its own files rather than cite the plan's rule over it. References must not be built from the query. Plan review requires a comparative decision rule for the answer step and one independent check of a different kind. The referee sends the work back when the answer was never compared with the runner-up, contradicts a step result, rests on a near-tie, or was scored against the query itself.
Provenance
With tools.trace_executions: true (default), each execution adds a record to state/provenance/ledger.jsonl. The record holds the step, the project files read and written, the programs started, the modules imported, the hosts contacted, and whether the run succeeded.
run_shellcommands run understracewhen it is installed.coala_execute_pythonandcoala_execute_rscripts get a short tracing preamble. When the image hasstrace, the script re-runs itself under it. Images xcodon builds get a best-effortstraceinstall that never fails the build.- MCP tool calls record the project paths their arguments name.
- Files the agent writes itself are recorded as typed: written by the agent, not computed.
- The code each run executed (container scripts, and shell commands over 300 characters) is kept under
state/provenance/code/.
xcodon snapshots workspace/ and outputs/ before and after each execution. A trace is full only when it came from the kernel and saw every file the run changed. Otherwise it is partial, and the gate draws no negative conclusion from it. Files inside software environments (conda, virtualenv, installed Python or R packages) are left out: loading a library is not reading data. Set tools.trace_executions: false to turn tracing off; the gate then skips the checks that need it.
Memory and lessons
Lessons. Reflection lessons use one format in the project log and in host memory: a ## Lesson L-xxxxxx — <title> heading, then Applies when, Lesson, What failed, up to five Evidence lines (date · project · quote), and Seen · Synced · Last confirmed. Code owns the ID, the counts and the dates; the model writes only the text.
Reflection runs after a clean turn and on /reflect. It records a finding only when a later run could not work out again from its own files: a strategy that worked, a checked rule, a tool or environment quirk, or a fix that took several tries. The model replies NEW for a new lesson, or SEEN <id> when a known lesson recurred, which adds evidence and raises its Seen count. An unknown ID or a missing field writes nothing. Lessons go to memory/<reflection_skill_folder>/SKILL.md in the project (default folder reflections).
Memory hooks append to memory/hooks.md, a plain log rather than a skill. memory_hooks.target_folder is no longer used.
Host memory
Host memory lives in ~/.xcodon/memory/ (XCODON_GLOBAL_MEMORY_ROOT moves it). All projects on the machine share it. It holds:
| File | What it is |
|---|---|
<slug>.md | One page per topic. Its frontmatter gives name, description, kind and updated. |
lessons.md | The host lesson log, in the lesson format above. |
_index.md | One line per page, grouped by kind. Code builds it; never edit it by hand. |
.dream/ | log.md (every edit applied or dropped), state.json (last dream date per project), history/ (the pages before each of the last 10 dreams), legacy/ (the old folders after migration). |
A page has one of three kinds:
- habit: how to work, for any project.
- domain: rules for a scientific field or a tool stack.
- resource: links, accessions and documentation pointers.
Each fact on a page is one line. Code ends the line with its source, for example — (scrnaseq, 2026-10-02). A later project that confirms it adds ; confirmed <date>. A correction keeps the old text: was <old> until <date>, per <project>. When two projects disagree and neither clearly wins, both stay, and the second is a CONFLICT: line.
Runs only read host memory. A run sees it in four ways:
- The first 4,000 characters of
_index.mdare in the system prompt of plan-mode runs and chat. The index starts with a warning: memory can lag, so read a page before you rely on it and re-check facts that matter. - The pages are mounted read-only at
/global-memory/<slug>.md. - Library prefetch shows matching parts of the pages before a script that imports a library: habit pages, the sections of domain and resource pages that name the library, and the host lessons that mention it, most-confirmed first.
- Planning and each checklist step get the domain pages as host domain rules.
The agent never writes host memory. It writes a finding it wants to keep, with how it confirmed it, to memory/notes.md in the project.
Dreaming
A dream is the only thing that writes host memory. Run it after a project is finished:
xcodon dream myproject otherproject
xcodon dream myproject --dry-runFor each named project, the dream reads the project's record: the head of the plan and report, the tail of the notebook, the project lesson log, memory/notes.md and memory/hooks.md. One model call reads that record beside the pages that fit it. The model replies with edits: confirm, correct or add a fact line, mark a conflict, or start a new page. It may not record data values, task answers, results or secrets. After all projects, one more call reorganizes the pages: it merges two pages on the same topic, renames a page, rewrites a description or changes a kind.
Code checks every edit before it applies it. An edit that names a missing page, or a line that is not on the page, is dropped and logged. A reply that is not valid JSON, or whose edits are all dropped, gets one retry with the reason. A second failure, or a failed model call, skips that project. A merge moves every line, so no fact is lost. Before it writes, the dream saves the old pages under .dream/history/. It then rewrites _index.md, adds the project's new lesson sightings to lessons.md by ID (code only, so a repeat dream adds nothing) and appends what it did to .dream/log.md.
All calls use the first named project's model; there is no second model. The command prints counts per project (added, confirmed, corrected, conflicts, dropped) and exits with code 1 when a project was skipped. --dry-run makes the same calls, prints the edits and writes nothing.
In the UI, /codon wrap dreams the current project, and /codon tidy runs only the reorganize call.
A project with host_memory_enabled: false in agent.yaml (use it for benchmark runs) does not read host memory: no index in the prompt, no page prefetch, no host domain rules and no /global-memory/ mount. xcodon dream and /codon wrap refuse it, and /codon tidy is off in it. When every named project is refused or skipped, the dream changes no page.
Upgrading from the old layout. Older versions kept host memory in four folders: behavioral-patterns/, domain-instructions/, resources/ and reflections/, each with a SKILL.md. The first time a run or a dream opens the store, xcodon turns the first three into pages of kind habit, domain and resource, moves the reflections log to lessons.md, and moves the old folders to .dream/legacy/. A dry run does not migrate.
Skill compose. When skill_auto_apply is true (default), skill_apply_pending makes one model call that decides MERGE, REVISE or KEEP for the proposal in skills/_pending/<name>.md. Code checks the frontmatter, the size (skill_file_max_chars) and truncation, and retries once. If the result still fails, the skill stays as it was and the proposal stays pending. Each decision is a line in skills/<name>/.history/decisions.md, and the last 10 versions are kept there.
Skill discovery (skills.sh)
Domain skills published on the open skills.sh index (a SKILL.md plus optional scripts) often already describe the pipeline a plan needs — fine-mapping, colocalization, differential expression. xcodon looks for them at two moments:
- Before the plan (onboarding): xcodon reads the paper's Abstract, Methods and Code availability (or the aim, when there is no Methods section) and the model splits the work into at most 8 computational stages, each with its method and the tools the paper names. Each stage's method, its assay (
bulk RNA-seq,DamID-seq) and each named tool (without its version) are searched on skills.sh alone — the search returns nothing for long queries, and an assay finds skills where a tool name often returns off-topic ones. Each stage's candidates take every query's best hits in turn. Copies of one skill in several repositories count once. Every stage is judged by its own LLM match gate against only its own candidates, which accepts only a skill whose workflow is that stage's analysis (not a lookup of precomputed results, not a keyword coincidence). The menu lists the stages, the skill that covers each, and the stages no skill covers. The result is saved per paper, model and prompt version;refreshsearches again. When the stage split gives nothing, the aim is matched as a whole, as before. In the TUI and web onboarding you choose among the judged candidates (1 3,0for none,local <path>for your own) before the plan is generated./codon planand unattended runs, when no choice was made in onboarding, run the same stage-first matching and install every skill a stage matched; a stage with an ambiguous verdict gets none, since nobody is there to choose. When the model gives no stages, the aim is matched as a whole, with a second search by the plan's step titles. - Per checklist step: once per user message, the focused step is searched too; a matched skill is mapped onto the checklist stages it covers and applied only there, and it may propose a re-partition of the checklist (announced in the chat).
Fetching is over the same unauthenticated endpoints the skills CLI uses (api/search, api/download); the download API allows 60 requests per hour, so fetched directories are cached for 24 h under ~/.xcodon/cache/skills/ and, when the API refuses, the skill comes from a shallow git clone. Install tiers: the fetched directory → coala skill → the SKILL.md text alone, all into .agents/skills/<skill_id>/.
Third-party code
A match downloads and installs third-party skill code into the project and performs network I/O. Review .agents/skills/ before running its scripts, restrict discovery to an owner with tools.skill_finder_owner, or set tools.skill_finder_enabled: false.
Configuration: tools.skill_finder_enabled, skill_finder_timeout_sec, skill_finder_max_candidates, skill_finder_owner (Configuration).
Tool catalog
Built-ins
Zone-scoped path tools: read_workspace_file, write_workspace_file, read_inputs_file, read_outputs_file, list_project, list_workspace, import_project_data, resolve_pdf_path. Separately, the Deep Agents backend supplies read_file / write_file / edit_file / ls / glob / write_todos over the project root plus /global-memory/ (→ ~/.xcodon/memory/) and /tmp/.
run_shell: enabled by default (tools.allow_shell; set false to remove it). Withshell_block_outside_project(defaulttrue), commands that scan or read outside the project home (except allowed paths like/tmp, and read-onlyinputs/symlinks to external datasets) are rejected. Also refused: hostpython/Rinterpreters (usecoala_execute_*), container commands (docker,podman,nerdctl,xcrunner), host service managers (systemctl,systemd-run,journalctl), a debugger or tracer that attaches to a running process, paths in the container runner's own folders, writes understate/or through externalinputs/symlinks, largecatofinputs/files (shell_refuse_inputs_read_bytes),head -nbeyondshell_head_max_lines, and dot-path listings (.git,.env,.agents/). Each job runs under a memory ceiling (shell_job_memory_max, default 80% of RAM) in a systemd user scope, so a runaway is killed inside its own cgroup rather than taking the machine down; run one sample at a time and use the tool's own--threadsoption instead of one process per sample. Long commands are waited for, not killed: pastshell_timeout_seca command becomes a long job with a watcher (state/jobs/<id>/watch.log), detached children are waited for, a job whose CPU, output and writes all stop growing forshell_job_stall_secis killed, andshell_job_max_sec(4 h) is the cap. The stall check samples only the job's own process group, so a quiet submission client (srun,sbatch --wait,ssh host cmd) looks idle — setshell_job_stall_sec: 0on HPC or remote hosts.sleepis refused — the harness owns the wait. Runningxcodonitself from the shell is refused too. Inside a Slurm job, long shell jobs and MCP calls wait at least as long as the job has left, minus 10 minutes, so xcodon does not cut off a run the job still has time for. Output is capped atshell_output_max_chars.download_data: Zenodo records via a container with md5/size verification, GEO series viacoala_execute_r+ GEOquery, other URLs via hostwget/curlor a project script.read_step_record: the recorded gate / judge outcome of a checklist step.list_mcp_tools/describe_mcp_tool: inspect MCP tools rather than grepping CWL on disk.
Direct execution of .agents/mcps/<toolset>/run_mcp.py via shell is blocked — use MCP tool names instead.
MCP (mcp__<server>__<tool>)
Stdio servers only, from the merged config (MCP merge); env entries cannot override the host PATH or loader variables. Optional mcp_tools_max caps how many MCP tools are exposed (0 = uncapped; the tail is truncated).
After a successful coala_invoke ["coala","mcp", ...], xcodon hot-registers the new server so its mcp__… tools are available on the next model round of the same turn. Per-tool failure counters and captured stderr feed the CWL auto-repair pass. When a call finds a server's connection lost (its process exited or was killed), xcodon restarts that server once, which re-lists its tools from disk, and runs the call again. xcodon uses version 2 of the MCP Python SDK (mcp>=2.2).
Coala registry: coala_search / coala_invoke
coala_search: discover tools/skills in the Coala index. One keyword per call — whitespace-separated multi-term queries are rejected with a guardrail; issue separate searches per concept. Optionalcategoryfilter (nextflow,galaxy,cwl) — prefer workflow categories for raw public data or multi-tool pipelines before individual CLI searches. Workflow toolsets are prefixed —nf-<name>(Nextflow),Galaxy-<name>,cwl-<name>; invoke the exact indexed id, never the bare name. The first index lookup in each xcodon process fetches a current index, ascoala search --refreshdoes; later lookups read the cache it wrote. That fetch waits at most 15 s and keeps the cached index if it fails, so an offline compute node is not held up.coala_invoke: run Coala CLI-shaped invocations (e.g.coala mcp <toolset>,coala skill <name>) with cwd = project root so imports land under.agents/mcpsand.agents/skills.
With tools.coala_dispatch_python: true (default), the coala-client library performs these steps without requiring a coala binary on PATH. Set false to force subprocess-based coala. tools.allow_coala_cli: false removes both tools from the loop.
/codon plan may still use Coala search (and optionally skill import) depending on plan_allow_coala_search and plan_allow_coala_skill_import even when allow_coala_cli is false for the main loop.
Coala runtime: coala_execute_python / coala_execute_r
Container-backed execution goes through the MCP server whose name matches tools.coala_runtime_server (default coala-runtime). That server must expose the Coala runtime executor tools; the bundled coala-runtime skill describes them and is already in the system prompt (the model is told not to fetch it).
Backend: coala-runtime uses COALA_CONTAINER_ENGINE or coala-runtime --engine … (docker, podman, singularity, apptainer — see upstream CLI). agent.yaml tools.coala_runtime_container_engine sets COALA_CONTAINER_ENGINE on the MCP subprocess (and optional coala_runtime_mcp_extra_env).
Images and packages: a call with packages builds or reuses an image labelled xcodon/<project>-<label>:latest (built_image_label, save_built_image, recorded in workspace/container_artifacts.json) with subset reuse and delta installs; deps_backend chooses the installer. Timeouts default to coala_execute_timeout_sec (3600 s — 1 h, the coala-runtime executor's own maximum) and are clamped at coala_execute_timeout_max_sec; a longer job belongs in run_shell.
Mounts: container-path keys map to host values; project-relative literals in scripts are normalised into the mounted prefixes, unresolved mismatches are rejected before the runtime starts, and CWL MCP outputs under /tmp are re-mounted.
If the server fails to start, other tools may still run.
Skills
list_local_skills, fetch_local_skill, skill_propose_update, skill_apply_pending over project and host skills (skill_auto_apply, digests, skill_digest_max_chars). The two mutating tools are side-effect tools gated by execution approval and human-in-the-loop (HITL) pauses. skill_apply_pending runs the compose step. Bundled skills: analysis-method-selection, coala-client, coala-runtime, cwl-commandlinetool, find-tools, scientific-basics, self-improving-agent, skill-creator, stats-ml-basics.
The research skills load in three tiers, so the agent prompt does not carry their full text on every call:
- Always on. The rules the gate and the judge enforce are cut from
scientific-basicsandanalysis-method-selectionby heading and stay in the system prompt. - On demand. Those two skills and
stats-ml-basicsare listed with their trigger; the agent reads the rest withfetch_local_skill. Each fetch is counted instate/skills_loaded.jsonand inskills_loadedinrun_manifest.json. - Per step. Sections of the host memory domain pages whose heading words match the plan's Aim or the current step go into the per-turn prompt; the other sections are listed by heading.
The planning call gets its own skill text; see Plan style under TUI and slash commands.
External CLI handoff
/codon <name> (model-facing tool external_cli_handoff) runs a configured external CLI (tools.external_cli, plus handoff_cli_presets merged case-insensitively with the built-in gemini, gemini-cli, codex, antigravity and agy) with a timeout, handing over handoff/prompt.md — useful for escalating to another coding agent.
A preset's protocol sets how xcodon talks to the agent:
cli(default) runscommand args… handoff/prompt.mdand returns its output.acpstartscommand args…as an Agent Client Protocol (ACP) server and sends the prompt over the protocol. The built-inantigravityandagypresets runagy acpthis way (after v0.6.1). xcodon answers each permission request with the preset'spermission(alloworreject).modeandmodelset the agent's session mode and model. Withxcodon_tools(defaulttrue), the agent also gets xcodon's script and tool-search tools as an MCP server. The result goes tohandoff/acp_log.md, and the agent's errors tohandoff/acp_stderr.log. If the agent needs a sign-in, sign in once in a terminal (Antigravity:agy).
The same ACP presets can run every turn of a direct-mode run.
Standalone apps (webapps)
A validated pipeline can be packaged as a webapp: workspace/webapps/<name>/manifest.json declares typed inputs, outputs and the command; the browser workbench renders a form with a Run button and xcodon webapp run NAME -p ID [--set id=value] runs the same path from the host CLI, honouring tools.coala_runtime_container_engine. Outputs land under outputs/webapps/<name>/.
Required, optional, and per-mode inputs. Every input sets "required": true or false, and the form badges it Required or Optional. When one select input picks the analysis mode, an input that only some modes use lists them in active_when:
{"id": "analysis_mode", "type": "select", "label": "Analysis", "required": true,
"default": "splicing", "options": ["splicing", "expression_eqtl", "chromatin_tf"]},
{"id": "target_gene", "type": "string", "label": "Target gene", "required": true,
"active_when": {"analysis_mode": ["expression_eqtl"]}}In the other modes, the form greys the input out and marks it Not used. required applies only while the input is in use. A blank optional input, or one the chosen mode does not use, is left out of the run. In a shell command, its {{id}} is removed together with the --flag before it, and it is absent from inputs.json. The script treats a missing flag as "not given", so placeholder values such as "none" are not needed.
The form gets this behaviour from the host's helper script, /webapps-vendor/xcodon-form.js, which input.html loads. Validation flags an input without an explicit required, a label that says "(Optional)" or "(Required)", and a form that does not load the helper.
Secret inputs. An API key, token or password is declared with "secret": true and, optionally, "env", the environment variable the script reads (for example ALPHAGENOME_API_KEY). The form shows it as a password field. A shell run gets the value as that environment variable, never on the command line; a blank field keeps the host's own value of the variable. A container run reads it from inputs.json, which the host clears after the run. The run log masks it. A secret has no default, and validation flags a key typed into the app's code or a key-like input not marked secret.
A real run, not results retrieval. Every Run must call the method the app is about (the library, model API, tool or workflow the session used) on the form's inputs. Validation fails an app that installs a package no script imports, draws values at random, or returns typed-in or earlier results. With the validation model on, it also reviews the run scripts next to the session code that already ran the same method, and fails an app that does not follow that code. When the method cannot run (no key, no network, no tool), the Run must stop with an error instead of falling back to stored results.
Project layout
Paths are relative to the project root unless noted.
| Path | Role |
|---|---|
agent.yaml | Main agent configuration (Configuration). agent.yaml.bak is the atomic-write backup used when the file is corrupt. |
harness_rules.yaml | Optional switches for single gate checks and judge rules (Harness rules). |
HEARTBEAT.md | Optional long-lived context injected into the system prompt (size capped by config). |
mcp.json | Optional Coala/Cursor-style MCP server list at project root. |
mcp_servers.json | Legacy alias for the same schema (merged before mcp.json; for duplicates mcp.json wins). |
.agents/mcps/mcp_servers.json | Coala coala mcp imports merge entries here; hot-loaded in-session. |
.agents/skills/ | Imported Coala skills and third-party skills installed from skills.sh by the skill finder. |
inputs/, workspace/, outputs/ | Data and artifacts, indexed by the workspace VFS (vfs_roots); a tree plus delta is injected into the prompt up to vfs_prompt_max_chars (index cached in state/vfs_index.json). |
inputs/<stem>.md, inputs/<stem>_figures/, inputs/<stem>_tables/ | Article markdown, one PNG per captioned figure, CSV tables — from PDF onboarding (alongside inputs/<stem>.pdf). |
inputs/article_page.md, …_figures/, …_tables/ | The same from URL/HTML onboarding. |
inputs/research_template.md, inputs/software_project_* | Template and software-project onboarding inputs. |
outputs/research_plan.md | Plan produced during onboarding or supplied as a path. |
outputs/research_plan.prev.md | The plan before the last plan-review edit. |
outputs/run_manifest.json | Written at the end of each run: model, continuations, installed and loaded skills, and blocked, unresolved and stale steps. |
outputs/<project_id>_notebook.md | Append-only session + tool log (legacy harness_notebook.md is renamed automatically). |
outputs/<project_id>_report.md | Derived report for the Report tab (legacy harness_report.md / harness_notebook_tidy.md renamed automatically). |
outputs/plan_context_digest.md | Compaction summaries for lighter /codon plan context. |
outputs/webapps/<name>/ | Outputs of project webapps. |
outputs/mcp_startup_last.txt, outputs/cwl_failures.md | Recent MCP startup errors; optional debug log for terminal CWL MCP failures. |
workspace/webapps/<name>/manifest.json | Webapp definition (typed inputs, declared outputs, command). |
workspace/container_artifacts.json | Built container images recorded for reuse. |
state/checkpoint.json, state/deepagents.sqlite | Resume state for the chat; the LangGraph thread. |
state/checklist_progress.json, state/tui_state.json | Checklist done-marks and the current focus (codon goto). |
state/gate/ | Deterministic step-gate tables and stale_steps.json (written by the harness, not the agent). |
state/provenance/ledger.jsonl, state/provenance/code/ | What each execution read, wrote and ran; the code it ran. |
state/blocked_steps.json, state/tool_substitutes.json, state/block_reviews.json | Blocked steps, declared substitutes and the judge's reviews of them. |
state/quarantine/fabricated/step_N/ | Files moved out of a step blocked for fabrication. |
state/figure_views.jsonl, state/skills_loaded.json | Images shown to the model; on-demand skill fetches. |
state/validation_overrides.json, state/skill_finder.json | Validation overrides (codon validate ignore) and skill-discovery decisions. |
state/archive/ | Archived sessions after /new. |
state/llm_requests.jsonl | The system prompt and tool schemas of each agent model call; unchanged text is stored once. |
state/direct_mode.json, state/direct_work/ | Direct mode: the run's stage, and the finished work conversations. |
workspace/notes.md, workspace/final.py, workspace/review/conditions.md | Direct mode: the agent's notes, the script that writes every deliverable, and the reviews' record of each condition. |
state/acp_turns.md, state/acp_session.json, state/acp_stderr.log | Direct-mode turns on an ACP agent: each turn in full, the current session id, the agent's errors. |
handoff/prompt.md | Prompt handed to an external CLI agent via /codon <agent>. |
handoff/acp_log.md, handoff/acp_stderr.log | Reply, tool calls and permission answers of an ACP handoff; the agent's errors. |
memory/<reflection_skill_folder>/SKILL.md, memory/hooks.md, memory/notes.md | Project lessons from reflection (default folder reflections); the memory-hooks log; findings the agent keeps for the next dream. |
skills/, skills/_pending/ | Project skills (SKILL.md trees); proposals awaiting the compose step, or review when skill_auto_apply: false. |
skills/<name>/.history/ | Compose decisions (decisions.md) and the last 10 replaced versions. |
~/.xcodon/.env, ~/.xcodon/settings.json | Host-wide API keys and model/env defaults. |
~/.xcodon/memory/ | Host memory: <slug>.md pages, lessons.md, _index.md, and the dream's .dream/ folder (Host memory). |
~/.xcodon/cache/skills/ | 24 h cache of skill directories fetched from skills.sh. |
How MCP configuration is merged
The runtime builds one ordered list of stdio MCP servers:
agent.yaml→mcp_servers- Project root →
mcp_servers.json(if present), thenmcp.json(later files override the samename) .agents/mcps/mcp_servers.json(e.g. aftercoala mcp …) — overrides any same-named server from earlier steps- If no server named
coala-runtimeexists, a default stub (command: coala-runtime) is appended sotools.coala_runtime_servercan resolve tools.coala_runtime_container_engine/coala_runtime_mcp_extra_envinjectCOALA_CONTAINER_ENGINE(coala-runtime; same as--engine) onto thecoala_runtime_serverMCP entry;coala_mcp_container_enginedrivescoala mcp --container-runnerduringcoala_invokeimports and setsCOALA_MCP_CONTAINER_ENGINEonrun_mcp.pyservers (Configuration)
Python command lines are normalized: generic python/python3 running Coala run_mcp.py use an interpreter that can import coala.mcp_api (probed from xcodon’s executable, then python3, then python). xcodon does not read ~/.cursor/mcp.json. MCP cwd for stdio servers is the project root.
Coala MCP and runtime ecosystem
Coala (Command-line LLM-agent Adapter) connects CWL-described tools to MCP so LLMs can run containerized, reproducible CLIs. In xcodon:
- Streamable / per-toolset MCP —
coala mcp <toolset>materializesrun_mcp.pyand CWL under.agents/mcps/<toolset>/and registers the server in.agents/mcps/mcp_servers.json. Tools surface asmcp__<server>__…. - coala-runtime — a separate stdio MCP server (e.g.
command: coala-runtime) exposes Python/R executors in a container (Docker by default), selected viatools.coala_runtime_server. For Singularity, Apptainer, or Podman, settools.coala_runtime_container_engineand optionaltools.coala_runtime_mcp_extra_envinagent.yaml(see Configuration).
CWL MCP coala mcp also accepts --container-runner (docker, podman, singularity, udocker); tools.coala_mcp_container_engine drives coala-client imports and subprocess coala mcp when coala_dispatch_python is off (apptainer is sent as singularity). Extra env for run_mcp.py processes: coala_mcp_extra_env plus COALA_MCP_CONTAINER_ENGINE.
Together they cover “discover and invoke many CLIs via MCP” and “run ad hoc notebooks/scripts in isolated containers.”
Further Coala background: Coala documentation and the Coala site pattern (MCP + CWL).
Context limits and mitigations
Long transcripts, large research_plan.md excerpts, many MCP tools, or huge tool outputs can hit provider limits. Mitigations include:
- Shorter threads (
run --fresh,/new) llm_round_tool_output_max_chars,llm_round_max_tool_calls— the per-round tool-output budgetcheckpoint_keep_recent_tool_messages,checkpoint_tool_content_max_chars,plan_excerpt_max_chars,vfs_prompt_max_charsmcp_tools_max/compactand a model with a larger context window
Troubleshooting
| Symptom | What to check |
|---|---|
Connection closed / ModuleNotFoundError for MCP | Install coala where run_mcp.py runs; see outputs/mcp_startup_last.txt and /mcp in the TUI. |
| MCP tools missing after import | They hot-load on the next model round of the same turn; otherwise /mcp to reload and confirm .agents/mcps/mcp_servers.json. |
command not found for a CLI | After coala mcp, binaries live in the container/toolset, not the host — call mcp__… tools, not raw run_shell for that CLI. |
| Skill discovery finds nothing or the wrong skill | Check the chat notice and state/skill_finder.json; narrow with skill_finder_owner; pin your own with /codon skill-domain local <path>. HTTP 429 from skills.sh is expected under heavy use — the git-clone fallback and the 24 h cache take over. |
| Context window errors | /compact, the round tool-output budget, fewer MCP tools, or a bigger-context model. |
Related
- Guide — install and first project.
- Configuration — every
agent.yamlkey and environment variable. - Agent backend — Deep Agents runtime, summarization, the gate → judge → referee pipeline, HITL parity.
