Skip to content

fix: log errors in GitHub workflow connection retry loop#663

Open
dev-punia-altimate wants to merge 1 commit intomainfrom
proposal/github-retry-silent-catch
Open

fix: log errors in GitHub workflow connection retry loop#663
dev-punia-altimate wants to merge 1 commit intomainfrom
proposal/github-retry-silent-catch

Conversation

@dev-punia-altimate
Copy link
Copy Markdown

@dev-punia-altimate dev-punia-altimate commented Apr 8, 2026

Proposal

Repo: altimate-code
Category: silent-catch
Severity: high
Files: github/index.ts

What I Found

In assertOpencodeConnected() (line 284), the retry loop attempts to connect to the Altimate Code server up to 30 times with a 300ms delay, but the catch (e) {} block silently swallows all errors. This means:

  • Network failures, authentication errors, and server errors are all indistinguishable
  • Debugging connection issues in GitHub Actions workflows requires adding temporary logging
  • When the retry loop eventually throws "Failed to connect to Altimate Code server", there's zero context about what went wrong

Fix

Added console.warn() inside the catch block to log the retry attempt number and error message. The retry logic is preserved unchanged — this only adds visibility into failures.


Auto-generated by QA Autopilot Proposal Monitor. Open for 30-day human review.


Summary by cubic

Add warning logs in assertOpencodeConnected() so connection retries in GitHub workflows show error context instead of silently failing. Retry behavior is unchanged; each failed attempt now logs retry N/30 and the error message.

Written for commit 12c78f6. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Enhanced connection error logging with attempt details to provide clearer diagnostics when troubleshooting connection issues.

Category: silent-catch
Severity: high
Repo: altimate-code
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

The assertOpencodeConnected() function in github/index.ts now logs details of each failed connection attempt during its retry loop, replacing a silent catch block with console warnings that include attempt count and error information.

Changes

Cohort / File(s) Summary
Connection Retry Logging
github/index.ts
Enhanced error handling in assertOpencodeConnected() to log failed connection attempts with attempt count and error details instead of silently catching exceptions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐰 A whisper in the retry loop so deep,
Now echoes when connections fail to keep,
With warnings logged and attempt counts shown,
No silent errors shall go unknown!
The server talks, and we listen close,
Debugging's now what the logs emboss. 🔍

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is largely complete with problem analysis and solution details, but it does not follow the required template structure (missing the mandatory 'PINEAPPLE' marker for AI-generated content, and lacks proper Test Plan and Checklist sections). Restructure the description to match the template: add 'PINEAPPLE' at the top, include a concise Summary section, add a Test Plan section explaining how the changes were tested, and include the Checklist with relevant items marked.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding error logging to the GitHub workflow connection retry loop.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch proposal/github-retry-silent-catch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
github/index.ts (1)

284-286: Good improvement - adds visibility to silent retry failures.

The logging provides helpful debugging context. One minor optional improvement: consider using 1-based indexing (retry + 1) for the attempt number in logs, as operators may find "attempt 1/30" more intuitive than "retry 0/30":

💡 Optional: Use 1-based attempt numbering
     } catch (e) {
-      console.warn(`[assertOpencodeConnected] retry ${retry}/30 failed:`, e instanceof Error ? e.message : e)
+      console.warn(`[assertOpencodeConnected] attempt ${retry + 1}/30 failed:`, e instanceof Error ? e.message : e)
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@github/index.ts` around lines 284 - 286, The log inside the catch block of
assertOpencodeConnected currently prints the retry variable (0-based), update
the message to display 1-based attempt numbering by using (retry + 1) so logs
read "attempt 1/30" instead of "retry 0/30"; locate the catch in github/index.ts
where the warn is emitted (the line with console.warn(`[assertOpencodeConnected]
retry ${retry}/30 failed:`...)) and change the formatted attempt count to use
retry + 1 while keeping the rest of the message and error handling intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@github/index.ts`:
- Around line 284-286: The log inside the catch block of assertOpencodeConnected
currently prints the retry variable (0-based), update the message to display
1-based attempt numbering by using (retry + 1) so logs read "attempt 1/30"
instead of "retry 0/30"; locate the catch in github/index.ts where the warn is
emitted (the line with console.warn(`[assertOpencodeConnected] retry ${retry}/30
failed:`...)) and change the formatted attempt count to use retry + 1 while
keeping the rest of the message and error handling intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3327e55b-6025-4339-8ec1-8a9529d35d46

📥 Commits

Reviewing files that changed from the base of the PR and between b66d9f5 and 12c78f6.

📒 Files selected for processing (1)
  • github/index.ts

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="github/index.ts">

<violation number="1" location="github/index.ts:285">
P2: Retry warning counter is off-by-one versus loop behavior, producing misleading attempt telemetry.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

break
} catch (e) {}
} catch (e) {
console.warn(`[assertOpencodeConnected] retry ${retry}/30 failed:`, e instanceof Error ? e.message : e)
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Apr 8, 2026

Choose a reason for hiding this comment

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

P2: Retry warning counter is off-by-one versus loop behavior, producing misleading attempt telemetry.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At github/index.ts, line 285:

<comment>Retry warning counter is off-by-one versus loop behavior, producing misleading attempt telemetry.</comment>

<file context>
@@ -281,7 +281,9 @@ async function assertOpencodeConnected() {
       break
-    } catch (e) {}
+    } catch (e) {
+      console.warn(`[assertOpencodeConnected] retry ${retry}/30 failed:`, e instanceof Error ? e.message : e)
+    }
     await sleep(300)
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant