Skip to content

fix: isolate claudart claude runs by --session-id - #36

Merged
liitx merged 1 commit into
mainfrom
fix/claude-session-isolation
Jun 24, 2026
Merged

fix: isolate claudart claude runs by --session-id#36
liitx merged 1 commit into
mainfrom
fix/claude-session-isolation

Conversation

@liitx

@liitx liitx commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Config-dir isolation 401'd (OAuth token rotation); replaced with a fresh per-run --session-id that keeps live auth and isolates the session. Surfaced by dogfooding claudart chat. 862 tests green.

…nfig dir

CLAUDE_CONFIG_DIR isolation broke claudart's own auth — the OAuth token rotates
and the live token lives in ~/.claude, so a copied/Keychain credential goes stale
and 401s (surfaced by dogfooding claudart chat). Switch to a fresh per-run
--session-id: keeps the live shared auth, gives each run its own session distinct
from the user's interactive Claude Code session. 862 tests green.
Copilot AI review requested due to automatic review settings June 24, 2026 19:47
@liitx
liitx merged commit 760e314 into main Jun 24, 2026
1 check passed
@liitx
liitx deleted the fix/claude-session-isolation branch June 24, 2026 19:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates claudart’s claude CLI invocation to isolate each background run from the user’s interactive Claude Code session by passing a fresh --session-id, avoiding prior config-dir isolation that could invalidate rotated OAuth credentials.

Changes:

  • Add newClaudeSessionId() helper to generate RFC-4122 v4 UUID session IDs.
  • Pass --session-id <uuid> to the claude subprocess in defaultClaudeRunner.
  • Add unit tests validating UUID format and per-call uniqueness.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/pipeline/claude_session_test.dart Adds unit tests for RFC-4122 v4 formatting and uniqueness of generated session IDs.
lib/pipeline/pipeline_executor.dart Injects a fresh --session-id into the claude CLI arguments to isolate runs.
lib/pipeline/claude_session.dart Introduces UUID v4 generation for claude --session-id.
lib/claudart.dart Exposes newClaudeSessionId via the public barrel export.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants