fix: fall back to ccr code when claude CLI is unavailable #12027
fix: fall back to ccr code when claude CLI is unavailable #12027gomesalexandre merged 3 commits intodevelopfrom
Conversation
📝 WalkthroughWalkthroughReplaces the hard-coded Claude invocation in Changes
Sequence Diagram(s)sequenceDiagram
participant Release as Release script
participant FS as Prompt file
participant Claude as claude (binary)
participant CCR as ccr (fallback)
Release->>FS: read promptPath
Release->>Claude: spawnClaude('claude', CLAUDE_ARGS, promptPath)
alt Claude succeeds
Claude-->>Release: stdout (release summary)
else Claude fails / times out
Release->>Release: isCcrAvailable? (checks via `which ccr`)
alt ccr available
Release->>CCR: spawnClaude('ccr', ['code', ...CLAUDE_ARGS], promptPath)
CCR-->>Release: stdout (release summary) / stderr aggregated
else ccr unavailable
Release-->>Release: return enhanced timeout/exit error with stderr/stdout
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/release.ts`:
- Line 242: The spawn invocation in generateReleaseSummary passes an invalid
Claude CLI flag '--no-conversation' which causes the Claude process to fail;
remove '--no-conversation' from the arguments (or replace it with the supported
'--no-session-persistence' if the goal is to avoid saving the session) in the
spawn call that creates the child process (the line using spawn('claude', ['-p',
'--model', 'opus', '--max-turns', '1', ...])) so the Claude CLI runs with only
valid flags.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
scripts/release.ts
132b4af to
c6f263b
Compare
d087d89 to
407c115
Compare
When the claude CLI isn't authenticated (e.g. user has no Claude subscription and uses an API key via claude-code-router), the release script now falls back to `ccr code` for summary generation. - Refactor spawn logic into shared `spawnClaude` helper - Check if `ccr` is on PATH and prefer it when available - Improve error output to capture both stdout and stderr Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
407c115 to
01cec10
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/release.ts`:
- Around line 287-305: The isCcrAvailable() pre-check is unreliable; in
runClaude (which calls spawnClaude and uses CLAUDE_ARGS) remove the awaits to
isCcrAvailable() in the catch block and instead always attempt the fallback
spawnClaude('ccr', ['code', ...CLAUDE_ARGS], promptPath) after logging the CLI
failure, and delete or stop referencing isCcrAvailable() (and its spawn('which',
...) logic) so the code directly tries the ccr executable rather than depending
on the which check.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
scripts/release.ts
gomesalexandre
left a comment
There was a problem hiding this comment.
lgtm code-wise, will test when there are commits to release!

Description
tl;dr: for people like me who use Claude Code via Claude Code Router
When the
claudeCLI isn't authenticated (e.g. user has no Claude subscription and uses an API key viaclaude-code-router), the release script's summary generation fails and falls back to the raw commit list.This PR adds
ccr codeas a fallback for summary generation:spawnClaudehelperclaudeCLI first (default); if it fails andccris on PATH, falls back toccr codeIssue (if applicable)
N/A
Risk
Zero risk. This only affects how Claude is invoked during release summary generation - no on-chain transactions, wallets, or protocol interactions are affected.
Testing
Engineering
Run the release script with and without a Claude subscription:
claudeCLI directlyccrinstalled:claudefails, falls back toccr codeOperations
Not user-facing - internal tooling change only.
Screenshots (if applicable)
N/A
Summary by CodeRabbit