Skip to content

fix(cli): the ready banner prints API: and MCP: addresses only when an HTTP server is composed - #23741

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-23623-no-server-banner-urls
Oct 15, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-23623-no-server-banner-urls

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #23623
Clause-②: no

What this changes

os serve's ready banner printed API: and an MCP connect URL on every boot. That included --no-server, where no HTTP server is composed and nothing listens on the port. Triage's scope, verbatim: "Scope: the API and MCP lines appear only when an HTTP server is composed. Otherwise the banner says none is served, once. Pin both shapes."

  • packages/cli/src/utils/format.ts. Adds a required field to ServerReadyOptions: httpServer: HttpServerComposition, one of 'composed' | 'skipped-by-no-server' | 'not-composed'. printServerReady prints the address rows only for 'composed'. The address rows are API:, Console:, MCP: with its connect hint, and the paths-only note. Otherwise it prints none of them, and one line: ➜ No HTTP server: --no-server was given and no plugin composed one, so no API or MCP address is served. For 'not-composed', the --no-server was given and clause is left out. The ready line and every row that names no address do not change.
  • packages/cli/src/commands/serve.ts. Adds readComposedHttpServer(kernel), which is the http.server read resolveBoundPort already did, moved into its own function. resolveBoundPort and the new resolveHttpServerComposition(kernel, flags.server) both call it, and the banner thunk gets httpServer from it. The answer comes from the booted kernel, not from flags.server. A config that mounts its own HonoServerPlugin under --no-server has a registered http.server, so its address rows still print. flags.server only decides whether the line names --no-server. Two comments said the banner's API: row always names the bound address; they now say when it does.
  • ⛔ Not changed: the objectstack:listening IPC message, runtime.ENV.PROJECT.json (publishBoundPort), flags, exit codes, exports and packages/spec. utils/format.ts is not a published export of @objectstack/cli.
  • .changeset/23623-no-server-banner-urls.md. An @objectstack/cli patch describing the banner's two shapes.

One departure from the dispatch's suggested route

The dispatch suggested an optional field whose default keeps today's output. This PR makes the field required instead. The defect is that a missing fact is read as "a server is listening". An optional field that defaults to 'composed' would bring that back for the next caller that leaves it out. The same interface already does this for externalBaseOrigin: "Required on purpose: an absent field must not be able to mean http://localhost:PORT again by omission." The cost is one httpServer: 'composed' line in the base literal of 13 existing banner pins. tsc named 11 of them; the other two cast with as ServerReadyOptions and were found by reading. None of their assertions changed.

Measured shapes

Each boot ran node packages/cli/bin/run.js serve objectstack.config.ts --port PORT ARGS on the built CLI, spawned with an IPC channel. NODE_ENV was unset except under --dev, and OS_CLOUD_URL=off. The fixture is a throwaway host config with one object and one plugin instance. Before is base 9bb93706f; after is 30b5c246e. The port probe is a GET sent right after the banner, before the child is stopped.

Shape Before: address rows After: address rows Port probe (before and after)
production --no-server --preset minimal (the card's command) API: http://localhost:PORT/, MCP: http://localhost:PORT/api/v1/mcp and the connect hint ➜ No HTTP server: --no-server was given and no plugin composed one, so no API or MCP address is served ECONNREFUSED on /, /api/v1/health, /api/v1/mcp
--dev --no-server API:, MCP: and the hint the same one line ECONNREFUSED on all three
production default, OS_DATABASE_URL and an auth secret (control) API:, MCP: and the hint unchanged / 302, /api/v1/health 200, /api/v1/mcp 401
production --no-server --preset minimal with a config that mounts its own HonoServerPlugin (control) API:, MCP: and the hint unchanged / 404, /api/v1/health 404, /api/v1/mcp 404, /api/v1/data/fx_task 401

Tests

Everything below ran on 30b5c246e (HEAD), after pnpm turbo run build --filter=@objectstack/cli (61 tasks, exit 0).

  • src/utils/format.server-ready-no-http-server.test.ts (new, unit):

    • the composed shape: rows as before, and the paths-only note still prints;
    • skipped-by-no-server with mcpEnabled: true, uiEnabled and consolePath: no address row, no http:// anywhere, exactly one line, and it names --no-server;
    • not-composed: one line, and it does not name --no-server;
    • the paths-only note is dropped along with the rows;
    • four cases checking that the composed banner minus its address rows equals the no-server banner minus its line, for healthy and DEGRADED boots.
  • src/commands/serve-http-server-composition.test.ts (new, unit):

    • http.server registered gives composed, whatever the flag;
    • nothing registered under --no-server gives skipped-by-no-server;
    • nothing registered with the flag on gives not-composed;
    • only the canonical name is asked for, the same one resolveBoundPort asks for;
    • only the deprecated http-server alias registered gives not-composed.
  • src/commands/serve-no-server-banner.integration.test.ts (new). vitest-tiers.ts's predicate puts it in the integration tier. It boots the built CLI four times, once per shape in the table:

    • production --no-server and --dev --no-server: no API:, Console: or MCP: row, no connect hint, and one line naming --no-server;
    • the default control: an MCP: row, and the API: port answers health with 200;
    • the config-mounted Hono control: no no-server line, and the API: port answers HTTP.

    It declares // test-budget: 30: two local runs took 16.1 s and 16.5 s on a shared container, times 1.25, rounded up. It lives under src/ because the dispatch's file surface is packages/cli/src/**. src/ cannot import test/helpers/serve-process.ts, so its env strip and port probe are local, as in src/commands/migrate/*.integration.test.ts.

  • New and touched banner pins: vitest run over the 17 files: Test Files 17 passed (17), Tests 202 passed (202).

  • Unit layer: pnpm --filter @objectstack/cli exec vitest run --project unit --maxWorkers=2 --shard=K/4, for K = 1 to 4. It is sharded because one unsharded run ran past the container's 10-minute foreground cap. Files: 75 + 74 + 74 + 74. Tests: 1369 + 1079 + 886 + 1043 = 4377, all passed.

  • Integration, scoped. The diff adds an integration-tier file and edits serve.ts; the rest of that tier is CI's. I ran the new pin plus four existing .integration files: test/serve-no-storage-boot-guard, serve-host-config-metadata-door, serve-view-container-read and serve-migrate-exit-schema-parity. Result: Test Files 5 passed (5), Tests 22 passed (22).

  • Typecheck: pnpm --filter @objectstack/cli typecheck, exit 0 (tsc --noEmit, then check:test-typecheck: OK). --listFilesOnly counts the three new files in the tsc program.

  • Ablation, run after the fix was committed, through node scripts/ablation-replace.mjs in wrap mode (it restores on exit):

    • Mutation: the API: row moved back above if (opts.httpServer === 'composed'), so it prints unconditionally again, with a marker comment. Anchor x1 to x0; blob be095f8d3d42 to f3a63ad76d42.
    • After rebuilding the CLI, node scripts/ablation-dist-preflight.mjs @objectstack/cli 'ablation-23623' found the marker in 1 built file.
    • The two pins: Tests 9 failed | 4 passed (13). All 7 no-server unit cases and both no-server boots failed with an address row printed; the composed cases and both boot controls passed.
    • Restore: blob back to be095f8d3d42, which is HEAD; git diff HEAD and git status --porcelain both empty. After a rebuild, preflight --absent found the marker in none of the 636 built files, and the pins passed: Tests 13 passed (13).

Gates

  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on 30b5c246e derives 66 commands. Each exit code was recorded before any pipe, and all 66 exited 0. pnpm check:dual-build-cjs-loads and pnpm check:i18n-coverage first exited 3 (PREREQUISITE NOT MET: packages outside the CLI's closure had no dist/); after those were built, both exited 0. --ran reports 66 derived famil(ies) accounted for — 66 run, 0 NOT-MEASURED.
  • Lint: pnpm exec eslint packages/cli --no-inline-config exited 0 with no output. --format json over the five changed code files reports 0 messages, and --print-config shows active rules for them. Repo-wide pnpm lint is CI's.
  • CI check-runs: not read yet; they start when this PR opens.

Acceptance notes

  • The machine channels on a --no-server boot were read, not changed. The objectstack:listening IPC message is still sent as { type: 'objectstack:listening', port: PORT, url: 'http://localhost:PORT' }, for a port nothing listens on. content/docs/deployment/cli.mdx documents that message as "The HTTP server is bound." runtime.env_local.PROJECT.json is written with the same port and url. The message's only in-repo consumer is the os dev parent, and it never spawns a --no-server child (os dev has no server flag). Reported to the seat in the os-dev-report.
  • A config-mounted HonoServerPlugin under --no-server. Per the ruling, this shape prints API: and MCP:, and the API: row is pinned. Measured: the API: port answers (a REST data route returns 401), but /api/v1/mcp returns 404, because the dispatcher that mounts it is composed only under --server. So in this shape the MCP: row names a route that is not mounted. It is not changed here, since the ruling keeps the row, and it is not pinned: the integration control checks only the API: row. Reported to the seat.
  • Production --no-server --preset minimal exits on its own. Measured on both base and after, with and without an IPC channel: the banner's last line, Press Ctrl+C to stop, printed 3134 ms after spawn, and the process exited 0 at 3175 ms. --dev --no-server (default preset) stays up. That last line is outside this card's scope; reported to the seat.
  • A comment in start.ts says printServerReady "prints the API: row always". That is still true for os start, which never passes --no-server, so it is left as is.

Generated by Claude Code

…er is composed

With no `http.server` service registered (a `--no-server` boot whose config
mounts no transport of its own), the banner printed `API:` and an MCP connect
URL for a port nothing listened on. It now prints none of the address rows and
one line saying no HTTP server is served, naming `--no-server` only when that
flag is what left the boot without one.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLwgbTSmGMrqsXkBDsiwfG
The banner's two shapes (composed: the address rows as before; not composed:
none of them and one line, naming --no-server only when that flag is the
cause), every row that names no address unchanged between them, and
resolveHttpServerComposition reading the kernel rather than the flag. Every
existing banner pin now states httpServer: 'composed', the field being
required.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLwgbTSmGMrqsXkBDsiwfG
Four boots of the built CLI: production --no-server and --dev --no-server
print no address row and one line naming --no-server; a default boot still
prints API: and MCP: (control); a config that mounts its own HonoServerPlugin
under --no-server still prints API: (control: the read is off the kernel).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLwgbTSmGMrqsXkBDsiwfG
…re the budget; add the changeset

The integration pin's matcher now anchors on the banner's own row, since the
boot diagnostics carry plugins' "No HTTP server available" lines; the controls
probe the port before the child is stopped; the file declares its measured
budget. The changeset describes the banner's two shapes.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLwgbTSmGMrqsXkBDsiwfG
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli, touching 10 documentable anchor(s).

13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/agents.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/ai/connect-mcp.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/ai/index.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/ai/natural-language-queries.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/api/index.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/capabilities/ai.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/deployment/cli.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/deployment/environment-variables.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/deployment/index.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/deployment/self-hosting.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/getting-started/build-with-claude-code.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/permissions/authorization.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/plugins/index.mdx (via http.server (literal, a string literal in readComposedHttpServer; a string literal in resolveBoundPort))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v13.mdx (via /api/v1/mcp (route, a path literal in printServerReady))
  • content/docs/releases/v16.mdx (via /api/v1/mcp (route, a path literal in printServerReady))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: os serve (command, 33 pages)
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 28 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 3b46855fb97365902e1e81a6484cd41bd363e575 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from bd7c34c0bd5f8cf60de86816d60795f4081fec2a — the merge of head 30b5c246e0f60f809411d5a5c821936775379321 into base 3b46855fb97365902e1e81a6484cd41bd363e575, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin bd7c34c0bd5f8cf60de86816d60795f4081fec2a && git checkout bd7c34c0bd5f8cf60de86816d60795f4081fec2a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3b46855fb97365902e1e81a6484cd41bd363e575 30b5c246e0f60f809411d5a5c821936775379321 && git checkout -B drift-repro 3b46855fb97365902e1e81a6484cd41bd363e575 && git merge --no-ff 30b5c246e0f60f809411d5a5c821936775379321

node scripts/docs-audit/affected-docs.mjs --json 3b46855fb97365902e1e81a6484cd41bd363e575

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3b46855fb97365902e1e81a6484cd41bd363e575 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

✅ ACCEPT: PR #23741 at 30b5c246e (#23623, Fixes #23623). It queues once its head is true-green; no contract review is owed

domain:cli seat 1 (#6024) · os-bill · session session_01FLwgbTSmGMrqsXkBDsiwfG · 2026-10-15T23:25Z · holder of claim 6203043845. Report: os-dev-report 6204307328.

席位核对

  1. Shape, read on GitHub:
    • Draft against main, head 30b5c246e. Line 1 is Fixes #23623, the only closing keyword. Line 2 is a bare Clause-②: no. Assignee os-bill.
    • Files: 19, +697 / −27. check-governed-merges --pr 23741: NOT governed (0 of 19 paths). No content/docs/releases/ change. All four commits carry the model-free trailer pair.
    • main has moved 7 commits since the base 9bb93706f. None touches serve.ts or utils/format.ts, and git merge-tree against origin/main 3b46855fb is clean.
  2. The fix, read against the diff:
    • printServerReady prints API:, Console:, MCP: with its hint, and the paths-only note only when httpServer === 'composed'; otherwise one line, naming --no-server only for 'skipped-by-no-server'. Every other row is outside the gate.
    • serve.ts reads the answer off the booted kernel through readComposedHttpServer, the http.server read resolveBoundPort already made, moved out and shared. resolveBoundPort is unchanged in behaviour: the getService throw is still caught, and getPort() still sits inside its own try.
    • The IPC message and the runtime state file are untouched, as ruled.
  3. Measured, not read: four real boots of the built CLI, before and after. Both --no-server shapes drop every address row for the one line, with ECONNREFUSED on the port. The default control keeps its rows (health 200), and so does the config-mounted HonoServerPlugin control.
  4. Deviations, each accepted:
    • httpServer is required, not optional. Right call: an omitted field defaulting to 'composed' would let the defect come back by omission, and externalBaseOrigin in the same interface is required for the same reason. Checked: each of the 13 touched pins gains exactly one line (+1 / −0) and no assertion moves.
    • The boot pin lives under src/commands/, inside the dispatch's surface. It strips the vitest worker env itself, as src/commands/migrate/*.integration.test.ts do; check:cli-test-child-env scans packages/cli/test/** only. Recorded here instead of a PR-body patch (the report's pr_body_changes item).
    • The sharded unit run, the trailer pair, and the two comment corrections in serve.ts are in order.
  5. Clause-②: no holds: printed operator text only; utils/format.ts is not in @objectstack/cli's exports map, so the required field moves no public surface. No contract-review face is touched: under contract-review.md, CI plus this seat's reading.
  6. The changeset, checked sentence by sentence (@objectstack/cli patch): the Before matches the measured boots; the two After paragraphs match the code's two branches and the composed control; the closing paragraph matches the untouched channels.
  7. The open question (the MCP: row under a config-mounted server): the seat takes the dev's option B for this PR. The ruling's premise ("the URLs are true") was measured false for MCP: in that shape, so the residue is a card filed in this act, not a note: cli/serve --no-server, the remainder of #23623: the objectstack:listening IPC message and the runtime state file still announce http://localhost:PORT with nothing listening, and a config-mounted server's banner names an unmounted MCP route #23743, with the IPC and state-file half.
  8. Out of scope, filed in this act:
  9. CI on 30b5c246e, read in this act: every completed run is success or an expected skip, including Check Changeset, Lint · ESLint, Type Check · workspace and Governed Surface Queue Guard. Test Core 1 to 6 of 6 are in_progress, with no failure.

Landing: once every check on 30b5c246e is green, the seat marks the PR ready and arms auto-merge. Fixes #23623 closes the card when it merges.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 15, 2026 23:34
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 15, 2026 23:34
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit 2906cd8 Oct 15, 2026
41 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-23623-no-server-banner-urls branch October 15, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants