fix: log errors in VSCode extension connection retry loop#664
fix: log errors in VSCode extension connection retry loop#664dev-punia-altimate wants to merge 1 commit intomainfrom
Conversation
Category: silent-catch Severity: high Repo: altimate-code
There was a problem hiding this comment.
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.
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
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. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
📝 WalkthroughWalkthroughThe extension's terminal startup connection retry loop now captures and reports failures for each Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (1)
sdks/vscode/src/extension.ts (1)
81-83: Good fix for silent retries; consider preserving full error context and removing magic-number attempt math.This is a solid visibility improvement. As a small refinement, logging the full error object (not only
message) keeps stack/cause details, and computingattemptexplicitly is easier to maintain.Suggested tweak
- } catch (e) { - console.warn(`[opencode-vscode] connection attempt ${11 - tries}/10 failed:`, e instanceof Error ? e.message : e) - } + } catch (e) { + const attempt = 10 - tries + 1 + console.warn(`[opencode-vscode] connection attempt ${attempt}/10 failed`, e) + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sdks/vscode/src/extension.ts` around lines 81 - 83, Replace the terse catch logging that prints only the error message and a magic-number attempt calc; compute an explicit attempt counter (e.g., const totalAttempts = 10; const attempt = totalAttempts - tries + 1) and log that, and pass the full error object to the logger instead of e instanceof Error ? e.message : e so stack/cause info is preserved (update the catch block that references tries and the console.warn/console.warn `[opencode-vscode] connection attempt ...` call).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@sdks/vscode/src/extension.ts`:
- Around line 81-83: Replace the terse catch logging that prints only the error
message and a magic-number attempt calc; compute an explicit attempt counter
(e.g., const totalAttempts = 10; const attempt = totalAttempts - tries + 1) and
log that, and pass the full error object to the logger instead of e instanceof
Error ? e.message : e so stack/cause info is preserved (update the catch block
that references tries and the console.warn/console.warn `[opencode-vscode]
connection attempt ...` call).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 85fa9bf7-26d6-4efc-9564-9898eb8f0269
📒 Files selected for processing (1)
sdks/vscode/src/extension.ts
Proposal
Repo: altimate-code
Category: silent-catch
Severity: high
Files:
sdks/vscode/src/extension.tsWhat I Found
In the VSCode extension's
activate()function (line 81), the retry loop that waits for the opencode terminal server to become ready silently swallows all fetch errors withcatch (e) {}. The loop retries 10 times with 200ms delays, but if it fails:console.logto the extension sourceFix
Added
console.warn()inside the catch block to log the attempt number and error message. The retry logic and fallback behavior are preserved unchanged — this only adds visibility into connection failures via the VSCode Output panel.Auto-generated by QA Autopilot Proposal Monitor. Open for 30-day human review.
Summary by cubic
Logs connection errors during the VSCode extension’s startup retry loop so failures are visible in the Output panel. No change to retry behavior; this only adds diagnostics.
console.warninsdks/vscode/src/extension.tsactivate()fetch loop to log attempt number and error when hittinghttp://localhost:${port}/app.Written for commit 954f321. Summary will update on new commits.
Summary by CodeRabbit