Skip to content

Commit a63c5e8

Browse files
mthsmbclaude
andcommitted
feat: choose how much agent session history to import
Session import used fixed limits: a 30-day window, 100 conversations per project per run, 100,000 records per conversation, 200 messages per thread, and 64 MiB of scan metadata per source. Users with longer histories or very long sessions had no way to bring more in (discussion #27165, issue #31677). A new environment setting, agentSessionImport, carries these limits with the current values as defaults, so behavior is unchanged until someone changes it. The time window and message cap accept null for all history and full history, and the contract enforces upper bounds. The scanner reads the setting on every scan and import for Claude Code, Codex and Pi, scales its metadata operation and record budgets with the byte budget, and recollects cached candidates when the scan budget changes. Pi records kept only for their tree links now count toward the fixed 32 MiB history budget, so a raised record limit stays memory-bounded. The welcome wizard's default selection follows a shorter time window so it never preselects a project with nothing to import. Settings → Threads → Session import shows one row per limit with reset, a warning when limits are raised, organization-lock support, and a notice for servers that predate the setting. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 6577c6b commit a63c5e8

13 files changed

Lines changed: 992 additions & 92 deletions

File tree

‎apps/server/src/environment/ServerEnvironment.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ export const make = Effect.gen(function* () {
233233
threadAutoSettlement: true,
234234
storageCleanup: true,
235235
storageCleanupRun: true,
236+
agentSessionImportSettings: true,
236237
databaseStorage: true,
237238
otlpEndpointCheck: true,
238239
projectWorktreeCleanup: true,

0 commit comments

Comments
 (0)