Skip to content

Commit 95574bd

Browse files
bchapuisclaude
andcommitted
Add email-agent runner with suspend/resume agent loop
Introduce EmailAgentRunner Durable Object and email-agent nodes that send a message and park until a reply arrives. The agent loop gains a suspend/resume path: suspending tools return an AgentLoopSuspension the caller fulfils asynchronously, then resumes via resumeState + resumeToolResults. MailboxDO tags threads with an owning agent run so inbound replies route to the runner instead of re-triggering workflows. Extract LLM dispatch (agent-llm.ts) and tool/service wiring (agent-services.ts) out of AgentRunner so both runners share them. Also bump hono, react-router, vite, and exifreader. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 983c50c commit 95574bd

30 files changed

Lines changed: 2740 additions & 632 deletions

apps/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"aws4fetch": "^1.0.20",
4949
"cron-parser": "^5.5.0",
5050
"drizzle-orm": "0.45.2",
51-
"hono": "^4.12.18",
51+
"hono": "^4.12.26",
5252
"jose": "^6.2.3",
5353
"nanoid": "^5.1.11",
5454
"openai": "^6.37.0",

apps/api/src/context.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { FFmpegContainer } from "./containers/ffmpeg-container";
44
import type { LanguageSandbox } from "./containers/language-sandbox";
55
import type { AgentRunner } from "./durable-objects/agent-runner";
66
import { DatabaseDO } from "./durable-objects/database-do";
7+
import type { EmailAgentRunner } from "./durable-objects/email-agent-runner";
78
import type { MailboxDO } from "./durable-objects/mailbox-do";
89
import type { WorkflowAgent } from "./durable-objects/workflow-agent";
910

@@ -17,6 +18,7 @@ export interface Bindings {
1718
WORKFLOW_AGENT: DurableObjectNamespace<WorkflowAgent>;
1819
DATABASE: DurableObjectNamespace<DatabaseDO>;
1920
AGENT_RUNNER: DurableObjectNamespace<AgentRunner>;
21+
EMAIL_AGENT_RUNNER: DurableObjectNamespace<EmailAgentRunner>;
2022
MAILBOX: DurableObjectNamespace<MailboxDO>;
2123
FFMPEG_CONTAINER?: DurableObjectNamespace<FFmpegContainer>;
2224
DUCKDB_SANDBOX?: DurableObjectNamespace<any>;

0 commit comments

Comments
 (0)