Commit 44e8166
fix: set workspace-scoped runtime callback token on wake so replies persist
The message reporter and snapshot callbacks use the workspace-scoped
runtime.CallbackToken (workspaceCallbackToken), which has NO node-scoped
fallback. A freshly-woken container never runs create-workspace, so that
token was unset — the reporter hit "no auth token" and chat replies were
silently discarded (restored sessions accepted a prompt but never answered).
The DO now signs a workspace-scoped callback token and passes it on the
restore request; the vm-agent persists it via upsertWorkspaceRuntime before
resolving the snapshot callback token. Combined with the node-scoped
CALLBACK_TOKEN, this matches the normal launch (node token for node
callbacks + workspace token for message/snapshot callbacks).
Diagnosed from staging Worker logs: workspace_auth.rejected_node_scoped_token
on /session-snapshot/restore and reporter "no auth token".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 85f0c79 commit 44e8166
2 files changed
Lines changed: 20 additions & 4 deletions
File tree
- apps/api/src/durable-objects
- packages/vm-agent/internal/server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
357 | 363 | | |
358 | 364 | | |
359 | 365 | | |
| |||
369 | 375 | | |
370 | 376 | | |
371 | 377 | | |
| 378 | + | |
372 | 379 | | |
373 | 380 | | |
374 | 381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
136 | 145 | | |
137 | 146 | | |
138 | 147 | | |
| |||
0 commit comments