Commit 1133ad4
feat(core,sdk,webapp): version skew protection for chat.agent sessions
Chat sessions can now be pinned to a deployment, so a conversation keeps
talking to the agent version its release shipped with, across every
turn, idle suspend and recovery. The deployment id is resolved wherever
you start the session, exactly as it is for `trigger()`, so there is no
chat-specific setup — pass `triggerConfig: { externalDeploymentId: null
}` to opt a chat out. A pinned session also follows its pin on its own:
when your app redeploys and re-pins it, the agent hands the conversation
over at the next turn boundary instead of the new pin only applying to
the next run. Set `versionSkew: "hold"` on an agent that should stay
put. If a handover lands on a deployment that is still building, the
chat reports a pending version rather than going quiet, and messages
sent meanwhile are kept. Also fixes `AgentChat` ignoring `maxDuration`,
`region` and `lockToVersion` set on its `triggerConfig`, and a chat
agent answering the same message twice after a conversation moved to a
new run.
Mono-RevId: 1c6e161b3e4f6c3e81a50a7f24d08a43b0ba00571 parent 879e897 commit 1133ad4
32 files changed
Lines changed: 2254 additions & 135 deletions
File tree
- .changeset
- apps/webapp
- app
- routes
- services/realtime
- test
- docs
- ai-chat
- patterns
- deployment
- packages
- cli-v3/src/mcp/tools
- core/src/v3
- schemas
- sessionStreams
- trigger-sdk/src/v3
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
217 | 224 | | |
218 | 225 | | |
219 | 226 | | |
| |||
Lines changed: 69 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
126 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
| |||
215 | 221 | | |
216 | 222 | | |
217 | 223 | | |
218 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
219 | 229 | | |
220 | 230 | | |
221 | 231 | | |
| |||
268 | 278 | | |
269 | 279 | | |
270 | 280 | | |
271 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
272 | 286 | | |
273 | 287 | | |
274 | 288 | | |
| |||
285 | 299 | | |
286 | 300 | | |
287 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
288 | 320 | | |
289 | 321 | | |
290 | 322 | | |
| |||
301 | 333 | | |
302 | 334 | | |
303 | 335 | | |
304 | | - | |
| 336 | + | |
305 | 337 | | |
306 | 338 | | |
307 | 339 | | |
| |||
315 | 347 | | |
316 | 348 | | |
317 | 349 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
| 350 | + | |
327 | 351 | | |
328 | 352 | | |
329 | 353 | | |
| |||
342 | 366 | | |
343 | 367 | | |
344 | 368 | | |
345 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
346 | 374 | | |
347 | 375 | | |
348 | 376 | | |
| |||
372 | 400 | | |
373 | 401 | | |
374 | 402 | | |
| 403 | + | |
| 404 | + | |
375 | 405 | | |
376 | 406 | | |
377 | 407 | | |
| |||
384 | 414 | | |
385 | 415 | | |
386 | 416 | | |
| 417 | + | |
| 418 | + | |
387 | 419 | | |
388 | 420 | | |
389 | 421 | | |
| |||
426 | 458 | | |
427 | 459 | | |
428 | 460 | | |
429 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
430 | 470 | | |
431 | 471 | | |
432 | 472 | | |
| |||
447 | 487 | | |
448 | 488 | | |
449 | 489 | | |
| 490 | + | |
450 | 491 | | |
451 | 492 | | |
452 | 493 | | |
| |||
463 | 504 | | |
464 | 505 | | |
465 | 506 | | |
466 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
467 | 512 | | |
468 | 513 | | |
469 | 514 | | |
| |||
504 | 549 | | |
505 | 550 | | |
506 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
507 | 558 | | |
508 | 559 | | |
509 | 560 | | |
| 561 | + | |
510 | 562 | | |
511 | 563 | | |
512 | 564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
0 commit comments