Skip to content

[Bug]: context and feature planning discard the supplied sitemap origin #791

Closed

Description

@jimhoyd

Runtime revision and environment

Published URLCode 0.6.3; core main/tag 2383b1213546fb9fd1fbc51aa4d2ed6dfe27a457, macOS, Node 26.10.0.

Minimal reproduction

Save this synthetic urlcode.yaml:

version: "1"
site: {sitemap: true}
routes:
  /hello: {respond: {text: hello}}

Run these against the same project:

urlcode validate --local --project <project> --origin https://example.test
urlcode context --project <project> --origin https://example.test --json
urlcode context --task redirects --project <project> --origin https://example.test --json
urlcode plan-feature redirect --project <project> --origin https://example.test

Validation passes with two routes. Both context calls and plan-feature fail claiming --origin is missing, although it was supplied.

Expected: context and task context must forward the supplied operator origin into site expansion; feature planning should preserve the same project context. The same contract applies through local MCP's get_context/plan_feature when the server has an origin. When no origin was actually given, report that prerequisite without guessing one.

Relevant output

{"event":"error","message":"site.sitemap: a sitemap needs absolute URLs; start with --origin https://your.host (or leave site.sitemap undeclared)"}

packages/core/src/context.ts now accepts origin for emitted commands but its internal compile(project) still calls applySite(loaded,{}). feature-plan.ts calls buildContext without an origin and FeaturePlanOptions has no origin field. The command fails before useful discovery is returned. This affects an ordinary declarative sitemap project, with no extension, credential or application code involved.

Activity

  1. added
    bug
    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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions