Skip to content

fix(core): honor model tool capabilities - #50243

Closed
andreivince wants to merge 1 commit into
anomalyco:v2from
andreivince:model-tools
Closed

andreivince wants to merge 1 commit into
anomalyco:v2from
andreivince:model-tools

Conversation

@andreivince

@andreivince andreivince commented Sep 20, 2026 •

Copy link
Copy Markdown

Withdrawn because #35432 is already assigned. The tested patch remains available on this branch.

Issue for this PR

Closes #35432

This PR targets v2 as required by CONTRIBUTING.md. The default-branch issue check still lacks the body-reference fallback merged in #43964, so its needs:issue warning does not recognize the issue above.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

V2 still sends tool definitions when a model declares capabilities.tools: false, causing providers to reject requests for models without tool support.

Use an empty tool snapshot before request hooks and omit tool choice for these models. Capable models retain their tools, hook renames, and execution behavior. Existing conversation history is preserved.

How did you verify your code works?

  • Three new regressions failed before the fix and pass afterward. They exercise native provider configuration, every request kind, serialized request bodies, model switching, hook behavior, and tool history.
  • Full core suite: 5,441 passed, 41 skipped. Full AI suite: 1,401 passed, 28 skipped.
  • Core typecheck, repository lint, formatting, and changed-source Effect checks passed.

The workspace check hits 10 existing CLI/TUI signal-handler type errors, also reproduced on unchanged 58fcad77a. Testing used Bun 1.4.2 and Bash 5.3 on macOS arm64.

Screenshots / recordings

Not applicable.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Copilot AI lite review requested due to automatic review settings September 20, 2026 23:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants