M18-4: Architect agent bootstrap (host-mode, singleton) #165
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#165
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As an operator, I want a new architect agent type that runs in the host process (no container), has filesystem access to the repo, can call the service's own HTTP API, and exposes a persistent chat session the UI can talk to, so that spec writing / breakdown / assignment become an interactive workflow instead of webhook-only dispatch.
Acceptance criteria
Agent type
config/agents.json::types.architectentry:forgejo_user: "architect"(new Forgejo account; operator provisions the token file)default_model: "claude-opus-4-7[1m]"(1M context — spec work needs it)container: { enabled: false }— bypasses the container-reconcile flowplugins: []— no per-agent plugin set (runs with the host's~/.claudeconfig)default_system_prompt— purpose, scope, guard-rails (full text in #M18-5)db.tsseeds onearchitect-defaultrow; Agents CRUD UI refuses to create a second architect instance (409 Conflict)ResolvedAgentgains ahost_mode: booleanflag derived fromcontainer.enabled === falseagent-runner.runAgentTaskbranches: host mode skipscontainer.ts::exec, invokes SDKquery()inline in the service process withcwd: process.cwd()Security & isolation
architect). Any other type withcontainer.enabled: falsefailsloadWebhookConfigat startup~/.config/claude-hooks/agent-env/architect/). Operator provisions viajust agent-env-sync architectbreakdown, read/writespecs/*.md, POST to its own service's/breakdown,/task,/cancel. Explicitly cannot merge PRs or push tomainscripts/smoke-creds.shlearns to probe architect (host-mode: filesystem + token file, not container exec)Sessions & chat
apps/server:POST /architect/chat— body{ session_id?, message }. Ifsession_idabsent, creates a new one. Returns{ session_id, task_id }and starts streaming SSE at/architect/stream/:task_idGET /architect/sessions— list persisted sessions (id, first-message preview, last-updated, turn count)GET /architect/sessions/:id— full transcriptDELETE /architect/sessions/:id— droparchitect_sessionstable: id, created_at, updated_at, title, messages JSON)pushEventenvelope so renderers can be shared with the monitorDocs
architectrowTests
architect.test.ts— start a session, send a message, mock the SDK, assert the stream event shapewebhook-routing.ts)Out of scope
Dependencies
packages/sharedtypes).References
specs/m18-ui-rewrite-and-architect.md§Story M18-4