Skip to content

Codex/persist claude conversation context#208

Closed
charlesrhoward wants to merge 2 commits intomainfrom
codex/persist-claude-conversation-context
Closed

Codex/persist claude conversation context#208
charlesrhoward wants to merge 2 commits intomainfrom
codex/persist-claude-conversation-context

Conversation

@charlesrhoward
Copy link
Contributor

@charlesrhoward charlesrhoward commented Feb 26, 2026

Summary

  • What changed
  • Why it changed

Validation

  • pnpm lint
  • pnpm lint:web
  • pnpm typecheck
  • pnpm build
  • pnpm -C web build
  • Additional manual testing (describe below)

Screenshots / Recordings (if UI changed)

Checklist

  • Linked issue(s) where applicable
  • Updated docs for behavior changes
  • Updated CHANGELOG.md (Unreleased) where appropriate

Note

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 claudeConversationId to each chat tab, generating/storing it in the agent store (and localStorage) and sending it with claude:start so the main process passes --session-id to the Claude CLI.

Hardens claude:start input validation by requiring any provided conversationId to be a UUID, and updates shared ClaudeSessionOptions types accordingly. Separately parallelizes best-effort filesystem stat/read operations (directory listing, referenced files, and attachments) via Promise.allSettled to 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.

charlesrhoward and others added 2 commits February 23, 2026 17:06
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>
@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-space-web Building Building Preview, Comment Feb 26, 2026 1:21am

Request Review

@charlesrhoward charlesrhoward enabled auto-merge (squash) February 26, 2026 01:22
auto-merge was automatically disabled February 26, 2026 01:26

Pull request was closed

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issues.

const value = char === 'x' ? rand : (rand & 0x3) | 0x8
return value.toString(16)
})
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

@cursor
Copy link

cursor bot commented Feb 26, 2026

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Duplicated createConversationId function across two files
    • Removed the duplicate createConversationId from ChatPanelWrapper and reused the exported store implementation as the single source of truth.
  • ✅ Fixed: UUID version regex mismatch between main and renderer
    • Updated renderer-side conversation ID validation to accept UUID versions 1–5 so it now matches main-process validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant