Skip to content

fix: improve telemetry error classification, warehouse validation, and webfetch error context#566

Merged
anandgupta42 merged 1 commit intomainfrom
fix/telemetry-error-classification-v2
Mar 29, 2026
Merged

fix: improve telemetry error classification, warehouse validation, and webfetch error context#566
anandgupta42 merged 1 commit intomainfrom
fix/telemetry-error-classification-v2

Conversation

@anandgupta42
Copy link
Copy Markdown
Contributor

Summary

Driven by App Insights analysis of altimate-code-os showing ~900 daily events with poor or missing error classification:

  • Eliminate blind "unknown error" in telemetry — 89 core_failure events/day had no error message. Now produces soft_failure:{tool}:no_error_metadata with key-aware object masking via Telemetry.maskArgs()
  • Add http_error classification — 694 webfetch 404s were classified as "unknown", now properly bucketed as http_error
  • Fix SASL/SCRAM password errors — 41 SQL failures/day from non-string passwords. Added type validation in postgres, redshift drivers and registry-level PASSWORD_DRIVERS gate
  • Improve webfetch error context — HTTP errors now include the target hostname for easier triage
  • Add friendly errors for unsupported databases — ClickHouse, Cassandra, CockroachDB, TimescaleDB get actionable hints instead of generic "unsupported" message
  • Redact sensitive keys in input_signature — passwords, tokens, api_keys now show "****" instead of leaking string lengths
  • Harden statement_timeout — uses Number.isFinite() guard instead of string interpolation

Files changed (7)

File Change
src/altimate/telemetry/index.ts New http_error error_class, expanded classification patterns, sensitive key redaction in computeInputSignature()
src/tool/tool.ts Structured soft-failure fallback, maskArgs() for object errors, circular-object safety
src/tool/webfetch.ts Domain hostname in HTTP error messages with safe URL-parse fallback
packages/drivers/src/postgres.ts Password type validation, statement_timeout hardening
packages/drivers/src/redshift.ts Password type validation
src/altimate/native/connections/registry.ts PASSWORD_DRIVERS validation, KNOWN_UNSUPPORTED map with workaround hints
test/telemetry/telemetry.test.ts 20+ new assertions for http_error, expanded patterns, priority ordering

Test plan

  • telemetry.test.ts — 90 tests pass (20+ new assertions)
  • webfetch.test.ts — 8 tests pass
  • warehouse-telemetry.test.ts — 45 tests pass
  • tool-error-propagation-complete.test.ts — 90 tests pass
  • Typecheck passes (turbo typecheck)

🤖 Generated with Claude Code

…d webfetch error context

Driven by App Insights analysis of `altimate-code-os` showing:
- 89 `core_failure` events/day with blind `"unknown error"` message
- 694 webfetch 404s classified as `error_class: "unknown"`
- 41 SQL failures from cryptic SASL/SCRAM password errors
- 4 ClickHouse attempts hitting generic "unsupported" error

**Telemetry** — add `http_error` class, expand connection/validation/permission
patterns, redact sensitive keys in `computeInputSignature()`

**Tool errors** — replace `"unknown error"` with structured
`soft_failure:{tool}:no_error_metadata`, use `maskArgs()` for objects

**Warehouse** — validate password type in postgres/redshift drivers and
registry, harden `statement_timeout`, add `KNOWN_UNSUPPORTED` hints

**Webfetch** — include hostname in HTTP error messages

**Tests** — 20+ new `classifyError` assertions including `http_error`,
expanded patterns, and priority ordering tests

Co-Authored-By: Claude Opus 4.6 (1M context) <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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

Warning

Rate limit exceeded

@anandgupta42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 59 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 15 minutes and 59 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e750e288-0b19-4a82-9ae5-b7c04ef29eaf

📥 Commits

Reviewing files that changed from the base of the PR and between 0226200 and f7f3d8f.

📒 Files selected for processing (7)
  • packages/drivers/src/postgres.ts
  • packages/drivers/src/redshift.ts
  • packages/opencode/src/altimate/native/connections/registry.ts
  • packages/opencode/src/altimate/telemetry/index.ts
  • packages/opencode/src/tool/tool.ts
  • packages/opencode/src/tool/webfetch.ts
  • packages/opencode/test/telemetry/telemetry.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/telemetry-error-classification-v2

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.

@anandgupta42 anandgupta42 merged commit ffe03b4 into main Mar 29, 2026
12 checks passed
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