Skip to content

[Bug]: verification commands and MCP subprocess runners drop the supplied extension host #778

Closed

Description

@jimhoyd

Runtime revision and environment

Published @jimhoyd/urlcode 0.6.2, tag a7d7ce1; Node 26.8.2, macOS, isolated temporary project.

Minimal reproduction

Create app/urlcode.yaml:

version: "1"
extensions:
  widget: {version: "1", config: {}}
routes:
  /widget/*: {extension: widget}

Use an external host.mjs that registers widget version 1, an object config schema, node target, and the project's current inspectExtensionRevision digest. Its synthetic activate returns a handler. Call buildContext(app,{hostFile:absoluteHostPath}).

The returned project.host correctly names widget (the #755 fix works), but commands.validate is urlcode validate --local --project <app>, and commands.test/audit likewise omit the host. Running that validation command exits 1 claiming @jimhoyd/urlcode-widget is not installed and recommending installation. That is misleading for an explicitly registered custom host extension.

The same command with --host-file <host.mjs> --origin https://example.test exits 0 and validates one route. An origin is required for activating an extension; adding the host flag alone reports that missing prerequisite.

Relevant output

Generated command:

urlcode validate --local --project /tmp/<synthetic-site>/app

Failure:

Extension configuration does not match the installed schemas:
  extensions.widget: @jimhoyd/urlcode-widget is not installed ...; run `urlcode extensions add widget` or npm ci

With host and explicit synthetic origin:

{"event":"valid","routes":1}

Expected: commands advertised as exact preserve the supplied host when known, or explicitly identify unresolved operator prerequisites (origin/policy/host path) instead of presenting an incomplete invocation. MCP should retain enough information about its own --host-file to produce equivalent guidance. Do not invent origins, credentials, grants or automatically enable execution.

This is a command-generation follow-up to #755, not a claim that its inspection-state propagation fix failed. Source: packages/core/src/context.ts commands construction, and the buildContext call in mcp.ts. All execution used synthetic local files; no live service or customer data.

Activity

  1. jimhoyd commented on Sep 26, 2026

    @jimhoyd
    CollaboratorAuthor

    Additional executable evidence from the same 0.6.2 review: the opt-in MCP subprocess runners also drop the supplied host.

    Started serveMcp with allowAuthoring:true, hostFile pointing at the synthetic widget registration, and origin:https://example.test. The host is pinned to the project's actual revision. Its handler returns {status:200,headers:[],body:'ok'}, and tests/requests.json contains [{path:'/widget/',status:200,expectBody:'ok'}]. In one session:

    • run_tests -> total:1, failed:0.
    • run_test -> exitCode:1, unsupported-capability /widget/*; asks for --host-file although this MCP server already received it.
    • run_validate -> exitCode:1, claims @jimhoyd/urlcode-widget is not installed, ignoring the custom registration.

    mcp.ts passes the loaded extensions to runProjectTests for run_tests, but its callAuthoringTool path only passes origin. mcp-authoring.ts runCli spawns the CLI without --host-file. This affects the verification workflow beyond the generated command strings; preserve the operator-supplied host across both paths, with an explicit execution/authority contract. Do not forward ambient credentials indiscriminately or automatically change grants.

    The default execution opt-in fix remains verified and is not being reopened (#590).

  2. changed the title [-][Bug]: context verification commands omit the supplied extension host and required origin[/-] [+][Bug]: verification commands and MCP subprocess runners drop the supplied extension host[/+] on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions