12 Commits
Author SHA1 Message Date
BillyOutlast 2df4b3e4c5 Merge pull request #1 from Heretek-AI/claude/project-thread-24ajkd
Rebuild cod.ai as a real Claude coding agent and web chat
2026-10-25 13:27:31 -04:00
Claude 73562fec61 Validate session ids before building a session path
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015NGPpYxuPWkyJUoefut3Wo
2026-10-25 17:15:09 +00:00
Claude e9fb8ffc51 Add agent mode to the web GUI and a read-only explore sub-agent
- Web GUI: a Chat / Agent mode selector. Agent mode runs the coding
  agent on `cod serve --root`, shows tool calls as cards, and asks for
  approval in the browser; sessions live in .cod/sessions/ and resume
  after a restart. Closing the stream stops the turn.
- The API now rejects requests whose Host isn't loopback (DNS rebinding)
  and POSTs without the per-process token embedded in the page.
- `explore` tool: a sub-agent on an in-memory session with only
  read_file, glob and grep, returning a report; its usage counts toward
  the turn.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015NGPpYxuPWkyJUoefut3Wo
2026-10-25 17:13:49 +00:00
Claude 4d618baca7 Add compaction, the memory tool and a bubblewrap shell sandbox
- Requests turn on server-side compaction (compact_20260112, default
  trigger 150k input tokens); compaction blocks are stored and resent.
- The memory_20250818 tool keeps notes in .cod/memory/, with paths and
  symlinks confined to that folder. Whether a session has it is saved in
  the session header so the tool list stays fixed across resumes.
- Shell commands run under bwrap when installed: read-only system,
  hidden home, writable project and /tmp, read-only .cod/.
- The file tools can no longer write into .cod/, so Claude can't grant
  itself permissions.
- The REPL prints token usage after each turn.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015NGPpYxuPWkyJUoefut3Wo
2026-10-25 17:03:19 +00:00
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
Claude c09fc7d44b Address review findings on the web chat server
- Keep the last fallback marker in echoed history, so the blocks on both
  sides of a mid-output fallback stay in their original shape.
- Report failures that happen before a request is sent (the SDK raises
  TypeError when no credentials are configured) as a generic SSE error.
  The details go to the server log, not the browser.
- `cod serve` refuses non-loopback hosts unless --allow-remote is passed,
  because the chat API has no authentication.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015NGPpYxuPWkyJUoefut3Wo
2026-10-25 16:33:46 +00:00
Claude 25e3d4e982 Build chat messages as DOM nodes instead of innerHTML
Model output was escaped before being assigned to innerHTML, but the page
no longer relies on a hand-rolled escaper: Markdown is rendered with
createElement/textContent, and link targets must parse as http(s) URLs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015NGPpYxuPWkyJUoefut3Wo
2026-10-25 16:29:59 +00:00
Claude 0f901407f6 Rebuild the web GUI as a working, server-proxied chat client
The v2 GUI never actually chatted: without a key it showed canned replies
and fake "synthesized" code, and with one it called the API straight from
the browser with the key in localStorage. The server only returned
hardcoded telemetry, and fastapi was not a declared dependency.

- src/web_server.py: POST /api/chat streams a Messages API turn as SSE via
  the Anthropic SDK. Credentials stay server-side. Adaptive thinking,
  effort, automatic prompt caching and refusal fallbacks are set per
  model; requests are validated at the boundary.
- web/index.html: single-page chat with streaming replies, thinking
  summaries, Markdown rendering, stop, usage lines and local conversation
  history. Drops the duplicate cod_ai_claude_web_gui.html.
- `cod serve` subcommand; anthropic, fastapi and uvicorn declared.
- tests/test_web_server.py covers streaming, history echo, refusals,
  fallbacks, errors and validation with a fake client.
- DESIGN.md now documents the real request flow; the duplicate style
  guide in docs/ is removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015NGPpYxuPWkyJUoefut3Wo
2026-10-25 16:26:15 +00:00
John Smith 37fd5f3471 v2 2026-10-25 01:48:01 -04:00
John Smith 90a8fd4cde feat: initial release of cod.ai (Phases 0-5 verified) 2026-10-24 22:11:45 -04:00
John Smith 45aece1cd4 feat: initial release of cod.ai (Phases 0-5 verified) 2026-10-24 22:08:36 -04:00
BillyOutlast 2c284f832e Create LICENSE.md
Signed-off-by: BillyOutlast <[email protected]>
2026-10-24 21:23:54 -04:00