You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: agent-in-terminal — drop hardcoded workflows, add bash + MCP
Per user direction, remove all hardcoded agent workflow commands.
The agent now drives tool + skill selection from the chat REPL, the
way Claude Code does. Four deterministic utilities remain (`setup`,
`init`, `status`, `ingest`); everything else happens in `chat`.
Removed
- `thesis curate` (was: injects long step-by-step curate prompt)
- `thesis style` (was: step-by-step style-learner prompt)
- `thesis write SECT` (was: step-by-step drafter prompt)
- `thesis lint` (was: wiki-linter / citation-linter prompt)
- `_run()` helper in cli.py
- All matching tests in test_commands.py + test_extra_coverage.py
- `test_cli_prompts_have_explicit_stop_markers` in test_loop_guard.py
(no more hardcoded prompts to assert STOP against)
Added
- `src/thesis_agent/tools.py`:
* `bash` tool — runs commands in the workspace root, captures
stdout+stderr, 60 s timeout (tunable via
THESIS_SHELL_TIMEOUT_SEC), 64 KB output cap. Disabled
globally with THESIS_NO_SHELL=1.
* `_load_mcp_config` + `load_mcp_tools_sync` — picks up
`.thesis/mcp.json` or `mcp.json` (or $THESIS_MCP_CONFIG),
supports both flat and `{servers: {...}}` shapes, uses
`MultiServerMCPClient` from `langchain-mcp-adapters`.
Tolerant to bad JSON, missing adapters package, failed
server connections.
* `build_runtime_tools()` composes bash + MCP tools into the
list that `build_agent` hands to `create_deep_agent`.
- `langchain-mcp-adapters` dependency in pyproject.toml.
- `thesis` (no subcommand) now opens the chat REPL directly;
`thesis --help` still lists commands.
- 31 new tests in test_tools.py covering the bash tool, the MCP
config loader (all three search paths + both config shapes),
and `build_runtime_tools` composition.
Updated
- `agent.build_agent`: passes `tools=build_runtime_tools()` instead
of `tools=[]`. Agent now has shell + MCP at runtime.
- `MAIN_SYSTEM_PROMPT` in agent.py: rewritten to describe the
agent-in-terminal model — here are your tools + skills + memory,
here are the hard rules (citation, never-write-to-raw/data), now
figure out what the user wants. Removed the "delegate to these
three subagents for these three tasks" scaffolding.
- `AGENTS.md` "Write scopes" section: now describes soft
conventions (not hard sandbox rules) + a "Tools at runtime"
section listing filesystem / bash / MCP / memory.
- `README.md`: command table trimmed to the four utilities + chat;
explains the available tools + how to attach MCP servers.
- `tests/test_cli_smoke` + `tests/test_commands`: `--help` expectations
now assert the small command list and explicitly check that
curate/style/write/lint are GONE (regression guard).
Tests: 348 passed, 1 skipped (Windows symlink rights). Ruff clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|`thesis status`| What's in the workspace (counts, DB sizes, thread id). |
60
64
|`thesis ingest [DIR]`| Normalise PDFs/DOCX/EPUB/MD/URLs → markdown. No LLM. |
61
-
|`thesis style`| Compile `style/STYLE.md` from `style/samples/`. |
62
-
|`thesis curate`| Build wiki pages from `pending` sources. |
63
-
|`thesis write SECTION`| Draft one thesis section. |
64
-
|`thesis lint [FILE]`| Citation + grounding linter over chapters. |
65
-
|`thesis chat [--new]`| Interactive REPL. `/new`, `/quit` control the session. |
66
-
67
-
Global flags: `--thread <id>`, `--version`.
65
+
|`thesis chat`| Agent REPL with streaming + slash commands. **This is where you do everything else** — "curate the pending sources", "draft section 2.1", "lint the wiki", "show me what sources disagree about X". |
66
+
|`thesis` (no subcommand) | Alias for `thesis chat`. |
0 commit comments