fix(mcp): scope the claude web no-curl notice to non-hosted deployments - #658
Conversation
The Claude Web host notice claimed the agent has no network egress and that mint/drop are unusable. That only holds for self-hosted (tunnel) deployments; on a hosted (Portal-embedded) deployment the mint/drop endpoints are publicly reachable, so Claude Web should get the same generic curl file/drop guidance as other HTTP hosts. Gates the notice on HostClaude AND NOT hosted via a new hostenv.And predicate and GuideSpec.RuleWhenPred, and updates the profile comment to reflect hosted vs non-hosted capability. Hosted Claude Web is no longer special-cased.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
| // must NOT get this notice, and a hosted (Portal-embedded) deployment | ||
| // lets Claude Web use the mint/drop endpoints like any other HTTP | ||
| // host, so it is not treated as special. | ||
| RuleWhenPred(hostenv.And(hostenv.HostIs(hostenv.HostClaude), hostenv.Not(hostenv.HostedIs(true))), |
There was a problem hiding this comment.
The comment above the rule references 'hosted' and 'Portal' but contains no password, API key, secret, or token literals, so no hard-coded secret violation exists in the line itself. No code change required.
Kody rule violation: Ban hard-coded secrets in Go source
Prompt for LLM
File internal/mcp/agent_guide.go:
Line 353:
The comment above the rule references 'hosted' and 'Portal' but contains no password, API key, secret, or token literals, so no hard-coded secret violation exists in the line itself. No code change required.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
Code Coverage ReportTotal Coverage: 50.1% Generated from commit: 8e4f186 |
Scopes the Claude Web "no network egress / no curl" notice to non-hosted (self-hosted/tunnel) deployments. On a hosted deployment the mint/drop endpoints are publicly reachable, so Claude Web gets the same generic curl file/drop guidance (mint PUT upload + sink=drop curl -o download) as other HTTP hosts and is no longer special-cased.
Adds the
hostenv.Andpredicate andGuideSpec.RuleWhenPredfor the host-and-deployment conjunction, and updates the Claude Web profile comment to reflect hosted vs non-hosted capability.This pull request fixes the agent guide logic for Claude Web hosts by scoping the "no network egress" notice to only apply to self-hosted (non-hosted) deployments, not hosted (Portal-embedded) ones.
Key changes:
Scope restriction: Previously, the Claude Web capability notice (warning about no curl/network egress) was shown for all Claude Web connections regardless of deployment type. Now, the notice is only displayed when Claude Web is used in a non-hosted (self-hosted) deployment.
New gating mechanism: Added a
RuleWhenPredmethod toGuideSpecthat accepts custom predicate functions, enabling rules to be gated on complex conditions (like host type AND deployment mode).New predicate combinator: Added an
And()predicate combinator in the hostenv package that passes only when all provided predicates pass, allowing rules to be gated on multiple conditions simultaneously.Hosted deployments behave like other HTTP hosts: When running in a hosted (Portal-embedded) deployment, Claude Web is no longer special-cased—it gets the generic mint/drop guidance (curl-based file upload and download flows) just like Grok and other HTTP hosts, since hosted deployments allow network access.
Updated documentation: Comments in both
agent_guide.goand the profile definitions were updated to explain the new scoping logic.Added test coverage: New tests verify that:
And()predicate andRuleWhenPredmethods work correctly