fix(cli): render /journey color instead of leaking raw ANSI

In the interactive CLI, /journey dispatched straight to `args.func(args)`,
letting Rich write ANSI to stdout — which patch_stdout's StdoutProxy passes
through as literal `?[38;2;…m` garbage. Route the read-only views (default +
`list`) through a captured, force-color Console and re-emit via `_cprint`
(prompt_toolkit's ANSI parser), matching the `ChatConsole` idiom.
`delete`/`edit` stay on real stdio since they prompt / open `$EDITOR`.
This commit is contained in:
Brooklyn Nicholson 2026-07-01 16:25:48 -05:00
parent ec319e4e3e
commit 428b9a0c42
4 changed files with 92 additions and 19 deletions

16
cli.py
View file

@ -8640,21 +8640,7 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin):
elif canonical == "agents":
self._handle_agents_command()
elif canonical == "journey":
try:
import argparse
import shlex
from hermes_cli.journey import register_cli as _register_journey_cli
parser = argparse.ArgumentParser(prog="/journey", add_help=False)
_register_journey_cli(parser)
argv = shlex.split(cmd_original.split(None, 1)[1]) if len(cmd_original.split(None, 1)) > 1 else []
args = parser.parse_args(argv)
args.func(args)
except SystemExit:
pass
except Exception as exc:
_cprint(f" /journey failed: {exc}")
self._handle_journey_command(cmd_original)
elif canonical == "background":
self._handle_background_command(cmd_original)
elif canonical == "queue":