Repository navigation
fix(app): give custom-provider context-window failures an actionable message - #1646
Merged
Merged
Conversation
…message
A custom (operator-defined) provider whose live model listing fails
has no embedded catalog to fall back to, so mecatl correctly refuses
inference until discovery succeeds or an override is configured — but
the failure was hard to act on: the terminal contextWindowUnavailable
error named the config key without showing its shape, and
statusHintFor gave every custom provider an empty hint even though the
one real gap ("the key works for inference but listing itself 401s,
because some OpenAI-compatible gateways authorize or implement listing
differently from completions") is common and worth naming.
- contextWindowUnavailable now includes a concrete
models.context_windows.<provider>.<model>: <tokens> example instead
of only naming the key.
- statusHintFor gains a generic (not vendor-specific) hint for any
operator-defined custom provider, mirroring the existing
ToolHive/Codex hint tables.
- Extend the existing "A custom model is listed but requests fail"
troubleshooting entry with the startup-log signature and a curl
check for the listing-vs-inference auth gap, rather than adding a
separate duplicate section (user-docs/features/choose-models.md and
troubleshooting.md already cover the naming rule and the
models.context_windows override in detail as of #1636).
No admission/gating behavior changes — this is diagnostics and docs
only; the fail-closed design for a live-listable provider with no
catalog floor is unchanged.
Co-authored-by: mecatl <[email protected]>
Merged
2 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
contextWindowUnavailablenamed themodels.context_windowskey without showing its shape, andstatusHintForgave every custom provider an empty remediation hint even though the common real cause (the API key works for inference but the gateway's listing endpoint 401s, because some OpenAI-compatible gateways authorize or implement listing differently from completions) is worth naming.Development stage
Contract linkage
Interface conformance
Issue relationship
Relates to a user support report about custom OpenAI-compatible provider setup (no tracked issue number).
Type of change
Test plan
Baseline checks
go test ./internal/app/..., all green; updated two tests that pinned the previous "no hint" behavior)task docs— 0 broken links/anchors)task lint) — skipped: localgolangci-lintbinary is built against Go 1.26, older than this repo's Go 1.27 toolchain requirement, so it refuses to load config in this environment.go build ./...andgo vet ./...are clean.go run ./cmd/mecademo) — not run this session; no engine/agent-loop code touched.task test— not run (long-running full-repo suite); ran the targetedinternal/apppackage instead, plus confirmed one unrelated pre-existing failure (TestCommandRunnerEnvironment_Scenario2_DefaultScrub, environment-dependent on this machine) reproduces identically with this diff stashed out.Changes
internal/app/modellister.gocontextWindowUnavailableerror now includes a concretemodels.context_windows.<provider>.<model>: 128000exampleinternal/app/registry.gostatusHintForgains a generic, non-vendor-specific hint for any operator-defined custom provider (previously always"")internal/app/operator_defined_providers_test.gouser-docs/mecatui/troubleshooting.mdcurlcheck for the listing-vs-inference auth gap (kept as an extension, not a new section, sinceuser-docs/features/choose-models.mdand this same troubleshooting page already document the naming rule and themodels.context_windowsoverride in detail as of #1636)User-facing change
context window unavailableerror now shows the exact YAML shape of the override instead of only naming the config key.mecatui providers status/ the/modelspicker's provider-status hint is no longer blank for a custom provider whose live listing failed — it now explains the likely listing-vs-inference auth gap.curlcheck for this failure mode.Special notes for reviewers
user-docs/mecatui/index.mdand added a separate "context window unavailable" troubleshooting section, but fix(mecatui): clarify provider onboarding #1636 (merged on top of this branch's base) already covers both the provider-naming rule and themodels.context_windowsoverride in more detail. Those two doc hunks were dropped in favor of extending fix(mecatui): clarify provider onboarding #1636's existing section, to avoid two treatments of the same ground.🤖 Generated with Claude Code