Skip to content

fix(cli): generate new session ID in multiclaude claude when no history#334

Open
aronchick wants to merge 1 commit intodlorenc:mainfrom
aronchick:work/happy-bear
Open

fix(cli): generate new session ID in multiclaude claude when no history#334
aronchick wants to merge 1 commit intodlorenc:mainfrom
aronchick:work/happy-bear

Conversation

@aronchick
Copy link
Contributor

Summary

  • Fixes "Session ID is already in use" error when running multiclaude claude
  • When no session history exists, generates a new session ID instead of reusing the old one
  • Adds missing trigger_refresh socket command documentation (fixes pre-commit check)

Problem

When running multiclaude claude and Claude had previously exited abnormally (or the session was never used), the command would fail with:

Error: Session ID 4dc74532-623a-4cd3-805c-bd5cbb8c5238 is already in use. 

This happened because the code reused the old session ID even when there was no session history to resume.

Solution

When hasHistory is false (no session file or empty), generate a new UUID for the session ID and update the agent state before starting Claude.

Test plan

  • go build ./cmd/multiclaude - builds successfully
  • go test ./... - all tests pass
  • make pre-commit - all checks pass

🤖 Generated with Claude Code

…tory When running `multiclaude claude` and no session history exists, the command now generates a new session ID instead of reusing the old one. This fixes "Session ID is already in use" errors that occur when Claude exits abnormally and leaves the session ID locked. Also adds missing trigger_refresh socket command documentation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aronchick
Copy link
Contributor Author

Merge Queue: READY TO MERGE

  • CI: All 6 checks passing
  • Merge status: MERGEABLE/CLEAN
  • Reviews: None blocking

This PR is ready for maintainer merge.

@aronchick aronchick marked this pull request as ready for review January 31, 2026 21:27
whitmo added a commit to whitmo/multiclaude that referenced this pull request Feb 28, 2026
whitmo added a commit to whitmo/multiclaude that referenced this pull request Feb 28, 2026
…nc#336, dlorenc#340, dlorenc#342 Add 659 lines of tests covering: - All 18 structured error constructors from PR dlorenc#340 (individual + bulk format test) - JSON CLI output edge cases from PR dlorenc#335 (empty/nested/all-internal subcommands) - Structured CLIError validation for workspace names from PR dlorenc#340 integration - Message routing edge cases from PR dlorenc#342 (no acked, mixed ack status) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
whitmo added a commit to whitmo/multiclaude that referenced this pull request Mar 1, 2026
Review findings for session ID fix (PR dlorenc#334) and error messages + process detection (PR dlorenc#336) from dlorenc/multiclaude. Both LGTM. One actionable finding: PR dlorenc#336 should handle EPERM from signal(0) to avoid starting duplicate instances. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
whitmo added a commit to whitmo/multiclaude that referenced this pull request Mar 1, 2026
whitmo added a commit to whitmo/multiclaude that referenced this pull request Mar 1, 2026
…nc#336, dlorenc#340, dlorenc#342 Add 659 lines of tests covering: - All 18 structured error constructors from PR dlorenc#340 (individual + bulk format test) - JSON CLI output edge cases from PR dlorenc#335 (empty/nested/all-internal subcommands) - Structured CLIError validation for workspace names from PR dlorenc#340 integration - Message routing edge cases from PR dlorenc#342 (no acked, mixed ack status) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant