Skip to content

fix(models): strip ollama prefix in ModelSelector; fix order-dependent auth tests - #33

Merged
steipete merged 2 commits into
mainfrom
feat/gpt-5.6-and-ollama-passthrough
Jul 10, 2026
Merged

fix(models): strip ollama prefix in ModelSelector; fix order-dependent auth tests#33
steipete merged 2 commits into
mainfrom
feat/gpt-5.6-and-ollama-passthrough

Conversation

@steipete

@steipete steipete commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Slimmed after #30/#31 landed GPT-5.6 on main first — this PR now contains only the two changes main still lacks:

  1. ModelSelector.parseModel keeps the ollama/ prefix in custom model ids. Provider-qualified unknown names fell through to the bare-name fallback with the prefix attached, producing .custom("ollama/qwen2.5vl:latest") — an id that does not exist on the Ollama server. (LanguageModel.parse already strips it; the throwing selector now matches.) Found live: Peekaboo's shipped default provider entry ollama/qwen2.5vl:latest was unusable through this path.

  2. Custom-provider test helper serialized under TestEnvironmentMutex. It mutated TachikomaConfiguration.profileDirectoryName and CustomProviderRegistry.shared unlocked, which made AuthManagerTests order-dependent — adding any test could (deterministically, given the right scheduling) fail "openrouter resolves env and credential keys as bearer auth". State is restored in defer and the callback is @Sendable.

Tests

  • New: ModelSelector strips the ollama prefix from provider-qualified custom models (regression for 1, incl. known-shortcut preservation).
  • Full suite: 792 tests / 103 suites, green, run twice (order-dependency fix verified by repetition).

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d02ce26a3e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return .openRouter(modelId: qualified.model)
}
if provider == "ollama" {
return .ollama(parseOllamaModel(qualified.model.lowercased()) ?? .custom(qualified.model.lowercased()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve custom Ollama model casing

When CLI users pass provider-qualified Ollama IDs that are case-sensitive (for example Hugging Face GGUF IDs or custom tags such as Q4_K_M), this branch parses the already lowercased normalized string and then lowercases the model again, so the OllamaProvider sends a different model value and Ollama can fail to find the registered model. Use the original trimmed modelString/qualified model for the custom fallback and only lowercase for known-name matching.

Useful? React with 👍 / 👎.

…m-provider test helper

ModelSelector.parseModel fell through to the bare-name fallback with the
provider prefix still attached, producing .custom("ollama/<model>") — an id
that does not exist on the Ollama server. Provider-qualified ollama ids now
resolve like LanguageModel.parse already does. Also wraps the custom-provider
test helper in TestEnvironmentMutex: it mutated global profile/registry state
unlocked, making AuthManagerTests order-dependent.
@steipete
steipete force-pushed the feat/gpt-5.6-and-ollama-passthrough branch from d02ce26 to 3a8593d Compare July 10, 2026 07:16
@steipete steipete changed the title feat(models): add GPT-5.6 and pass through custom Ollama model ids fix(models): strip ollama prefix in ModelSelector; fix order-dependent auth tests Jul 10, 2026
@steipete
steipete merged commit fe8f25e into main Jul 10, 2026
18 checks passed
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.

1 participant