Skip to content

fix(cli): clarify exception diagnostics#2602

Open
darion-yaphet wants to merge 1 commit into
github:mainfrom
darion-yaphet:improve-exception-diagnostics
Open

fix(cli): clarify exception diagnostics#2602
darion-yaphet wants to merge 1 commit into
github:mainfrom
darion-yaphet:improve-exception-diagnostics

Conversation

@darion-yaphet
Copy link
Copy Markdown
Contributor

Description

Improves CLI error diagnostics for broad exception and best-effort paths.

This PR keeps the existing fail-fast behavior for real setup failures, but makes user-facing errors more actionable by including the operation phase, target
integration/preset/workflow, and underlying exception detail where available. It also keeps optional best-effort failures as warnings with clearer context, so users
can understand what failed and what continued.

It also fixes workflow tests that could accidentally invoke a real local agent CLI, such as gemini, causing uv run pytest to hang on developer machines where that
CLI is installed.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv run pytest
  • Ran lint with uvx ruff check src/
  • Tested with a sample project (if applicable)

Results:

  • uvx ruff check src/ passed
  • uv run pytest passed: 2917 passed, 34 skipped, 19 warnings

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

Used AI assistance to identify broad CLI exception-handling paths, implement clearer diagnostics, add regression coverage, and run/fix local verification.

Consolidate the CLI diagnostic plan, implementation, and test hardening into one reviewable change. The CLI now reports phase and target context for broad failure paths while preserving existing fail-fast behavior for real setup failures and warning-only behavior for optional best-effort work.

The workflow unit tests also avoid discovering real local agent CLIs, so developer machines with tools such as gemini installed do not hang pytest during metadata-only assertions.

Constraint: CLI setup failures must remain fail-fast, while optional preset and cleanup paths should continue with clear warnings.

Rejected: Replace broad handlers across the whole codebase in one pass | too broad for a targeted CLI diagnostic fix

Rejected: Add runtime timeouts to workflow agent dispatch | dispatch may legitimately be long-running and the observed hang was test isolation

Confidence: high

Scope-risk: moderate

Directive: Keep future best-effort CLI warnings tied to the failed phase and target so users can diagnose setup state.

Tested: uvx ruff check src/; uv run pytest tests/integrations/test_cli.py -v; uv run pytest tests/test_workflows.py::TestCommandStep::test_step_override_integration tests/test_workflows.py::TestPromptStep::test_execute_with_step_integration tests/test_workflows.py::TestPromptStep::test_execute_with_model -vv; uv run pytest

Not-tested: Real Nacos/PG/Redis-style external service failure injection; real interactive workflow dispatch against installed gemini CLI
@darion-yaphet darion-yaphet requested a review from mnriem as a code owner May 16, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant