summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-13 13:40:59 +0300
committerPaul Buetow <paul@buetow.org>2025-07-13 13:40:59 +0300
commit79225d4df3a181f08a2160ff8ec361001b9dea18 (patch)
tree9d4796f7d4a2638d96342f7d2550f9502fc756ff
parent64ccb736a2ca134157af450dc5a300ab87db358d (diff)
fix: improve claude CLI error handling workflowv0.6.2
- Remove debug script generation for cleaner error handling - Continue processing next releases when claude CLI fails - Simplify error detection for "Execution error" responses - Cache is automatically cleared on failures - Bump version to 0.6.2 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
-rw-r--r--internal/release/release.go23
-rw-r--r--internal/version/version.go2
2 files changed, 2 insertions, 23 deletions
diff --git a/internal/release/release.go b/internal/release/release.go
index e56e3cb..c4ef37a 100644
--- a/internal/release/release.go
+++ b/internal/release/release.go
@@ -344,6 +344,7 @@ func (m *Manager) GenerateAIReleaseNotes(repoPath, repoName, tag string, allTags
cmd := exec.Command("claude", "--model", "sonnet", prompt.String())
cmd.Env = append(os.Environ(), "CLAUDE_DEBUG=1") // Enable debug mode if supported
+
output, err := cmd.CombinedOutput() // Use CombinedOutput to capture stderr
if err != nil {
// Check if it's an exit error and print the output
@@ -375,28 +376,6 @@ func (m *Manager) GenerateAIReleaseNotes(repoPath, repoName, tag string, allTags
// Check for known error messages in the output
if releaseNotes == "Execution error" || strings.HasPrefix(releaseNotes, "Error:") {
- // Try to provide more context about the error
- fmt.Println(" Claude CLI error details:")
- fmt.Printf(" - Output: %s\n", releaseNotes)
- fmt.Printf(" - Prompt length: %d characters\n", len(prompt.String()))
- fmt.Println(" - Possible causes:")
- fmt.Println(" 1. Authentication issue - try: claude auth login")
- fmt.Println(" 2. Rate limiting - wait a few minutes")
- fmt.Println(" 3. Network connectivity issue")
- fmt.Println(" 4. Prompt too long (max ~200k tokens)")
- fmt.Println(" 5. Invalid model name (valid: opus, sonnet, haiku)")
-
- // Try running a simple test command to diagnose
- testCmd := exec.Command("claude", "--model", "sonnet", "Say 'test'")
- if testOutput, testErr := testCmd.CombinedOutput(); testErr != nil {
- fmt.Printf(" - Test command failed: %v\n", testErr)
- if len(testOutput) > 0 {
- fmt.Printf(" - Test output: %s\n", strings.TrimSpace(string(testOutput)))
- }
- } else {
- fmt.Printf(" - Test command succeeded: %s\n", strings.TrimSpace(string(testOutput)))
- }
-
return "", fmt.Errorf("claude CLI returned an error: %s", releaseNotes)
}
diff --git a/internal/version/version.go b/internal/version/version.go
index 636bf04..9074d60 100644
--- a/internal/version/version.go
+++ b/internal/version/version.go
@@ -7,7 +7,7 @@ import (
var (
// Version is the current version of gitsyncer
- Version = "0.6.1"
+ Version = "0.6.2"
// GitCommit is the git commit hash at build time
GitCommit = "unknown"