Repository navigation
fix(server,web): session import reports deferred conversations apart from failures #38577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
83d48a1
27ff3da
962a0d7
dd04110
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,7 +228,8 @@ export type AgentSessionRecentThread = | |
| } | ||
| | { readonly _tag: "AlreadyImported"; readonly source: AgentSessionImportSource } | ||
| | { readonly _tag: "Duplicate"; readonly source: AgentSessionImportSource } | ||
| | { readonly _tag: "Skipped" }; | ||
| | { readonly _tag: "Skipped" } | ||
| | { readonly _tag: "Deferred" }; | ||
|
|
||
| export class AgentSessionScanner extends Context.Service< | ||
| AgentSessionScanner, | ||
|
|
@@ -2184,7 +2185,7 @@ export const make = Effect.gen(function* () { | |
| `${candidate.providerInstanceId}\0${transcript.filePath}`, | ||
| ); | ||
| if (completed === undefined && (transcriptsRemaining === 0 || bytesRemaining === 0)) { | ||
| return Option.some<AgentSessionRecentThread>({ _tag: "Skipped" }); | ||
| return Option.some<AgentSessionRecentThread>({ _tag: "Deferred" }); | ||
| } | ||
| const stats = yield* statOption(transcript.filePath); | ||
| if (Option.isNone(stats) || stats.value.type !== "File") { | ||
|
|
@@ -2204,13 +2205,12 @@ export const make = Effect.gen(function* () { | |
| source: completedSource, | ||
| }); | ||
| } | ||
| if ( | ||
| transcriptsRemaining === 0 || | ||
| identity.size > MAX_IMPORTED_TRANSCRIPT_BYTES || | ||
| identity.size > bytesRemaining | ||
| ) { | ||
| if (identity.size > MAX_IMPORTED_TRANSCRIPT_BYTES) { | ||
| return Option.some<AgentSessionRecentThread>({ _tag: "Skipped" }); | ||
| } | ||
| if (transcriptsRemaining === 0 || identity.size > bytesRemaining) { | ||
| return Option.some<AgentSessionRecentThread>({ _tag: "Deferred" }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stop promising continuation when a retry cannot reach the deferred conversations. A Codex transcript without a Make the continuation guidance depend on a retry being able to advance past the budget. Alternatively, persist scan progress so a later attempt starts after the already-charged candidates. Keep the read limit and the existing continuation path when the first batch imports successfully.
|
||
| } | ||
| transcriptsRemaining -= 1; | ||
| bytesRemaining -= identity.size; | ||
| const snapshot = yield* readTranscript(transcript.filePath, identity, candidate.source); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not count unexamined files as deferred threads.
If 100 newer transcripts exhaust the count budget, a later Claude file that contains a cwd but no conversation is reported as
Deferred. With budget available, the parser returns"empty"and the scanner emits no thread outcome. The importer therefore counts such files as deferred threads and tells users to retry imports that cannot produce those threads.Distinguish unexamined files from known conversations in the result and warning, while keeping transcript reads within the budget.