mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix: add nvidia to PROVIDER_TOOL_LIMITS (1536) to prevent tool truncation (#6177)
NVIDIA NIM API (nvidia/* models) silently truncates the tool list to 128 (the default MAX_TOOLS_LIMIT) because nvidia is not in PROVIDER_TOOL_LIMITS. Tools beyond index 127 are dropped, causing agents to lose access to critical tools like task, read, or high-index MCP tools. Verified that NVIDIA NIM API supports up to 1536 tools by direct testing. End-to-end confirmed: 198 tools sent, model successfully called tools at indices 193, 195, and 197 (previously dropped by truncation to 128). Follows the same pattern as #5563 (grok-cli: 200), integrated in v3.8.43.
This commit is contained in:
committed by
GitHub
parent
6a12ba07b1
commit
0ed6780798
@@ -6,6 +6,7 @@ const DEFAULT_LIMIT = MAX_TOOLS_LIMIT;
|
||||
|
||||
const PROVIDER_TOOL_LIMITS: Record<string, number> = {
|
||||
"grok-cli": 200,
|
||||
"nvidia": 1536,
|
||||
};
|
||||
|
||||
const _detectedLimitsSweep = setInterval(() => {
|
||||
|
||||
@@ -69,6 +69,15 @@ describe("toolLimitDetector", () => {
|
||||
assert.strictEqual(getEffectiveToolLimit("grok-cli"), 200);
|
||||
});
|
||||
|
||||
it("should return proactive limit for nvidia (1536) without any detection", () => {
|
||||
assert.strictEqual(getEffectiveToolLimit("nvidia"), 1536);
|
||||
});
|
||||
|
||||
it("should not override nvidia proactive limit with reactive detection", () => {
|
||||
setDetectedToolLimit("nvidia", 100);
|
||||
assert.strictEqual(getEffectiveToolLimit("nvidia"), 1536);
|
||||
});
|
||||
|
||||
it("should still return default (128) for unknown providers", () => {
|
||||
assert.strictEqual(getEffectiveToolLimit("some-new-provider"), 128);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user