Skip to content

chore(clients): Exception and Logging Cleanup#148

Open
srmanda-cs wants to merge 1 commit intomicrosoft:mainfrom
srmanda-cs:chore/exception-and-logging-cleanup
Open

chore(clients): Exception and Logging Cleanup#148
srmanda-cs wants to merge 1 commit intomicrosoft:mainfrom
srmanda-cs:chore/exception-and-logging-cleanup

Conversation

@srmanda-cs
Copy link
Contributor

@srmanda-cs srmanda-cs commented Feb 25, 2026

As part of the clients/ cleanup (#146), I've committed a related fix in this PR: all 7 raise e occurrences in clients/utils/llm.py have been changed to bare raise. raise e resets the exception's traceback to the re-raise site, discarding the original call stack inside the OpenAI/Groq client libraries — exactly the context you need when debugging an API failure. Bare raise preserves the full traceback from the original raise point. This is a strictly better behavior with zero risk of regression.

@gaganso
Copy link
Collaborator

gaganso commented Feb 27, 2026

@srmanda-cs, is this in draft by mistake?

@srmanda-cs
Copy link
Contributor Author

@srmanda-cs, is this in draft by mistake?

Nope. I only made one useful commit in this repo. As I mentioned in the PR comment, and wanted to know if you wanted me to section the print statements as I mentioned or if I should leave them as is.

@srmanda-cs srmanda-cs marked this pull request as ready for review March 2, 2026 20:34
Copilot AI review requested due to automatic review settings March 2, 2026 20:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves exception re-raising behavior in the shared LLM client utilities so that failures preserve the original traceback (e.g., from OpenAI/Groq SDK internals), which is important for debugging API failures across agents.

Changes:

  • Replaced raise e with bare raise in multiple inference() exception handlers to preserve the original traceback.
  • Standardized this behavior across all affected client implementations within clients/utils/llm.py.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@srmanda-cs
Copy link
Contributor Author

This PR is ready to review, correct if needed, and merge

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.

3 participants