Integrate Claude Code provider into the chat UI alongside regular
Ollama/Anthropic providers. Updates AgentPanel and Chat components.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add REST and MCP endpoints for creating, listing, and removing worktrees.
Includes worktree lifecycle management and cleanup operations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Server detects .story_kit/ in cwd or parent directories at startup and
automatically opens the project. MCP tools work immediately without
manual project-open step. Falls back to cwd when no .story_kit/ found.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Agent worktrees now get a .mcp.json written with the correct port from
the running server. AgentPool receives the port at construction and
passes it through to create_worktree, which writes .mcp.json on both
new creation and reuse.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bug 2: Expand triangle now works when no agents are started - shows
"No agents started" message. AgentPanel moved to top of panels.
Bug 3: Run `git worktree prune` before `git worktree add` to clean
stale references from externally-deleted worktree directories.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add wait_for_agent MCP tool that blocks until an agent reaches a terminal
state (completed, failed, stopped). Returns final status with session_id,
worktree_path, and git commits made by the agent.
- Subscribe-before-check pattern avoids race conditions
- Handles lagged receivers, channel closure, and configurable timeout
- Default timeout 5 minutes, includes git log of agent commits in response
- 11 new tests covering all paths
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add base_branch detection to WorktreeInfo (from project root HEAD)
- Expose base_branch in AgentInfo API response
- Add {{base_branch}} template variable to agent config rendering
- Show git difftool command with copy-to-clipboard in AgentPanel UI
- Add diff command instruction to coder agent prompts
- Add AgentPanel tests for diff command rendering and clipboard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Supervisor reads CLAUDE.md and README before coordinating
- Coders commit their work before finishing
- All agents stop at "gates green" - never accept or merge
- Human always does final acceptance and merge to master
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix CLAUDECODE env var blocking nested Claude Code sessions
- Add drain-based event_log for reliable get_agent_output polling
- Add non-SSE get_agent_output fallback (critical for MCP tool calls)
- Preserve worktrees on agent stop instead of destroying work
- Reap zombie processes with child.wait() after kill
- Increase broadcast buffer from 256 to 1024
- Engineer supervisor and coder prompts in project.toml
- Point .mcp.json to test port 3002
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
getAnthropicModels() was called unconditionally on mount, causing a
console error when no API key was set. Now chains the call after
getAnthropicApiKeyExists() confirms a key is present.
Includes regression test added before the fix per bug workflow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use --resume <session_id> with claude -p so the web UI claude-code-pty
provider maintains full conversation context across messages, identical
to a long-running terminal Claude Code session.
Changes:
- Capture session_id from claude -p stream-json system event
- Pass --resume on subsequent messages in same chat session
- Thread session_id through ProviderConfig, ChatResult, WsResponse
- Frontend stores sessionId per chat, clears on New Session
- Unset CLAUDECODE env to allow nested spawning from server
- Wait for clean process exit to ensure transcript flush to disk
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documents STORYKIT_PORT env var for running multiple instances
in parallel worktrees without port conflicts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Agents running in git worktrees weren't inheriting permissions from
settings.local.json since it's path-specific. Moving the allowlist to
the committed settings.json ensures all worktrees get pre-approved
permissions automatically.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use --resume <session-id> with claude -p to maintain conversation
context across messages in the web UI claude-code-pty provider.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace single [agent] config with multi-agent [[agent]] roster system.
Each agent has name, role, model, allowed_tools, max_turns, max_budget_usd,
and system_prompt fields that map to Claude CLI flags at spawn time.
- AgentConfig expanded with structured fields, validated at startup (panics
on duplicate names, empty names, non-positive budgets/turns)
- Backwards-compatible: legacy [agent] format auto-wraps with deprecation warning
- AgentPool uses composite "story_id:agent_name" keys for concurrent agents
- agent_name added to AgentEvent variants, AgentInfo, start/stop/subscribe APIs
- GET /agents/config returns roster, POST /agents/config/reload hot-reloads
- POST /agents/start accepts optional agent_name, /agents/stop requires it
- SSE route updated to /agents/:story_id/:agent_name/stream
- Frontend: roster badges, agent selector dropdown, composite-key state
- Project root initialized to cwd at startup so config endpoints work immediately
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>