Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

mcowger
Copy link
Contributor

@mcowger mcowger commented Oct 8, 2025

No description provided.

Copy link

changeset-bot bot commented Oct 8, 2025

⚠️ No Changeset found

Latest commit: 171323c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…e those restrictions.

All tools are still included with every completion request, but the `tool_choice` field is populated with allowed tools dynamically based on mode, and `tool_choice` is configured to require the model to respond with a `tool_call` rather than `stop`.

This technique (rather than filtering the tools) keeps cache hit rates high for the function definitions, while still maintaining the needed controls
…s dont follow the darn spec.

So now, tools are filtered at generation time, and only acceptable tools are sent with the request.

This likely does have a small negative hit on cache utilization, but we'll see.
…alling providers

The ToolUseControl component is now rendered only when the selected provider supports native function calling, as defined in the nativeFunctionCallingProviders array. This ensures that tool use options are only available for compatible providers, preventing potential errors or unexpected behavior in the UI.
Extract native tool call handling logic into reusable helper functions
(addNativeToolCallsToParams, processNativeToolCallsFromDelta) to reduce
code duplication in OpenRouter provider.

Re-enable Morph fast apply feature which conditionally disables
traditional editing tools when fast apply is available. Pass full
providerState to getAllowedJSONToolsForMode to support fast apply
availability checking.

**Tidbits**:

- The cache hit rates are kinda crazy (often 90%):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that for GPT-5 or Sonnet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GPT-5-Codex

Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

@chrarnoldus
Copy link
Collaborator

I see it says DO NOT MERGE, but is there an objection to merging if we ensure everything is behind an experimental flag and there's no regressions in the XML tool flow?

We also have: #2866, which has the advantage of showing partial tool calls (e.g. streaming diffs). Could that eventually also be implemented in the approach of this PR? This PR has the advantage of having a smaller diff with upstream in existing code I think.

@mcowger
Copy link
Contributor Author

mcowger commented Oct 15, 2025

I see it says DO NOT MERGE, but is there an objection to merging if we ensure everything is behind an experimental flag and there's no regressions in the XML tool flow?

We also have: #2866, which has the advantage of showing partial tool calls (e.g. streaming diffs). Could that eventually also be implemented in the approach of this PR? This PR has the advantage of having a smaller diff with upstream in existing code I think.

I have absolutely no objection to including this at all. I just didnt want anything to happen accidently

I did confirm for every tool that it works both via XML and JSON calls.

It just has no tests or anything but I'd love to have more folks using it.

My results, and that of others, are very positive.

I do believe that the technique @NaccOll built in his PR for streaming the tool calls could be incorporated here.

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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.