Skip to content

fix: replace claude CLI with curl for OpenRouter release notes#15

Merged
zzgosh merged 1 commit intomainfrom
fix/release-notes-curl
Mar 19, 2026
Merged

fix: replace claude CLI with curl for OpenRouter release notes#15
zzgosh merged 1 commit intomainfrom
fix/release-notes-curl

Conversation

@zzgosh
Copy link
Copy Markdown
Owner

@zzgosh zzgosh commented Mar 19, 2026

Problem

The Generate release notes with Claude step in release.yml always fell back to the default placeholder message instead of producing Claude-generated notes. The step completed in ~1 second — far too fast for a real API call — indicating the claude CLI was failing silently due to || true.

Root causes:

  • The claude CLI (Anthropic's Code CLI) is unreliable when proxied through OpenRouter via ANTHROPIC_BASE_URL
  • || true suppressed all errors with no diagnostic output
  • Model ID anthropic/claude-sonnet-4.6 used . instead of OpenRouter's expected - separator

Fix

Replaced the claude CLI call with a direct curl request to OpenRouter's Anthropic-compatible Messages API (/v1/messages).

Changes:

  • Remove Install Claude Code CLI step (no longer needed)
  • Call OpenRouter API directly via curl
  • Use jq to safely encode the prompt as JSON (handles newlines and special chars)
  • Capture and log curl stderr on failure for diagnostics
  • Fix model ID: anthropic/claude-sonnet-4.6anthropic/claude-sonnet-4-6
  • Rename env var to OPENROUTER_API_KEY for clarity

Test plan

  • Trigger Release workflow on next version bump and verify the GitHub Release contains Claude-generated notes
  • If the API call fails, confirm the error is visible in the Actions log (not silently swallowed)

…tion

The claude CLI failed silently (exit in ~1s) when proxied through
OpenRouter via ANTHROPIC_BASE_URL, causing release notes to always
fall back to the default placeholder message.

Replaced with a direct curl call to OpenRouter's Messages API, which
is more reliable and provides visible error output on failure.

Also fixes the model ID (4.6 → 4-6) and uses jq for safe JSON encoding.
@zzgosh zzgosh merged commit 60042bf into main Mar 19, 2026
3 checks passed
@zzgosh zzgosh deleted the fix/release-notes-curl branch March 19, 2026 07:03
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