feat(cli): step ask — read-only query to historical step sessions
CI / check (pull_request) Successful in 2m46s

Adds `uwf step ask <step-hash> -p <prompt>` for asking follow-up
questions to a completed step's agent without mutating thread state.

- Fork-by-default: creates and caches a fork session per step (cache
  key `<stepHash>:ask`); subsequent asks reuse it.
- `--no-fork` fallback: spawns a fresh session with the step's detail
  ref injected as context.
- `--agent` overrides the recorded agent; otherwise resolves from the
  step's agent field via config alias.
- Updates `packages/cli/README.md` and `packages/util/src/usage-reference.ts`
  so the new subcommand is discoverable via README and `uwf prompt usage`.

Fixes #146
This commit is contained in:
2026-06-07 10:33:41 +00:00
parent e9e896146e
commit b5e094ab4d
6 changed files with 951 additions and 2 deletions
+18
View File
@@ -0,0 +1,18 @@
---
"@united-workforce/cli": minor
"@united-workforce/util": patch
---
feat(cli): add `uwf step ask <step-hash> -p <prompt>` read-only follow-up command
Phase 2b of the ask-session work. Adds a new subcommand that lets the user ask
a follow-up question to a historical step's agent without writing a new
`StepNode` or mutating thread state. The command resolves the agent from the
recorded step (or `--agent <cmd>` override), forks the original session via the
adapter's `--mode fork --session <source>` contract, caches the resulting
ask-session id under `<stepHash>:ask` so subsequent asks reuse it, then invokes
the agent with `--mode ask --session <forkId> --prompt <text> --detail <ref>`
and streams the raw stdout to the caller. `--no-fork` falls back to a fresh
session that receives the step's detail ref for context. The `prompt usage`
reference (in `@united-workforce/util`) is also updated so agents discover the
new subcommand. Resolves issue #146.