Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

Merge remote-tracking branch 'origin/main' into fix/subagent-and-turns

ogsamrata06b2eef2c4e
diff --cc apps/server/src/session-upload-observer.ts
index f0862afd,f63d3d94..25bbc9e8
--- a/apps/server/src/session-upload-observer.ts
+++ b/apps/server/src/session-upload-observer.ts
@@@ -8,8 -8,9 +8,9 @@@
* named by plain data (EngineTarget) so the target can cross threads.
*/
import { loopbackFetch } from "./server-fetch.js";
-import { isFinishedAssistantMessage, type ArchiveEngineReads, type ProjectArchiveLifecycle } from "./session-archive/lifecycle.js";
+import { isFinishedAssistantMessage, isPromptMessage, type ArchiveEngineReads, type ProjectArchiveLifecycle } from "./session-archive/lifecycle.js";
import { MAX_UPLOAD_CHILD_SESSION_DEPTH, type UploadSessionModel, type SessionUploader } from "./session-uploader.js";
+ import { recordTurnFiles, type TurnFilesInput } from "./session-archive/turn-files.js";
/** The engine a captured request went to: base URL, request headers (the engine's auth), query and API generation. */
export type EngineTarget = {
@@@ -900,9 -857,9 +907,11 @@@ export function observeUploadedSession(
}
}
room(newest.bytes);
- sessionUploader.recordTrace(sessionId, "session.idle", { status });
+ // How the turn ended, so a turn stopped with Esc reads as stopped, not as answered.
+ const outcome = history ? turnOutcome(history.outline) : null;
+ sessionUploader.recordTrace(sessionId, "session.idle", outcome ? { status, outcome } : { status });
+ // The files the turn read, and those outside the workspace it touched, before the snapshot and the flush.
+ if (history && input.turnFiles) await recordTurnFiles({ ...input.turnFiles, sessionId, messages: history.delta, collector: sessionUploader });
// The turn snapshot runs first so the artifacts it discovers are part of
// the trace flushed right behind it.
captureTurnSnapshot();