Skip to content

Conversation

@nmaguiar
Copy link
Collaborator

@nmaguiar nmaguiar commented Jan 7, 2026

This pull request introduces significant improvements to Gemini 2.5/3 tool calling support and enhances job loading flexibility in the codebase. The most important changes include a refactor of tool call handling to support Gemini's function call/response flow, improved robustness in tool argument parsing, and updates to the documentation for Gemini-specific behaviors. Additionally, job loading now handles both YAML and JSON formats more flexibly.

Gemini 2.5/3 Tool Calling Enhancements:

  • Refactored tool call handling in OpenWrap.ai.prototype.__gpttypes to support Gemini 2.5/3's function call/response flow: the model's functionCall parts are now properly mapped to follow-up functionResponse parts from the user, and tool arguments are parsed as either objects or JSON strings depending on the model/version. [1] [2]
  • Improved tool selection logic: when tools are specified as strings, they are resolved to full tool definitions before invocation, ensuring correct function execution.
  • Ensured conversation state is correctly updated after tool execution, and fixed the recursive prompt call to avoid duplicating tool call messages.

Job Loading Improvements:

  • Enhanced job loading in js/openaf.js to support both YAML and JSON job definitions, and to remove any daemon property before execution for consistency.

Documentation Updates:

  • Updated docs/ow-ai-gpttypes.md with notes on Gemini 2.5/3 tool call handling, argument types, and best practices for requesting JSON output.

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 pull request enhances Gemini 2.5/3 tool calling support and improves job loading flexibility by handling both YAML and JSON formats. The main improvements include proper handling of Gemini's function call/response flow, robust tool argument parsing (supporting both object and JSON string formats), and the ability to load jobs from either YAML or JSON files with automatic daemon property removal.

Key Changes:

  • Refactored tool call handling to properly map Gemini's functionCall parts to functionResponse parts with improved argument parsing
  • Enhanced job loading to support both YAML and JSON formats with daemon property cleanup
  • Updated documentation with Gemini 2.5/3-specific notes on tool calling and JSON output configuration

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
js/owrap.ai.js Refactored tool calling logic to support Gemini 2.5/3's function call/response flow with improved tool selection and argument parsing
js/openaf.js Enhanced job loading to handle both YAML and JSON formats with automatic daemon property removal via temporary file processing
docs/ow-ai-gpttypes.md Added documentation for Gemini 2.5/3 tool calling behavior and best practices

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

nmaguiar and others added 2 commits January 7, 2026 04:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@nmaguiar nmaguiar merged commit 1e8bd7d into master Jan 7, 2026
1 check failed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Continuous Enhancement Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants