Skip to content

Commit ef6a9ac

Browse files
committed
fix(cli): log stream shows error on finish
Signed-off-by: Radek Ježek <radek.jezek@ibm.com>
1 parent bc88578 commit ef6a9ac

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

  • apps/agentstack-cli/src/agentstack_cli

apps/agentstack-cli/src/agentstack_cli/utils.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,15 @@ class CustomError(Exception): ...
309309
def decode(text: str):
310310
return Text.from_ansi(text) if ansi_mode else text
311311

312-
if line["stream"] == "stderr":
313-
(out_console or err_console).print(decode(line["message"]))
314-
elif line["stream"] == "stdout":
315-
(out_console or console).print(decode(line["message"]))
312+
match line:
313+
case {"stream": "stderr"}:
314+
(out_console or err_console).print(decode(line["message"]))
315+
case {"stream": "stdout"}:
316+
(out_console or console).print(decode(line["message"]))
317+
case {"event": "[DONE]"}:
318+
return
319+
case _:
320+
(out_console or console).print(line)
316321

317322

318323
def is_github_url(url: str) -> bool:

0 commit comments

Comments
 (0)