Files
Claude 88f30775b7 Replace the fake harness with a real terminal coding agent
Removes the Pi configs, the placeholder prompt, context, security and
sub-agent modules, and the docs and tests that described them.

Adds src/agent/: a streaming tool-use loop on the Messages API with
file, search and shell tools, permission rules (.cod/settings.json),
append-only JSONL sessions with resume, and a terminal front end
(`cod`, `cod -p`, `--continue`, `--resume`). The web chat now shares the
model table and history rules with the agent.

Keeps the memory store and worktree runner, with a stricter memory key
check and failed workers reported as failed. All tests use a fake client.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015NGPpYxuPWkyJUoefut3Wo
2026-10-25 16:48:56 +00:00

1.0 KiB
Executable File

Notes for working on cod.ai

  • Python 3.11+, Anthropic Python SDK. Run the tests with python3 -m unittest discover -s tests. They use the fake client in tests/fakes.py; never make real API calls from tests.
  • Requests use adaptive thinking, output_config.effort, top-level cache_control, and fallbacks: "default" where the model supports it (not Haiku 5.5). Don't add budget_tokens, thinking: disabled or a forced tool_choice: the current models reject them.
  • The history is append-only. Store assistant content exactly as returned (thinking signatures included), apply history_content after a fallback, and keep the system prompt and tool list fixed for a session, or the prompt cache and thinking blocks break.
  • Tool inputs come from the model: validate them (the pydantic models in src/agent/tools.py) and return failures as is_error tool results.
  • Credentials stay out of the browser and out of the agent's shell environment (sanitized_env).
  • src/agent/models.py is the one model table; the CLI and the web server both read it.