Repository navigation
Catch capability host settings that silently do nothing - #112
Merged
Merged
Conversation
Both capability host allow-lists are compared against a URL's hostname, so an entry written as a URL or with a port matches nothing. Nothing reports that: the list parses, the assistant starts, and the setting silently does nothing. Only the dial list was checked, and its check missed the likeliest mistake. It rejected a slash but not a port, despite an error message promising otherwise — so CAPABILITY_MCP_ENDPOINT_HOSTS=gateway.example:8080 started cleanly and then refused every endpoint, taking every provider's tools out of every prompt with no configuration error to point at. CAPABILITY_IDENTITY_FORWARD_HOSTS had no check at all, and it is the one staging now depends on for three providers. A port there means provider tool calls quietly stop carrying the caller, so reads that should act as the person asking lose their identity instead. One validator now guards both, names the setting at fault, and detects a port with net.SplitHostPort so a bare IPv6 address still passes. Every shipped and deployed value is already a bare host, so nothing in service changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
scotwells
marked this pull request as ready for review
September 29, 2026 01:40
ecv
approved these changes
Sep 29, 2026
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.
Two operator settings decide which provider endpoints the assistant may dial, and which may receive the caller's identity. Both are matched against a URL's hostname — so an entry written as a URL, or with a port on it, matches nothing at all.
Nothing reports that. The list parses, the assistant starts, and the setting quietly does nothing.
Why it matters
CAPABILITY_MCP_ENDPOINT_HOSTSdecides what may be dialed. If it silently matches nothing, every provider endpoint is refused and every provider's tools vanish from every prompt — with no configuration error to point at. It had a check, but the check rejected a slash and not a port, despite an error message promising otherwise. Sogateway.example:8080started cleanly and then broke everything.CAPABILITY_IDENTITY_FORWARD_HOSTSdecides who receives the caller's identity, and it had no check at all. It is also the one staging now depends on for three providers (compute, networking, DNS). A port there means provider tool calls quietly stop acting as the person who asked — the reads still happen, just without the identity that scopes them.A port is the easy mistake to make here, because the endpoints these are compared against nearly always carry one.
The change
One validator guards both lists, names the setting at fault in the error, and refuses to start rather than starting broken. A port is detected with
net.SplitHostPort, so a bare IPv6 address still passes.Nothing in service changes. Every shipped value and every value deployed in staging is already a bare hostname. This is about the next person who edits one — including whoever replaces the
REPLACE_WITH_AI_GATEWAY_HOSTplaceholder in the production overlay, where getting it wrong is exactly the silent failure described above.Tests cover both settings rejecting a port and a URL, and a bare IPv6 address still being accepted.
🤖 Generated with Claude Code