You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a concrete Vercel queue consumer source for durable conversation
work so Vercel's `functions` entry matches an actual root `api/` file
during deployment validation. The source delegates to `server.ts`,
keeping queue delivery on the same Junior app wiring as the rest of the
runtime.
**Scaffold Contract**
`junior init` now writes the queue consumer source alongside
`vercel.json`, and the example app has a test that the trigger points to
a concrete file and routes through the app. The deploy guide now calls
out both the heartbeat cron and queue trigger entries.
Validated with targeted Junior tests, docs checks, the example Nitro
build with snapshot warmup skipped, and the example app typecheck.
Co-authored-by: GPT-5 Codex <codex@openai.com>
Copy file name to clipboardExpand all lines: packages/docs/src/content/docs/start-here/deploy-to-vercel.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,9 +41,9 @@ The scaffolded `package.json` includes the production build script:
41
41
42
42
Keep the Vercel build command as `pnpm build`. `junior snapshot create` prepares sandbox runtime dependencies declared by enabled plugins before request handling starts.
43
43
44
-
## Enable the heartbeat cron
44
+
## Keep Vercel runtime entries
45
45
46
-
Junior uses a one-minute internal heartbeat to run trusted plugin heartbeats and recover stale agent dispatches. The scheduler plugin uses this heartbeat when scheduled tasks are enabled. The scaffolded `vercel.json` should include this cron:
46
+
Junior uses a one-minute internal heartbeat to run trusted plugin heartbeats and recover stale agent dispatches. The scheduler plugin uses this heartbeat when scheduled tasks are enabled. The scaffolded `vercel.json` should include these runtime entries:
47
47
48
48
```json title="vercel.json"
49
49
{
@@ -54,11 +54,24 @@ Junior uses a one-minute internal heartbeat to run trusted plugin heartbeats and
54
54
"path": "/api/internal/heartbeat",
55
55
"schedule": "* * * * *"
56
56
}
57
-
]
57
+
],
58
+
"functions": {
59
+
"api/internal/agent/continue.ts": {
60
+
"maxDuration": 300,
61
+
"experimentalTriggers": [
62
+
{
63
+
"type": "queue/v2beta",
64
+
"topic": "junior_conversation_work"
65
+
}
66
+
]
67
+
}
68
+
}
58
69
}
59
70
```
60
71
61
-
If you maintain `vercel.json` manually, keep the `/api/internal/heartbeat` cron entry. The endpoint returns `401` unless the incoming Vercel Cron request has a bearer token that matches `CRON_SECRET`.
72
+
If you maintain `vercel.json` manually, keep the `/api/internal/heartbeat` cron entry and the queue trigger for `api/internal/agent/continue.ts`. The scaffolded `api/internal/agent/continue.ts` file delegates queue delivery to `server.ts`, and Vercel requires the `functions` key to match a concrete source file.
73
+
74
+
The heartbeat endpoint returns `401` unless the incoming Vercel Cron request has a bearer token that matches `CRON_SECRET`.
Copy file name to clipboardExpand all lines: packages/docs/src/content/docs/start-here/quickstart.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ cd my-bot
32
32
pnpm install
33
33
```
34
34
35
-
`junior init` creates the app entrypoint, Nitro/Vite config, Vercel config, CI workflow, app context files, local plugin and skill directories, and `.env.example`.
35
+
`junior init` creates the app entrypoint, Nitro/Vite config, Vercel config, Vercel queue consumer source, CI workflow, app context files, local plugin and skill directories, and `.env.example`.
0 commit comments