typer.Exit (v0.26.7) inherits from typer._click.exceptions.Exit and
RuntimeError, not click.exceptions.Exit. The existing
`except click.exceptions.Exit: raise` guards in actor.py and
actor_run.py therefore did not re-raise Exit(code=2) from
_resolve_config_files; it fell through to `except Exception` and was
re-raised as Exit(code=3). Similarly, step definitions catching
(SystemExit, click.exceptions.Exit) failed to intercept typer.Exit,
causing resolve_config_files error-path scenarios to error instead of
fail cleanly.
Fix the except clauses in both CLI entry-points and in the three
affected step files. Also correct the plan_explain step that created
a decision with none of the alternatives matching chosen_option, so
exactly one alternative now has chosen=True as the spec requires.
ISSUES CLOSED: #9166
Convert alternatives_considered list of strings to structured objects with
index (1-based), description, and chosen fields in _build_explain_dict().
Rename output field from alternatives_considered to alternatives.
Update BDD tests in plan_explain.feature, plan_explain_cli_coverage.feature,
and plan_explain_steps.py to validate the new structured format.
Closes#9166
The step_tree_json_valid BDD step was asserting a raw list from
format_output, but the function wraps all machine-readable output in
a spec-required envelope dict ({"data": [...]}). This PR fixes the
step to correctly validate the envelope structure (dict with data key)
and removes @tdd_expected_fail from the @tdd_issue_4254 scenario so
it runs as a permanent regression guard.
The code producing decision_id in tree nodes was already correct; only
the test assertion needed fixing.
ISSUES CLOSED: #9096
- Remove @tdd_expected_fail from Tree with json format scenario in
plan_explain.feature (bug is now fixed by the envelope implementation)
- Update scenario assertions to verify new spec-required envelope format
instead of old bare-array format
- Add step_tree_json_valid_envelope step definition in plan_explain_steps.py
- Fix ruff format violation in plan_explain_cli_coverage_steps.py
ISSUES CLOSED: #9163
Rename step texts to avoid case-sensitive conflicts between different step modules:
- edge_case_plan_steps.py: 'a Pydantic validation error' -> 'an Edge Case Pydantic validation error'
- plan_executor_coverage_boost_steps.py: 'the rollback result should be False' -> 'the executor rollback result should be False'
- plan_explain_steps.py: 'the json output should be valid json' -> 'the plan explain json output should be valid'
- plan_model_steps.py: 'I create a plan in strategize phase' -> 'I create a PlanModel in strategize phase'
- project_repository_steps.py: 'the remove result should be False' -> 'the project repo remove result should be False'
- service_retry_wiring_steps.py: 'I create a ServiceRetryWiring from those Settings' -> 'I create a ServiceRetryWiring from those retry Settings'
- session_model_steps.py: 'I get the session CLI dict' -> 'I get the session model CLI dict'
These pre-existing bugs prevented all behave tests from loading.
Modified the agents plan tree command to display full 26-character ULIDs
instead of truncating them to 8 characters. This enables users to copy
decision IDs directly from the tree output and use them in follow-up
CLI commands without manual ID reconstruction.
Key changes:
- Removed [:8] truncation from all decision ID displays (table, tree)
- Updated table column width from 8 to 26 characters for full ULID display
- Removed [...] truncation from plan ID in tree title
- Added 'Decision IDs (for correction)' section listing all decision ULIDs
with human-readable labels for easy reference
- Supports both rich (with panel) and plain text formatting
- Helper function _get_decision_label() generates appropriate labels
based on decision type
- Updated CHANGELOG.md per CONTRIBUTING.md requirements
ISSUES CLOSED: #5825
The format_output() function returned a string that callers passed to
Rich console.print(), which wraps long lines at terminal width. This
injected literal newline characters into JSON string values (e.g. in
definition_of_done fields), producing invalid JSON that downstream
parsers could not decode (JSONDecodeError: Invalid control character).
For machine-readable formats (json, yaml, plain), format_output() now
writes the rendered output directly to sys.stdout and returns an empty
string. This preserves the exact serialization from json.dumps/
yaml.dump without Rich text processing artifacts.
Refs: #746
- Remove global _PLAN_ID; generate per-step plan IDs on context (#8)
- Fix sham orphan test; build children_map from all decisions (#1)
- Delete dead constants; use _PATCH_RESUME_SVC_MOD in resume steps (#2)
- Remove dead _resolve_active_plan_id mock from _invoke_correct (#5)
- Make --mode/--guidance required Typer options (#3)
- Show alternatives by default; remove --show-alternatives flag (#4)
- Strengthen weak assertions on depth-limit and show-superseded (#6)
- Add negative assertions for error type conflation (#7)
ISSUES CLOSED: #174
- Add justification to type: ignore comments in build_decision_tree
- Remove Any from step file signatures, use object instead
- Strengthen non-existent decision test to verify ID exclusion
- Fix O(n²×d) depth computation in table view with dict lookup
- Fix orphan root detection in rich-view to match BFS logic
- Add type annotations to Robot helper dispatch dict
- Deduplicate import json in explain_decision_cmd
ISSUES CLOSED: #174
Add `plan explain` and `plan tree` CLI commands that format decision
trees in json/yaml/table/rich formats. Flags control views for
superseded decisions, context snapshots, and reasoning details.
- plan explain <decision_id>: renders a single decision with optional
--show-context, --show-reasoning, --show-alternatives flags
- plan tree <plan_id>: renders full decision tree with optional
--show-superseded and --depth flags
- BFS tree building uses collections.deque (no list.pop(0))
- Behave BDD scenarios (14 scenarios, 54 steps)
- Robot Framework smoke tests with helper script
- ASV benchmarks for explain formatting and tree operations
- Updated docs/reference/plan_cli.md and CHANGELOG.md
ISSUES CLOSED: #174