Bug Description
When using /background <prompt> in the CLI, the background task runs in a completely isolated session. Once it completes, the user gets a summary text box — but nothing else. There is no way to:
- See what files were created/modified — the background agent may scaffold an entire project, but the foreground agent and user have zero visibility into what changed on disk
- Access logs of what the background agent did — no tool call history, no terminal output, no execution trace
- Query status from the foreground agent — asking "how far is the background task" gets "no active task" because the foreground agent's session has no reference to background sessions
- Use
/bg status — this gets parsed as /background status which spawns a NEW background task with the prompt "status" instead of showing background task status
Steps to Reproduce
- Run
/background can you code on port 7373 an html website about brudi ai
- While it runs, ask the foreground agent: "how far is the background task?"
- Agent responds with "no active task" — it has no knowledge of the background session
- When the task completes, the ✅ notification appears with a summary
- Ask the agent to clean up the files from that task — it doesn't know which files were created
- Try
/bg status — it spawns a new background task with prompt "status"
Expected Behavior
- Background tasks should write a structured log (files created/modified, commands run, errors) to a known location (e.g.
~/.hermes/background_tasks/<task_id>/)
- The foreground agent should be able to query background task status and results
/bg status, /bg log <id>, /bg files <id> should be dedicated subcommands, not parsed as new background prompts
- On completion, the task summary should be injected into the foreground session history so the agent has context
Actual Behavior
- No logs written anywhere
- No file tracking
- Foreground agent has zero context about background tasks
/bg prefix is not parsed as a subcommand namespace
Root Cause
_handle_background_command() in cli.py:5580 creates a separate AIAgent with its own session_id. The docstring explicitly states: "prints the result to the CLI without modifying the active session's conversation history". This means the foreground session never learns about background task results.
The /bg prefix is not registered as a separate command — it falls through to /background which treats everything after it as a prompt.
Affected Component
CLI (interactive chat)
Operating System
Ubuntu 24.04
Python Version
3.12.3
Hermes Version
Hermes Agent v0.8.0
Proposed Fix
-
Minimal fix: On background task completion, inject a [SYSTEM: Background task #N completed. Files changed: ... Summary: ...] message into the foreground session history so the agent has context on next turn.
-
Better fix: Write a structured log per background task to ~/.hermes/background_tasks/<task_id>/ containing:
log.jsonl — tool calls and results
files.txt — list of files created/modified/deleted
summary.txt — the final agent response
-
Register /bg as a subcommand namespace with status, log, files, kill subcommands.
Are you willing to submit a PR for this?
Bug Description
When using
/background <prompt>in the CLI, the background task runs in a completely isolated session. Once it completes, the user gets a summary text box — but nothing else. There is no way to:/bg status— this gets parsed as/background statuswhich spawns a NEW background task with the prompt "status" instead of showing background task statusSteps to Reproduce
/background can you code on port 7373 an html website about brudi ai/bg status— it spawns a new background task with prompt "status"Expected Behavior
~/.hermes/background_tasks/<task_id>/)/bg status,/bg log <id>,/bg files <id>should be dedicated subcommands, not parsed as new background promptsActual Behavior
/bgprefix is not parsed as a subcommand namespaceRoot Cause
_handle_background_command()incli.py:5580creates a separateAIAgentwith its ownsession_id. The docstring explicitly states: "prints the result to the CLI without modifying the active session's conversation history". This means the foreground session never learns about background task results.The
/bgprefix is not registered as a separate command — it falls through to/backgroundwhich treats everything after it as a prompt.Affected Component
CLI (interactive chat)
Operating System
Ubuntu 24.04
Python Version
3.12.3
Hermes Version
Hermes Agent v0.8.0
Proposed Fix
Minimal fix: On background task completion, inject a
[SYSTEM: Background task #N completed. Files changed: ... Summary: ...]message into the foreground session history so the agent has context on next turn.Better fix: Write a structured log per background task to
~/.hermes/background_tasks/<task_id>/containing:log.jsonl— tool calls and resultsfiles.txt— list of files created/modified/deletedsummary.txt— the final agent responseRegister
/bgas a subcommand namespace withstatus,log,files,killsubcommands.Are you willing to submit a PR for this?