Commit 2c7e5c3
fix(app-builder): route sessions through cloud-agent-next (#3021)
refactor(app-builder): migrate to cloud-agent-next v2 and retire v1 streaming
- Default app_builder_project_sessions.worker_version to 'v2' and remove
the PostHog feature-flag gate so every new project runs on cloud-agent-next.
- Drop the v1 cloud-agent branches from the send/start/interrupt service
paths; legacy v1 sessions are now read-only and the backend always
upgrades to a fresh v2 session when the user sends a message.
- Remove the prepareLegacySession tRPC endpoint and WebSocket streaming
coordinator on the client. Ended v1 sessions load their R2 history
lazily via a new getLegacySessionMessages tRPC query (fired from the
ExpandableSessionBlock via loadMessages), so getProject no longer
fans out N R2 reads on every project load.
- Simplify v1 session plumbing: v1 messages.ts keeps only the helpers
the upgrade path uses; streaming.ts destructures cloudAgentSessionId
and drops the partial-message bookkeeping that was only meaningful
while v1 had a live WebSocket.
- Restore preview polling on v2 stream completion: active v2 sessions
built from existing project data were missing the onStreamComplete
callback, so follow-up messages on an established v2 session would
not restart preview polling after streaming transitioned to idle.
- Drop redundant workerVersion parameter from onSessionChanged since
App Builder is always on cloud-agent-next now.
- Fix dev app-builder tunnel script to write APP_BUILDER_URL to
apps/web/.env.development.local, which is what Next.js dev actually
reads (the repo-root file is ignored when vercel env pull has created
the apps/web copy as a real file instead of a symlink).
Co-authored-by: Evgeny Shurakov <eshurakov@users.noreply.github.com>1 parent f6591d3 commit 2c7e5c3
20 files changed
Lines changed: 19115 additions & 2984 deletions
File tree
- apps/web/src
- components/app-builder
- project-manager
- __tests__
- sessions
- v1
- v2
- lib/app-builder
- routers
- app-builder
- organizations
- dev/local/scripts
- packages/db/src
- migrations
- meta
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
90 | | - | |
| 88 | + | |
| 89 | + | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
101 | | - | |
| 100 | + | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
| |||
154 | 153 | | |
155 | 154 | | |
156 | 155 | | |
157 | | - | |
158 | | - | |
159 | 156 | | |
160 | 157 | | |
161 | 158 | | |
| |||
169 | 166 | | |
170 | 167 | | |
171 | 168 | | |
172 | | - | |
173 | 169 | | |
174 | 170 | | |
175 | | - | |
| 171 | + | |
176 | 172 | | |
177 | 173 | | |
178 | 174 | | |
| |||
187 | 183 | | |
188 | 184 | | |
189 | 185 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
211 | 195 | | |
212 | 196 | | |
213 | 197 | | |
| |||
221 | 205 | | |
222 | 206 | | |
223 | 207 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
235 | 216 | | |
236 | 217 | | |
237 | 218 | | |
| |||
247 | 228 | | |
248 | 229 | | |
249 | 230 | | |
250 | | - | |
| 231 | + | |
251 | 232 | | |
252 | 233 | | |
253 | 234 | | |
| |||
381 | 362 | | |
382 | 363 | | |
383 | 364 | | |
384 | | - | |
| 365 | + | |
385 | 366 | | |
386 | 367 | | |
387 | 368 | | |
| |||
0 commit comments