Skip to content

Fix ambiguous model resolution returns first match silently instead of erroring #75

Description

@KochC

In index.js resolveModel() (lines ~920-945), when bareMatches.length > 1 the function throws an error listing only the first match as an example (bareMatches[0].id), which is helpful. But the preceding providerOverride branch (lines ~925-928) silently returns the first provider-matching model without confirming uniqueness — if two providers expose the same modelID and providerOverride matches both, only the first wins with no warning. More critically, buildSystemPrompt() in index.js (line ~216) appends Requested temperature: X as a plain-text hint to the system prompt rather than passing it as a structured parameter to the underlying model. Temperature and max_tokens are quietly discarded by the actual model call, yet the response shape (e.g. createChatCompletionResponse) reflects the requested values in no way. Callers relying on deterministic (temperature=0) or length-limited responses receive silently incorrect behaviour. The system prompt hints are a best-effort workaround, but this should be documented prominently and a warning logged via safeLog when non-default values are requested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions