Codex/persist claude conversation context#208
Conversation
Replace sequential await loops with Promise.allSettled for: - readDirectory: stat all directory entries in parallel - applyMentionReferencesStage: read @mentioned files in parallel - applyAttachmentFilesStage: read drag-dropped attachments in parallel Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| const value = char === 'x' ? rand : (rand & 0x3) | 0x8 | ||
| return value.toString(16) | ||
| }) | ||
| } |
There was a problem hiding this comment.
Duplicated createConversationId function across two files
Low Severity
The createConversationId function is identically duplicated in ChatPanelWrapper.tsx and agents.ts. The agents.ts copy is used internally for normalization/fallback, and the ChatPanelWrapper.tsx copy is used at session creation. Having two copies means any future fix or change (e.g., switching to v7 UUIDs) needs to be applied in both places, risking divergence.
Additional Locations (1)
| const CLAUDE_SESSION_STDERR_MAX_CHARS = 4_000 | ||
| const CLAUDE_AVAILABILITY_TIMEOUT_MS = 5_000 | ||
| const CLAUDE_AVAILABILITY_CACHE_TTL_MS = 30_000 | ||
| const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i |
There was a problem hiding this comment.
UUID version regex mismatch between main and renderer
Low Severity
UUID_PATTERN in claude-session.ts accepts UUID versions 1–5 ([1-5]), while isConversationId in agents.ts only accepts version 4 (4). Both createConversationId implementations generate v4 UUIDs, so this doesn't break today, but the inconsistency means the two layers disagree on what constitutes a valid conversation ID. A UUID that the main process considers valid could be rejected and silently replaced by the renderer on the next persist cycle.
Additional Locations (1)
|
Bugbot Autofix prepared fixes for both issues found in the latest run.
|


Summary
Validation
pnpm lintpnpm lint:webpnpm typecheckpnpm buildpnpm -C web buildScreenshots / Recordings (if UI changed)
Checklist
CHANGELOG.md(Unreleased) where appropriateNote
Medium Risk
Touches the Claude session-start IPC/CLI argument wiring and introduces persisted identifiers, so regressions could break starting sessions or context continuity; changes are otherwise straightforward and guarded by validation.
Overview
Adds a persistent
claudeConversationIdto each chat tab, generating/storing it in the agent store (and localStorage) and sending it withclaude:startso the main process passes--session-idto the Claude CLI.Hardens
claude:startinput validation by requiring any providedconversationIdto be a UUID, and updates sharedClaudeSessionOptionstypes accordingly. Separately parallelizes best-effort filesystem stat/read operations (directory listing, referenced files, and attachments) viaPromise.allSettledto reduce latency and avoid single-file failures blocking the whole step.Written by Cursor Bugbot for commit 579ac7b. This will update automatically on new commits. Configure here.