fix(cli/session): emit JSON envelope in session delete for non-rich formats #10888

Open
HAL9000 wants to merge 5 commits from bugfix/m6-session-delete-format-json-envelope into master

5 Commits

Author SHA1 Message Date
CleverAgents Bot a24d50312c ci: stop master workflow on PR updates
CI / lint (pull_request) Has been cancelled
CI / typecheck (pull_request) Has been cancelled
CI / security (pull_request) Has been cancelled
CI / quality (pull_request) Has been cancelled
CI / unit_tests (pull_request) Has been cancelled
CI / integration_tests (pull_request) Has been cancelled
CI / e2e_tests (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / helm (pull_request) Has been cancelled
CI / push-validation (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
Remove the stale pull_request trigger from master.yml so PR branch commits do not launch the master workflow.

Maintenance patch for PR #10888.
2026-06-10 20:22:19 -04:00
HAL9000 417f492e8d fix(cli/actor): catch typer.Exit alongside click.exceptions.Exit in run commands
CI / lint (pull_request) Successful in 1m16s
CI / quality (pull_request) Successful in 1m25s
CI / benchmark-publish (pull_request) Has been skipped
CI / typecheck (pull_request) Successful in 2m4s
CI / security (pull_request) Successful in 2m8s
CI / build (pull_request) Successful in 49s
CI / push-validation (pull_request) Successful in 48s
CI / helm (pull_request) Successful in 1m0s
CI / integration_tests (pull_request) Successful in 4m36s
CI / e2e_tests (pull_request) Successful in 4m47s
CI / unit_tests (pull_request) Failing after 9m24s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 23m51s
CI / status-check (pull_request) Failing after 4s
Typer 0.26.7 ships its own typer._click.exceptions.Exit(RuntimeError)
which is separate from click.exceptions.Exit(BaseException). The existing
`except click.exceptions.Exit: raise` handler in actor.py and actor_run.py
did not catch typer.Exit, causing it to fall through to the broad
`except Exception` handler and exit with code 3 instead of 2.

Fix: change to `except (click.exceptions.Exit, typer.Exit): raise` in both
run() commands so typer.Exit propagates correctly through the try block.

Also update the BDD step definitions for actor_run_signature tests to add
typer.Exit to their except clauses. The steps used `except (SystemExit,
click.exceptions.Exit)` which also did not catch typer.Exit, causing those
scenarios to error rather than capture the exit code.

ISSUES CLOSED: #10461
2026-06-07 02:04:27 -04:00
HAL9000 d7d7fc8b94 style(tdd): collapse single-line function signature in step definitions
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 26s
CI / helm (pull_request) Successful in 30s
CI / lint (pull_request) Successful in 36s
CI / build (pull_request) Successful in 42s
CI / quality (pull_request) Successful in 58s
CI / typecheck (pull_request) Successful in 1m9s
CI / security (pull_request) Successful in 1m24s
CI / integration_tests (pull_request) Failing after 3m57s
CI / e2e_tests (pull_request) Successful in 4m18s
CI / unit_tests (pull_request) Failing after 6m2s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 11m56s
CI / status-check (pull_request) Failing after 3s
ruff format required collapsing the step_delete_format_envelope_exit_code
signature onto one line (fits within the 88-char line limit).

ISSUES CLOSED: #10461
2026-06-07 00:04:26 -04:00
HAL9000 f1d02f984d fix(cli/session): pass command string to format_output in session delete
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 39s
CI / build (pull_request) Successful in 48s
CI / quality (pull_request) Successful in 1m3s
CI / lint (pull_request) Failing after 1m8s
CI / security (pull_request) Successful in 1m24s
CI / coverage (pull_request) Has been skipped
CI / typecheck (pull_request) Successful in 1m28s
CI / push-validation (pull_request) Successful in 1m37s
CI / e2e_tests (pull_request) Successful in 3m42s
CI / integration_tests (pull_request) Successful in 4m45s
CI / unit_tests (pull_request) Successful in 6m15s
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s
Address reviewer feedback: pass command="agents session delete" to
format_output() for consistency with other session commands (create,
list, show) which all pass a descriptive command string to the envelope.

This ensures the JSON/YAML envelope command field is populated with a
meaningful value rather than an empty string.
2026-05-05 14:56:08 +00:00
HAL9000 8fc2b93a2a fix(cli/session): emit JSON envelope in session delete for non-rich formats
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 33s
CI / lint (pull_request) Failing after 58s
CI / build (pull_request) Successful in 41s
CI / push-validation (pull_request) Successful in 30s
CI / quality (pull_request) Successful in 1m9s
CI / typecheck (pull_request) Successful in 1m17s
CI / security (pull_request) Successful in 1m37s
CI / coverage (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 3m26s
CI / e2e_tests (pull_request) Successful in 4m2s
CI / unit_tests (pull_request) Successful in 5m36s
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s
Replace the bare console.print() Rich markup call in the session delete
command's non-rich branch with a proper format_output() call that emits
a spec-compliant JSON/YAML/plain envelope.

The else branch previously called:
  console.print(f"[green]✓ OK[/green] Session {session_id} deleted")
which emitted raw Rich markup to stdout, breaking any downstream JSON
parser. The fix constructs a data dict with session_id, messages_removed,
storage_freed, and plans_orphaned fields and delegates to format_output().

Also adds BDD feature file and step definitions tagged @tdd_issue_10461
that verify the JSON envelope output and confirm no regression in the
default Rich console output path.

ISSUES CLOSED: #10461
2026-04-28 07:43:06 +00:00