Skip to content

fix(cli): name init in the upgrade steps - #608

Merged
theCodeDrift merged 2 commits into
mainfrom
fix/environment-steps-run-init
Nov 4, 2026
Merged

theCodeDrift merged 2 commits into
mainfrom
fix/environment-steps-run-init

Conversation

@theCodeDrift

@theCodeDrift theCodeDrift commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Stack (root → tip):

agent ok and check told the reader to fix a stale CLI or skill by running the CLI with no arguments. That only installs from a terminal, through the wizard. Anywhere else it prints the topic index and exits 0 with nothing changed. Reproduced with no TTY: the manifest was byte-identical afterwards.

  • The cli step is now <launcher> <package>@<latest> init.
  • The skill step is now <invocation> init.
  • The cli-agent spec is updated and archived here (single PR). All 84 scenarios survive the archive.

Not in this PR: when agent ok runs through the project launcher, the cli step still spells the package runner with the agent-fill marker, because the launcher is not npx. A proposal for upgrading through the launcher follows separately and covers that.

A bare run installs only from a terminal. Anywhere else it prints the topic index and exits 0 having changed nothing, so the cli and skill steps from agent ok and check could not work outside one.
@theCodeDrift

Copy link
Copy Markdown
Member Author

@claude /review

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @theCodeDrift's task in 1m 38s —— View job


Review mode: incremental — read 0 prior review thread(s) before reviewing.

.prior-review.json contained no review threads, review summaries, or prior top-level comments (only the @claude /review trigger itself) — this is the first review of this PR, so the whole diff was assessed fresh.

Summary

Small, well-scoped fix. The problem statement checks out: init is exempt from the CLI version gate (packages/cli/src/install/version-gate.ts:41-46) and is the one command that performs a non-interactive batch install (packages/cli/src/commands/init.ts:99-105), while a bare invocation only reaches the wizard in a TTY (packages/cli/src/util/interactive.ts, packages/cli/src/index.ts:138). Pointing the cli and skill fixing commands at init instead of a bare invocation is correct and matches the design doc's rationale.

Verified:

  • packages/cli/src/install/freshness.ts:155,172 — command strings now append init; the resulting strings (${launcher} ${package}@${version} init, ${invocation} init) compose correctly with how invocation/launcher are built in commands/agent.ts:307-320 and commands/check.ts:218-223, including the agent-fill-marker fallback for an undetected launcher.
  • packages/cli/test/freshness.test.ts — all three updated assertions match the new command shape.
  • openspec/specs/cli-agent/spec.md diff mirrors the code change exactly, and the archived copy under openspec/changes/archive/2026-11-04-environment-steps-run-init/ is identical in substance.
  • The design doc's risk note ("init skips the wizard's confirmations, including global trust, and reports it as a SKIPPED (global): line") matches actual behavior in packages/cli/src/install/global-trust.ts.
  • No other stale "run with no arguments" fixing-command text was left behind elsewhere in the spec tree; the remaining "no arguments" hits in openspec/specs/ refer to unrelated scenarios (bare taskless agent/taskless showing an index/help, or the installer invocation in a terminal), not this fixing-step text.

Minor, non-blocking observation:

  • packages/cli/test/agent-ok.test.ts:131,142 and packages/cli/test/check-environment-notice.test.ts:110 assert the cli-step command with toContain(...) on the package/version substring only, so they'd have passed even before this fix added init. Not broken by this PR and out of scope for a two-line behavior change, but worth knowing these integration tests don't themselves pin down the init suffix the way freshness.test.ts does.

No correctness, security, or performance issues found in the diff.

These assertions matched the package and version only, so they passed before the steps named init.
@theCodeDrift

Copy link
Copy Markdown
Member Author

Re: @github-actions[bot] — "Claude finished @theCodeDrift's task in 1m 38s… Minor, non-blocking observation"
#608 (comment)

Tightened in 1e2915c: the three assertions in agent-ok.test.ts and check-environment-notice.test.ts now pin the init suffix.

— AI Coding Agent

@theCodeDrift
theCodeDrift added this pull request to stack #610 November 4, 2026 20:33
@theCodeDrift
theCodeDrift merged commit 1dd6959 into main Nov 4, 2026
4 checks passed
@theCodeDrift
theCodeDrift deleted the fix/environment-steps-run-init branch November 4, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant