-
Notifications
You must be signed in to change notification settings - Fork 43
fix: duplicate wrap tracer #398
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @nianiaJR, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a bug where the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
📝 WalkthroughWalkthroughThe PR removes the wrapper that replaced Changes
Sequence Diagram(s)(Skipped — changes are small and primarily test + single-method unwrapping; no multi-component new control flow requiring visualization.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses an issue with duplicate tracer wrapping for the invoke method. By removing the manual wrapping, the code is cleaner and avoids redundant tracing. The change is a good improvement. I've identified one minor follow-up action to further clean up the code as a result of this change.
I am having trouble creating individual review comments. Click here to see my feedback.
plugin/langchain/lib/graph/CompiledStateGraphObject.ts (47-48)
With the removal of the graph.invoke wrapper, the originalInvoke variable, declared on line 40, is no longer used. It should be removed to avoid dead code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@plugin/langchain/test/llm.test.ts`:
- Line 99: The test currently performs await app.httpRequest().get('/llm/graph')
without asserting the HTTP status; change it to capture the response (e.g.,
const res = await app.httpRequest().get('/llm/graph')) and add an assertion that
the status is expected (for example expect(res.status).toBe(200)) so failures
show a clear status-code error; update the same call site where
app.httpRequest().get('/llm/graph') is used.
| app.mockLog(); | ||
| mm(Tracer.prototype, 'traceId', 'test-persist-run-trace-id'); | ||
|
|
||
| await app.httpRequest().get('/llm/graph'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add status code assertion for consistency and clearer failure messages.
The HTTP request should verify the response status like the other tests in this file (e.g., line 77-79). Without this, if the endpoint fails, the test may pass incorrectly or produce confusing assertion errors.
Proposed fix
- await app.httpRequest().get('/llm/graph');
+ await app.httpRequest().get('/llm/graph').expect(200);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| await app.httpRequest().get('/llm/graph'); | |
| await app.httpRequest().get('/llm/graph').expect(200); |
🤖 Prompt for AI Agents
In `@plugin/langchain/test/llm.test.ts` at line 99, The test currently performs
await app.httpRequest().get('/llm/graph') without asserting the HTTP status;
change it to capture the response (e.g., const res = await
app.httpRequest().get('/llm/graph')) and add an assertion that the status is
expected (for example expect(res.status).toBe(200)) so failures show a clear
status-code error; update the same call site where
app.httpRequest().get('/llm/graph') is used.
Checklist
npm testpassesAffected core subsystem(s)
Description of change
Summary by CodeRabbit
Refactor
Tests
✏️ Tip: You can customize this high-level summary in your review settings.