Skip to content

feat(llm-bridge): supports to intercept error for responding #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

woorui
Copy link
Collaborator

@woorui woorui commented Mar 24, 2025

Description

  1. Remove the global trace client. Reinitialize it if you want to use a trace client.
  2. add InterceptError(code int, err error) function for EventWriter to intercept errors and send error messages back to the client.

@woorui woorui self-assigned this Mar 24, 2025
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 58.44156% with 32 lines in your changes missing coverage. Please review.

Project coverage is 46.21%. Comparing base (a9ae9d3) to head (5c8b56c).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/bridge/ai/response_writer.go 57.14% 20 Missing and 1 partial ⚠️
pkg/bridge/ai/api_server.go 56.25% 7 Missing ⚠️
pkg/trace/trace.go 66.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1036      +/-   ##
==========================================
- Coverage   46.23%   46.21%   -0.03%     
==========================================
  Files         102      102              
  Lines        7254     7277      +23     
==========================================
+ Hits         3354     3363       +9     
- Misses       3700     3713      +13     
- Partials      200      201       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fanweixiao fanweixiao requested a review from Copilot April 10, 2025 03:49
Copy link

@Copilot 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.

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

@@ -172,10 +171,11 @@ func NewHandler(service *Service) *Handler {
// HandleOverview is the handler for GET /overview
func (h *Handler) HandleOverview(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
ww := w.(EventResponseWriter)
Copy link
Preview

Copilot AI Apr 10, 2025

Choose a reason for hiding this comment

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

The forced type assertion to EventResponseWriter might cause a runtime panic if 'w' does not implement this interface. Consider using a safe type assertion (e.g., 'if ww, ok := w.(EventResponseWriter); ok {...}') and handling the failure case.

Copilot uses AI. Check for mistakes.

@woorui woorui merged commit 84d894b into master Apr 16, 2025
5 checks passed
@woorui woorui deleted the feat/resp-error branch April 16, 2025 08:22
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.

None yet

2 participants