Skip to content

Conversation

aantn
Copy link
Contributor

@aantn aantn commented Oct 9, 2025

When testing deepseek with SambaNova, I ran into an issue where SambaNova was returning errors. I wanted to troubleshoot it with --trace=braintrust, but couldn't do so because traces are not shown on exceptions from the LLM. This PR fixes that.

@aantn aantn requested a review from arikalon1 October 9, 2025 12:06
@aantn aantn enabled auto-merge (squash) October 9, 2025 12:06
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Walkthrough

Adds error-path traceability in interactive mode: upon exceptions, after logging/printing the error, the code fetches a trace URL from the tracer and, if present, prints a "View trace" link, aligning error handling with the existing success-path trace output. No public API or signature changes.

Changes

Cohort / File(s) Summary
Interactive error trace link
holmes/interactive.py
On exception in interactive mode, retrieves trace URL from tracer and prints a "View trace" link if available; mirrors success-path behavior. No API changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CLI as Interactive CLI
  participant Engine
  participant Tracer

  User->>CLI: Enter command
  CLI->>Engine: Execute
  alt Success
    Engine-->>CLI: Result
    CLI->>Tracer: get_trace_url()
    Tracer-->>CLI: trace URL (optional)
    CLI-->>User: Output result
    opt Trace available
      CLI-->>User: "View trace: <url>"
    end
  else Error
    Engine-->>CLI: Exception
    CLI-->>User: Error message
    CLI->>Tracer: get_trace_url()
    Tracer-->>CLI: trace URL (optional)
    opt Trace available
      CLI-->>User: "View trace: <url>"
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly and accurately conveys the primary change of displaying braintrust traces when exceptions occur, matching the PR’s objective to enhance error debugging.
Description Check ✅ Passed The description directly relates to the changeset by explaining the encountered error with SambaNova and the need to display braintrust traces on exceptions, demonstrating clear relevance to the implemented code updates.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch show-traces-on-exceptions

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62096e4 and 210773e.

📒 Files selected for processing (1)
  • holmes/interactive.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Use Ruff for formatting and linting (configured in pyproject.toml) for all Python code
Type hints are required; code should pass mypy (configured in pyproject.toml)
ALWAYS place Python imports at the top of the file, not inside functions or methods

Files:

  • holmes/interactive.py
🧬 Code graph analysis (1)
holmes/interactive.py (1)
holmes/core/tracing.py (2)
  • get_trace_url (136-137)
  • get_trace_url (216-239)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: llm_evals
  • GitHub Check: Pre-commit checks
  • GitHub Check: build
🔇 Additional comments (1)
holmes/interactive.py (1)

1268-1271: LGTM! Error-path traceability correctly implemented.

The change appropriately mirrors the success-path pattern (lines 1256-1257), enabling trace URL display on exceptions from the LLM. The implementation correctly handles edge cases where no trace exists by checking if trace_url is truthy before printing.


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
Contributor

github-actions bot commented Oct 9, 2025

Results of HolmesGPT evals

  • ask_holmes: 31/35 test cases were successful, 3 regressions, 1 setup failures
Test suite Test case Status
ask 01_how_many_pods
ask 02_what_is_wrong_with_pod
ask 04_related_k8s_events
ask 05_image_version
ask 09_crashpod
ask 10_image_pull_backoff
ask 110_k8s_events_image_pull
ask 11_init_containers
ask 13a_pending_node_selector_basic
ask 14_pending_resources
ask 15_failed_readiness_probe
ask 17_oom_kill
ask 19_detect_missing_app_details
ask 20_long_log_file_search
ask 24_misconfigured_pvc
ask 24a_misconfigured_pvc_basic
ask 28_permissions_error 🚧
ask 39_failed_toolset
ask 41_setup_argo
ask 42_dns_issues_steps_new_tools
ask 43_current_datetime_from_prompt
ask 45_fetch_deployment_logs_simple
ask 51_logs_summarize_errors
ask 53_logs_find_term
ask 54_not_truncated_when_getting_pods
ask 59_label_based_counting
ask 60_count_less_than
ask 61_exact_match_counting
ask 63_fetch_error_logs_no_errors
ask 79_configmap_mount_issue
ask 83_secret_not_found
ask 86_configmap_like_but_secret
ask 93_calling_datadog[0]
ask 93_calling_datadog[1]
ask 93_calling_datadog[2]

Legend

  • ✅ the test was successful
  • :minus: the test was skipped
  • ⚠️ the test failed but is known to be flaky or known to fail
  • 🚧 the test had a setup failure (not a code regression)
  • 🔧 the test failed due to mock data issues (not a code regression)
  • 🚫 the test was throttled by API rate limits/overload
  • ❌ the test failed and should be fixed before merging the PR

break
except EOFError: # Handle Ctrl+D
break
except Exception as e:
Copy link
Collaborator

@mainred mainred Oct 13, 2025

Choose a reason for hiding this comment

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

how about printing trace_ur in the finally logic and removing L1256?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants