Files
oh-my-pi/packages/coding-agent/src/config/inline-tool-descriptors-mode.ts
T
can1357 ef7636805b feat(coding-agent): removed canonical model variant selection and tracking
- Removed the canonical model variant indexing, selection, and tracking logic from the model registry and resolver.
- Eliminated the `canonical` sub-command, tab view, search tokens, and equivalence configuration structures from the CLI and model selector components.
- Refined model identification, lookup, and provider fallback resolution to bind exclusively to standard, raw model IDs.
- Relocated the equivalence utility script within the catalog package to support script-only policy generation.
2026-07-01 05:22:42 +02:00

27 lines
848 B
TypeScript

import { modelFamilyToken } from "@oh-my-pi/pi-catalog/identity";
/**
* Resolves whether full tool descriptors should be inlined into the system
* prompt (and stripped from provider tool schemas) for a given model and
* setting.
*
* `auto` enforces a per-model policy: inline for Gemini models, off otherwise.
* Gemini benefits from descriptors in-prompt; other providers keep them in the
* tool schemas. `on`/`off` are explicit user overrides.
*
* @param modelId Model id (e.g. `gemini-3-pro`) used to classify `auto`.
*/
export function shouldInlineToolDescriptors(
setting: "auto" | "on" | "off" | undefined,
modelId: string | undefined,
): boolean {
switch (setting ?? "auto") {
case "on":
return true;
case "off":
return false;
default:
return modelId !== undefined && modelFamilyToken(modelId) === "gemini";
}
}