Skip to content

fix: remove stale 128-tool limit - #291

Merged
Vizards merged 1 commit into
mainfrom
fix/remove-tool-count-limit
Oct 7, 2026
Merged

Vizards merged 1 commit into
mainfrom
fix/remove-tool-count-limit

Conversation

@Vizards

@Vizards Vizards commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Related issues

Closes #286

Problem

Copilot Agent Host sessions can pass more than 128 tool definitions to the provider. The extension rejects these requests locally before contacting DeepSeek, so Copilot retries the same failing request five times even though the official API accepts the tool catalog.

Changes and scope

  • Remove the hard-coded 128-tool guard and advertise tool calling as a boolean capability for all four models.
  • Remove the obsolete limit error and update the English and Chinese settings help, README, walkthrough, and tool-drift notice.
  • Preserve tool conversion and the existing virtual-tool pre-activation flow. Tool count is no longer rejected by the extension; API errors continue through the existing error handling.

Validation

  • npm run compile, npm run lint, npm run format:check, and git diff --check passed.
  • Tested through the installed VS Code Stable 1.140.0 UI, using the Default profile, the Copilot Agent Host harness, and the official https://api.deepseek.com endpoint with deepseek-flash (DeepSeek V4.1 Flash).
Scenario Tool definitions Result
Unmodified 0.9.3 249 Local 128-tool error; Copilot retried five times
Fixed extension, same conversation and tool configuration 249 Official API returned the requested text
Fixed extension, real MCP tool call and follow-up 249 in both requests Called the side-effect-free limit_probe_150 tool and returned limit_probe_150: TOOL_LIMIT_ROUNDTRIP_OK

Provider metadata logs confirmed that all three successful API requests contained 249 tools. Temporary test fixtures, credentials, and logs are not included in this PR.

Final checks

  • I reviewed and can explain every change
  • I reviewed any user-facing text changes in both English and Chinese
  • This pull request contains no API keys, authorization headers, private prompts, private code, or unreviewed sensitive logs

@Vizards
Vizards marked this pull request as ready for review October 7, 2026 04:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T04:18:47.380638Z 1479831 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The obsolete guard and all related references are removed consistently while preserving tool conversion and preflight behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Removes the obsolete 128-tool limit so larger Copilot Agent tool catalogs reach the DeepSeek API.

Changes:

  • Advertises tool calling as an unlimited boolean capability.
  • Removes local tool-count validation and its error messages.
  • Updates English and Chinese guidance about large tool lists.
File Description
src/​types.ts Simplifies tool capability typing.
src/​provider/​tools/​request.ts Removes tool-count rejection.
src/​provider/​tools/​consts.ts Removes the obsolete limit constant.
src/​i18n.ts Removes obsolete localized errors.
src/​consts.ts Advertises tool calling for all models.
resources/​walkthrough/​advanced-settings.md Updates English walkthrough guidance.
resources/​walkthrough/​advanced-settings.nls.zh-cn.md Updates Chinese walkthrough guidance.
README.md Removes stale English limit guidance.
README.zh-cn.md Removes stale Chinese limit guidance.
package.nls.json Updates English setting help.
package.nls.zh-cn.json Updates Chinese setting help.
docs/​notices/​tool-drift.en.md Removes stale English limit claims.
docs/​notices/​tool-drift.zh.md Removes stale Chinese limit claims.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Vizards
Vizards merged commit 6c4fa95 into main Oct 7, 2026
2 checks passed
@Vizards
Vizards deleted the fix/remove-tool-count-limit branch October 7, 2026 04:54
WindSnowLi added a commit to WindSnowLi/multi-model-for-copilot that referenced this pull request Oct 8, 2026
Align this fork with upstream v0.9.4 and with the VS Code 1.141 language model API:

- config: add `requestHeaders` with `${conversationId}` templating, merged
  case-insensitively into every chat completion request (Vizards#266)
- models: add DeepSeek V4.1 Flash (native vision) and surface retirement notices
  for the legacy V4 Flash entries through `warningText` and a status icon
  (Vizards#267, Vizards#272)
- tools: emit an explicit empty schema for parameterless tools (Vizards#282) and drop
  the stale 128-tool limit (Vizards#291)
- runtime: register the provider synchronously and refresh models after Copilot
  activates, which avoids a BYOK activation deadlock (Vizards#275); stop refreshing
  models during deactivation (Vizards#271)
- settings: add a `resetBaseUrl` command with scope preview, confirm API key
  removal, link missing-key errors to the configuration flow, and contribute the
  previously missing `qwenBaseUrl` setting (Vizards#276)
- vision: ship the improved Vision Proxy prompt as the default (Vizards#206)
- pricing: emit only `infoText`/`priceCategory` so the model picker stops
  rendering formatted cost strings as "Unknown" (Vizards#241)
- provider: respect `toolMode: required` and declare `capabilities.apiType` as
  Chat Completions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

[Bug] 128-function guard is stale: the API accepts 211/500 tools, so agent sessions with many MCP tools fail locally

2 participants