* Overlay the optimistic mid-stream goal onto an activity snapshot. * * A goal set while the agent is streaming is held as optimistic state in the * goal service until stream-end persistence; goal.json keeps the pre-stream * goal. Activity snapshots built from persisted metadata (status_
(
workspaceId: string,
snapshot: WorkspaceActivitySnapshot | null
)
| 2379 | * pending snapshot before emitting, so they win naturally. |
| 2380 | */ |
| 2381 | private overlayPendingGoal( |
| 2382 | workspaceId: string, |
| 2383 | snapshot: WorkspaceActivitySnapshot | null |
| 2384 | ): WorkspaceActivitySnapshot | null { |
| 2385 | if (!snapshot || snapshot.transientGoalOnly === true) { |
| 2386 | return snapshot; |
| 2387 | } |
| 2388 | const pending = this.workspaceGoalService?.getPendingGoalSnapshot(workspaceId); |
| 2389 | if (!pending) { |
| 2390 | return snapshot; |
| 2391 | } |
| 2392 | return { ...snapshot, goal: pending }; |
| 2393 | } |
| 2394 | |
| 2395 | private async emitWorkspaceActivityUpdate( |
| 2396 | workspaceId: string, |
no test coverage detected