Require a local runtime for MCP HTTP headers helpers (#65119)

## Why

MCP servers can use the host's HTTP client without a local runtime. That
fallback also let locally configured `http_headers_helper` commands run
on the host when only remote executors were attached.

## What changed

Reject locally configured HTTP headers helpers unless the host has a
local runtime. A host that retains its startup runtime can still run
helpers when it exposes only remote executors. HTTP servers without a
headers helper can still use the host's HTTP client.

## Testing

Cover helper rejection with no executors and with both laptop and cloud
executors attached. Verify that the helper command leaves no marker
file, local stdio startup still fails, and plain HTTP still works. Cover
helper client resolution when a local runtime is available, including
when only remote executors are exposed.

GitOrigin-RevId: 0aff6cc1f9f6122aace54ed4c19ef93e26817c64
This commit is contained in:
Robbie Ostrow
2026-12-02 00:28:46 +00:00
committed by copyberry
parent 7131f15461
commit 607f7efdfb
3 changed files with 117 additions and 8 deletions
+6
View File
@@ -409,6 +409,12 @@ impl EnvironmentManager {
self.local_environment.as_ref().map(Arc::clone)
}
/// Whether the host configured a local runtime at startup. A local app can
/// retain this runtime even when it exposes only remote executors.
pub fn has_local_runtime(&self) -> bool {
self.local_environment.is_some() || self.local_runtime_paths.is_some()
}
/// Returns a named environment instance.
pub fn get_environment(&self, environment_id: &str) -> Option<Arc<Environment>> {
self.environments