Skip to content

Commit 0ba0541

Browse files
0skiTrigger.dev RepoOps
authored andcommitted
docs: merge version skew protection into the atomic deployments page
Version skew protection and atomic deployments now share one docs page. `/deployment/version-skew-protection` redirects to `/deployment/atomic-deployment`, which explains version skew protection first, states the release it is available from (v4.5.12), and adds a sequence diagram of a run waiting for its matching deployment. A closing section describes the legacy Vercel atomic deployments, marks them as deprecated and not advised, and lists the migration steps. Mono-RevId: ac02e72b5bb0f0f21a233bf58050db017e91bfc0
1 parent a7629e8 commit 0ba0541

15 files changed

Lines changed: 446 additions & 651 deletions

‎docs/ai-chat/client-protocol.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Pick `"preload"` when the UI has rendered but the user hasn't typed (warms the a
212212
| `triggerConfig.maxAttempts` | `number` | Per-run retry cap (1–10). |
213213
| `triggerConfig.maxDuration` | `number` | Per-run wall-clock cap, seconds. |
214214
| `triggerConfig.lockToVersion` | `string` | Pin every run to a specific worker version. |
215-
| `triggerConfig.externalDeploymentId` | `string \| null` | Pin every run to the deployment carrying this [external deployment id](/deployment/version-skew-protection#chat-sessions). Discovered from the environment when omitted; `null` opts the chat out. |
215+
| `triggerConfig.externalDeploymentId` | `string \| null` | Pin every run to the deployment carrying this [external deployment id](/deployment/atomic-deployment#chat-sessions). Discovered from the environment when omitted; `null` opts the chat out. |
216216
| `triggerConfig.region` | `string` | Region preference. |
217217
| `triggerConfig.idleTimeoutInSeconds` | `number` | Surfaced to the agent through the wire payload (1–3600). |
218218

‎docs/ai-chat/fast-starts.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ chat.startHeadStart<TTools>({
745745

746746
`completion` resolves once the head start finishes; `await` it or hand it to `waitUntil`. It rejects if the warm step or the dispatch fails.
747747

748-
`pendingVersion` is `true` when the agent run is parked waiting for the deployment carrying the session's [external deployment id](/deployment/version-skew-protection#chat-sessions). Step 1 still runs in your process and still reaches the browser, so pass the flag to the destination page if you want it to say a deploy is in progress rather than appear to stall on step 2.
748+
`pendingVersion` is `true` when the agent run is parked waiting for the deployment carrying the session's [external deployment id](/deployment/atomic-deployment#chat-sessions). Step 1 still runs in your process and still reaches the browser, so pass the flag to the destination page if you want it to say a deploy is in progress rather than appear to stall on step 2.
749749

750750
### Limitations
751751

‎docs/ai-chat/patterns/version-upgrades.mdx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Chat agent runs are pinned to the worker version they started on. When you deplo
1010

1111
<Note>
1212
If your sessions are pinned by [version skew
13-
protection](/deployment/version-skew-protection#chat-sessions), you do not need this page to move a
13+
protection](/deployment/atomic-deployment#chat-sessions), you do not need this page to move a
1414
conversation onto a new deployment. A pinned session follows its pin on its own: when the stored
1515
`externalDeploymentId` stops naming the deployment a run is on, the agent hands over at the next
1616
turn boundary. Set [`versionSkew: "hold"`](#staying-put) to turn that off for one agent.
@@ -32,7 +32,7 @@ The new run lives on the **same Session** as the old one. `chatId` is the durabl
3232

3333
### What "the latest deployment" means
3434

35-
The handoff clears the session's [external deployment id](/deployment/version-skew-protection#chat-sessions) so the new run can land on the current version — re-applying the pin the agent just rejected would make the upgrade impossible. The cleared pin is persisted on the session, so the next continuation doesn't fall back to it either.
35+
The handoff clears the session's [external deployment id](/deployment/atomic-deployment#chat-sessions) so the new run can land on the current version — re-applying the pin the agent just rejected would make the upgrade impossible. The cleared pin is persisted on the session, so the next continuation doesn't fall back to it either.
3636

3737
To move to a specific deployment rather than to whatever is current, name it:
3838

@@ -220,7 +220,7 @@ Two cases never hand over automatically, whatever `versionSkew` says:
220220
turn boundary — never mid-turn. If the pin names a deployment that hasn't landed yet, the successor
221221
parks: your messages stay durable, and the transport emits `run-pending-version` with
222222
`source: "upgrade"` so you can say so in the UI. See [parked
223-
chats](/deployment/version-skew-protection#chat-sessions).
223+
chats](/deployment/atomic-deployment#chat-sessions).
224224
</Note>
225225

226226
## Custom agents
@@ -254,7 +254,7 @@ Both are graceful exits. [`onRecoveryBoot`](/ai-chat/patterns/recovery-boot) doe
254254

255255
## See also
256256

257-
- [Version skew protection](/deployment/version-skew-protection#chat-sessions) — pin a session to the deployment matching the app build that started it
257+
- [Version skew protection](/deployment/atomic-deployment#chat-sessions) — pin a session to the deployment matching the app build that started it
258258
- [Lifecycle hooks](/ai-chat/lifecycle-hooks) — where `onTurnStart` and `onChatResume` fit in the turn cycle
259259
- [Recovery boot](/ai-chat/patterns/recovery-boot) — the sibling hook for mid-stream interruptions (does NOT fire on `requestUpgrade`)
260260
- [Database persistence](/ai-chat/patterns/database-persistence) — how continuations interact with session state

‎docs/ai-chat/reference.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ The `onEvent` callback receives a `ChatTransportEvent` (exported from `@trigger.
698698
| --- | --- | --- |
699699
| `message-sent` | `messageId?`, `source`, `durationMs`, `partId?`, `bodyBytes?` | A send was durably acknowledged — a 2xx from the session input stream append (or the `headStart` POST), after any internal token-refresh retries. This means the message is durably written to the stream the agent consumes from, not merely "request accepted". `partId` is the append's idempotency key, also stored on the server-side record. |
700700
| `message-send-failed` | `messageId?`, `source`, `error`, `status?`, `durationMs`, `partId?`, `bodyBytes?` | A send definitively failed after internal retries. Fires in addition to `useChat`'s `onError`. |
701-
| `run-pending-version` | `source` | The chat's run is parked waiting for the deployment carrying its external deployment id ([version skew protection](/deployment/version-skew-protection#chat-sessions)). Everything already sent is durable and answered once the deployment lands. `source` is `"start"` (learned while starting the session), `"send"` (from a message append, re-emitted on every send while parked) `"head-start"` (from the `headStart` POST, where step 1 still streams from your server and only step 2 waits) or `"upgrade"` (an automatic version handover whose successor is parked on a deployment that has not landed). |
701+
| `run-pending-version` | `source` | The chat's run is parked waiting for the deployment carrying its external deployment id ([version skew protection](/deployment/atomic-deployment#chat-sessions)). Everything already sent is durable and answered once the deployment lands. `source` is `"start"` (learned while starting the session), `"send"` (from a message append, re-emitted on every send while parked) `"head-start"` (from the `headStart` POST, where step 1 still streams from your server and only step 2 waits) or `"upgrade"` (an automatic version handover whose successor is parked on a deployment that has not landed). |
702702
| `stream-connected` | `resumed`, `lastEventId?`, `messageId?` | The SSE subscription to the session's output stream started delivering. `resumed: true` when reconnecting from a stored cursor (page reload) rather than following a fresh send. `lastEventId` is the cursor it connected from. |
703703
| `first-chunk` | `chunkType?`, `lastEventId?`, `messageId?`, `sinceSendMs?` | The first response chunk of a turn arrived. `sinceSendMs` is the delta from the last turn-producing send — time to first token without any bookkeeping. |
704704
| `turn-completed` | `lastEventId?`, `sessionInEventId?`, `messageId?`, `sinceSendMs?` | The agent's turn-complete control record arrived — the "finished answering" signal. `sinceSendMs` is the full turn latency; `sessionInEventId` is the cursor the agent can safely resume its input stream from. Treat it as a lower bound: it is held back behind any message still waiting to be handled, so it can be below the sequence of the record this turn answered. Do not use it to decide whether a turn boundary belongs to your own send. |

‎docs/ai-chat/sessions.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const { id, runId, publicAccessToken, isCached } = await sessions.start({
111111
| `type` | `string` | Free-form discriminator. `chat.agent` uses `"chat.agent"`. |
112112
| `externalId` | `string?` | Your stable identity. Cannot start with `session_` (reserved). |
113113
| `taskIdentifier` | `string` | Task this session triggers runs against. |
114-
| `triggerConfig` | `SessionTriggerConfig` | Trigger options applied to every run: `tags` (up to 10, same as [run tags](/tags); the chat helpers such as `chat.createStartSessionAction` and `AgentChat` add a `chat:{chatId}` tag themselves, which uses one slot. Direct `sessions.start` callers get all 10 and must add any chat tag themselves), `queue`, `machine`, `maxAttempts`, `maxDuration`, `region`, `idleTimeoutInSeconds`, `basePayload`, and the version pins `lockToVersion` / [`externalDeploymentId`](/deployment/version-skew-protection#chat-sessions). |
114+
| `triggerConfig` | `SessionTriggerConfig` | Trigger options applied to every run: `tags` (up to 10, same as [run tags](/tags); the chat helpers such as `chat.createStartSessionAction` and `AgentChat` add a `chat:{chatId}` tag themselves, which uses one slot. Direct `sessions.start` callers get all 10 and must add any chat tag themselves), `queue`, `machine`, `maxAttempts`, `maxDuration`, `region`, `idleTimeoutInSeconds`, `basePayload`, and the version pins `lockToVersion` / [`externalDeploymentId`](/deployment/atomic-deployment#chat-sessions). |
115115
| `tags` | `string[]?` | Up to 10 tags on the Session row (separate from `triggerConfig.tags`). |
116116
| `metadata` | `Record<string, unknown>?` | Arbitrary JSON. |
117117
| `expiresAt` | `Date?` | Hard retention deadline. |

0 commit comments

Comments
 (0)