-
Notifications
You must be signed in to change notification settings - Fork 625
fix(agent): fix inconsistent fc call record format in chained non-native function calling #515
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
Conversation
…ive function calling
WalkthroughThe updates focus on refining how tool call results and errors are handled in the agent loop of the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 2
🧹 Nitpick comments (2)
src/main/presenter/llmProviderPresenter/index.ts (2)
700-748: Risk of prompt bloat for non-native function-call chains
formattedToolResultTextserialises the entire tool response into the assistant message that is fed back to the LLM.
Large payloads (e.g. long JSON / HTML) quickly exhaustcontextLength, drastically increasing cost and truncation risk.Consider:
- Truncating or summarising long responses before injection.
- Storing the raw result server-side and inserting only a short reference token.
This keeps the conversational context lean and predictable.
770-793: Redundant shadowing & boilerplate in error branch
const supportsFunctionCallInAgent = modelConfig?.functionCall || false;shadows the earliersupportsFunctionCalldeclared at line 494 and adds identical logic. Remove the duplicate or rename for clarity.Additionally, native/non-native error handling blocks are nearly identical except for a couple of fields – extract a helper to DRY this section.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/presenter/llmProviderPresenter/index.ts(3 hunks)src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-check (x64)
src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts
Show resolved
Hide resolved
|
LGTM |
fix(agent): fix inconsistent fc call record format in chained non-native function calling
by: #514
Summary by CodeRabbit
Bug Fixes
Refactor
Style