Skip to content

proposal: log telemetry initialization failures#662

Open
dev-punia-altimate wants to merge 1 commit intomainfrom
proposal/telemetry-init-error-logging
Open

proposal: log telemetry initialization failures#662
dev-punia-altimate wants to merge 1 commit intomainfrom
proposal/telemetry-init-error-logging

Conversation

@dev-punia-altimate
Copy link
Copy Markdown

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

Proposal

Repo: altimate-code
Category: error-swallowing
Severity: medium
Files: packages/opencode/src/index.ts

What I Found

At CLI startup (line 126), Telemetry.init().catch(() => {}) silently swallows all telemetry initialization failures. This means:

  • If telemetry fails to initialize, no events are captured for the entire session
  • There's no log entry to indicate telemetry is offline — makes it hard to diagnose missing telemetry data
  • The Log utility is already imported and used throughout the file

Fix

Replaced .catch(() => {}) with .catch((e) => Log.Default.warn("Telemetry initialization failed", { error: String(e) })) using the existing Log utility that's already imported in this file.


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


Summary by cubic

Adds a warning log when telemetry initialization fails at CLI startup. Prevents silent loss of events and makes telemetry outages visible.

  • Bug Fixes
    • Replaced Telemetry.init().catch(() => {}) with Telemetry.init().catch((e) => Log.Default.warn("Telemetry initialization failed", { error: String(e) })).

Written for commit 2459d8c. Summary will update on new commits.

Summary by CodeRabbit

  • Bug Fixes
    • Improved error visibility by logging telemetry initialization failures instead of silently ignoring them, enabling better error tracking and diagnosis.

Category: error-swallowing
Severity: medium
Repo: altimate-code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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

Hey! Your PR title proposal: log telemetry initialization failures doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

Telemetry initialization error handling was modified to log warnings instead of silently failing. The catch block now emits a warning message with the error details while maintaining non-fatal error behavior.

Changes

Cohort / File(s) Summary
Telemetry Error Handling
packages/opencode/src/index.ts
Added warning log to telemetry initialization error handler, replacing silent failure with observable error reporting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A whisper in the logs now sings,
Where silence once did dwell,
When telemetry stumbles, warnings ring,
No errors left to swell! 📊✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is comprehensive and covers the problem, impact, and solution; however, it is missing the required template structure including explicit Test Plan and Checklist sections, and does not follow the standard format. Restructure the description to follow the template with clear Summary, Test Plan, and Checklist sections. Verify that testing details are documented in the Test Plan section.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding logging for telemetry initialization failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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/telemetry-init-error-logging

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)
packages/opencode/src/index.ts (1)

285-289: Consider logging shutdown failures for consistency.

The PR improves diagnostics by logging telemetry init failures, but shutdown failures remain silently swallowed. While the comment explains the intent, logging a warning here would maintain consistency and aid in diagnosing telemetry issues without affecting the shutdown flow.

♻️ Suggested change
   try {
     await Telemetry.shutdown()
-  } catch {
+  } catch (e) {
+    Log.Default.warn("Telemetry shutdown failed", { error: String(e) })
     // Telemetry failure must never prevent shutdown
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/opencode/src/index.ts` around lines 285 - 289, The catch block
swallowing errors from Telemetry.shutdown() should capture the thrown error and
log a non-fatal warning for diagnostics; change the empty catch to catch (err)
and emit a warning (e.g., console.warn('Telemetry.shutdown failed:', err)) so
shutdown still continues but failures are recorded; reference
Telemetry.shutdown() and ensure the error is not rethrown.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/opencode/src/index.ts`:
- Around line 285-289: The catch block swallowing errors from
Telemetry.shutdown() should capture the thrown error and log a non-fatal warning
for diagnostics; change the empty catch to catch (err) and emit a warning (e.g.,
console.warn('Telemetry.shutdown failed:', err)) so shutdown still continues but
failures are recorded; reference Telemetry.shutdown() and ensure the error is
not rethrown.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f662074b-7ab2-4295-94f6-a2f5bf10f6ed

📥 Commits

Reviewing files that changed from the base of the PR and between b66d9f5 and 2459d8c.

📒 Files selected for processing (1)
  • packages/opencode/src/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.

No issues found across 1 file

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