Skip to content

feat(commands): a command says how long it runs - #164

Merged
leemour merged 1 commit into
mainfrom
feat/command-lifetime
Oct 15, 2026
Merged

leemour merged 1 commit into
mainfrom
feat/command-lifetime

Conversation

@leemour

@leemour leemour commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Step 6, PR 1 of the architecture re-review: commands described by declaration.

Change:

  • CommandMeta.lifetime: persistent runs until stopped (a server, a watch); interactive waits for a person (a login). Unset, the command is bounded by the runner's default timeout.
  • CommandMeta.cooperative: the command stops at its own pace when the run is aborted from outside, and keeps what it already did.
  • Both are set with annotate, printed in commands --json, and covered by the command-document schema.

Why: cli-core's run() decides these today by matching command names (program.ts:208-231: watch, serve, mcp, bot watch, setup, session start, messages sync). Once released, cli-core annotates those commands and reads metaOf(action) instead.

Checks:

  • pnpm lint, pnpm typecheck, pnpm test (713 tests, one new: both fields in the document and read back) and pnpm docs:check pass.
  • REFERENCE.md describes both fields.

🤖 Generated with Claude Code

CommandMeta gains `lifetime` (persistent until stopped, interactive until a
person answers; unset is bounded) and `cooperative` (stops at its own pace
when aborted from outside), set with annotate and printed in commands --json.
cli-core's run() decides these today by matching command names
(watch/serve/mcp, setup, session start, messages sync); with the fields it can
read metaOf(action) instead. Re-review step 6, PR 1.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@leemour
leemour merged commit 8e772ee into main Oct 15, 2026
2 checks passed
@leemour
leemour deleted the feat/command-lifetime branch October 15, 2026 22:49
@leemour leemour mentioned this pull request Oct 15, 2026
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