feat(web): Luke hands slow work to a background worker subagent
Merged
CH
13d ago+402+402+012345678901234567890123456789-63-63-01234567890123456789
First PR of the subagents stack. Luke can hand slow or separate work to a subagent that runs in the background while he keeps talking.
What changes
- A general
workersubagent (apps/web/eve/subagents/worker/). It's a declared subagent, built on eve 0.53.1's own support. eve runs each call as a background task and returns{ status: "working", taskId, agentId }at once.- It gets every read a background session can carry:
search_web,read_web_page, andrun_in_repository. - It gets nothing that speaks or shows.
queue_questionandshow_codereach the developer only through the planning turn the voice follows.draw_on_boardwould replace Luke's own drawing. - Its instructions, kept in
planning.ts: never speak to the developer, return a short summary with sources or paths, and never put the private folder's text into a public search. - It has its own token budget (eve
limits, 600k in and 40k out).task_updateis disabled, because each update would wake Luke for a paid turn.
- It gets every read a background session can carry:
task_cancelis back, re-exported from eve.- The hosted tool set names
workerandtask_cancelwith eve's declared inputs, so the writer keeps Luke's delegation call on the journal. - Admission. eve hands a dynamic resolver only the session's id and auth, never its lineage. So the worker's model and tools resolvers admit it on ownership alone (
admitDelegated). Its tool calls are still checked inrunToolagainst the root eve names there (parent.rootSessionId). The root's resolvers are reused throughbrainModel(admit)andhostedTools(names, admit), so there are no new edge files. - Planning prompt. "Working in parallel": Luke hands off anything beyond a lookup or two, briefs each worker fully, never waits on it or guesses its result, and runs at most three at once.
Tests
hosted-brain-host-ownership.test.ts:- A worker's tool call lands while its root is the conversation's session. It's refused after the conversation rotates, for another account, or with no lineage.
- Resolvers admit a child on ownership alone and refuse another account.
hosted-brain-host-relay.test.ts: a turn that delegates keeps theworkercall on its journal.hosted-brain-host-agent.test.ts: the tool set names the planning tools plus eve's delegation tools.eve buildregistersworkerandtask_cancel../scripts/check.shpasses.- The end-to-end eval (a worker runs to completion and wakes Luke) comes later in the stack.
This is a web-only change, with no Mac or UI changes.
š¤ Generated with Claude Code