feat(cli): background task observability and /bg namespace#8592
Conversation
|
Closing in favor of the minimum-viable fix in PR #27175 (merged), which addresses the core UX gap that motivated #8568 with ~25 LOC: a live Your implementation here was clean and complete — artifacts under Thank you for the contribution — closing this with credit. |
Summary
This PR improves CLI background task observability and fixes the
/bgalias behavior. Background tasks launched with/background <prompt>were previously run in isolated sessions with no durable, user-visible state.Fixes #8568
Why
Previously, the
/backgroundcommand was a "black box" with several limitations:/bg statuswas incorrectly parsed as a new background prompt.Changes
1. Persisted Artifacts
Added profile-safe background task artifact storage under
HERMES_HOME/background_tasks/<task_id>/:manifest.json: Task metadata and current status.log.jsonl: Structured event stream of activity.summary.txt&files.txt: Final result and changed file reporting.2. New
/bgSubcommand NamespaceRegistered
/bgas a dedicated subcommand area to prevent prompt fall-through:/bg status [task-id]/bg log <task-id>/bg files <task-id>/bg kill <task-id>3. Context Awareness
SYSTEMmessages into the foreground session history./statuscommand.How To Test
/background build a small HTML site/bg status/bg log <task-id>/bg files <task-id>~/.hermes/background_tasks/<task-id>/.Tests Run
Passed 38 targeted tests: