Problem
In the local external-conversation import wizard, changing the time-range preset (for example, from 30 days to 7 days) replaces the conversation list with a loading state and scans the provider history again.
Once the initial scan has completed, switching among 7 days, 30 days, 90 days, and All should be immediate and should not require another reload.
Steps to Reproduce
- Open the external conversation history import wizard.
- Select local Codex and/or Claude Code history and run the initial scan.
- On the conversation selection step, switch from 30 days to 7 days.
- Switch to another preset, then back to a previously viewed preset.
Current Behavior
Every range change calls the scan endpoint again and temporarily removes the current results:
ExternalAgentSessionImportWizard.handleSelectRange always calls runScan(nextDays, archivePath).
runScan dispatches scan-started, sets loading, and the UI replaces the select step with the full loading state.
externalImportScanStateReducer clears the completed scan for every scan-started action.
- The scan state stores only one
{ response, source }, and externalImportScanSourcesEqual treats days as part of the source identity, so a result cannot be reused for another range or even when returning to an earlier range.
The repeated daemon work is especially wasteful for local providers. scanExternalProviderSessions enumerates the provider JSONL files and parses each transcript before applying the UpdatedAtUnixMS cutoff. A narrower day window therefore still repeats most of the expensive filesystem and parsing work.
Desired Behavior
After one initial local-history scan:
- Switching among all supported range presets is an in-memory projection and does not call
scanWorkspaceExternalAgentSessionImports again.
- The list remains visible; no full-screen loading state or disabled dialog is shown during a range switch.
- Project groups, conversation counts, message counts, and selection counts update to match the active range.
- Search text, project-registration preference, and explicit session deselections remain stable while changing ranges.
A reasonable implementation is to retain a reusable all-history summary/catalog and derive each range from lastUpdatedAtUnixMs. An equivalent indexed/cache design is acceptable if every preset is available immediately after the initial scan and does not make initial loading materially worse.
Archive imports are out of scope because the current UI does not show range controls in archive mode.
Acceptance Criteria
Code Pointers
apps/desktop/src/renderer/src/features/workspace-workbench/ui/ExternalAgentSessionImportWizard.tsx
apps/desktop/src/renderer/src/features/workspace-workbench/ui/externalAgentSessionImportWizardModel.ts
services/tuttid/service/agent/external_import.go
POST /v1/workspaces/{workspaceID}/agent-sessions/external-imports/scan
Environment
- Surface: Desktop external conversation history import wizard
- Sources: local Codex / Claude Code history
- Current project checkout inspected:
cfc997347ff4
Problem
In the local external-conversation import wizard, changing the time-range preset (for example, from 30 days to 7 days) replaces the conversation list with a loading state and scans the provider history again.
Once the initial scan has completed, switching among 7 days, 30 days, 90 days, and All should be immediate and should not require another reload.
Steps to Reproduce
Current Behavior
Every range change calls the scan endpoint again and temporarily removes the current results:
ExternalAgentSessionImportWizard.handleSelectRangealways callsrunScan(nextDays, archivePath).runScandispatchesscan-started, setsloading, and the UI replaces the select step with the full loading state.externalImportScanStateReducerclears the completed scan for everyscan-startedaction.{ response, source }, andexternalImportScanSourcesEqualtreatsdaysas part of the source identity, so a result cannot be reused for another range or even when returning to an earlier range.The repeated daemon work is especially wasteful for local providers.
scanExternalProviderSessionsenumerates the provider JSONL files and parses each transcript before applying theUpdatedAtUnixMScutoff. A narrower day window therefore still repeats most of the expensive filesystem and parsing work.Desired Behavior
After one initial local-history scan:
scanWorkspaceExternalAgentSessionImportsagain.A reasonable implementation is to retain a reusable all-history summary/catalog and derive each range from
lastUpdatedAtUnixMs. An equivalent indexed/cache design is acceptable if every preset is available immediately after the initial scan and does not make initial loading materially worse.Archive imports are out of scope because the current UI does not show range controls in archive mode.
Acceptance Criteria
Code Pointers
apps/desktop/src/renderer/src/features/workspace-workbench/ui/ExternalAgentSessionImportWizard.tsxapps/desktop/src/renderer/src/features/workspace-workbench/ui/externalAgentSessionImportWizardModel.tsservices/tuttid/service/agent/external_import.goPOST /v1/workspaces/{workspaceID}/agent-sessions/external-imports/scanEnvironment
cfc997347ff4