Skip to content

feat: surface inference failures in CLI with recovery hints (not as agent speech) #37

@rosspeili

Description

@rosspeili

Problem Statement

When LiteLLM or a custom function fails, Agent.generate_response() returns strings such as [Error: ...] or [Timeout Error: ...]. cli.py prints these as normal agent dialogue (colored name + content).

Users cannot distinguish a failed inference from in-character speech, and there is no in-session guidance (retry turn, skip agent, check model/API key, increase timeout).

Proposed Solution

  • Detect error/timeout prefixes in the session loop (small helper, e.g. is_inference_failure(content)).
  • Render a distinct Rich panel (not agent voice): model id, failure type, and hints (Ollama down, wrong tag, API key, raise defaults.timeout in settings).
  • Optional prompts: retry this turn / skip agent / end session (CLI only; does not replace agent-level retries in feat: implement retry_count for agent completions #8).
  • Add unit tests with mocked Session.generate_next_turn or agent responses.

Alternatives Considered

  • Only implement feat: implement retry_count for agent completions #8 retry_count in agent.py — rejected; users still see opaque error text as dialogue if all retries fail.
  • Raise exceptions and crash the session — rejected; too brittle for long multi-agent runs.
  • Log errors only to stderr — rejected; misses the primary UX surface (terminal).

Priority

High 🔴

Additional Context

Works with timeouts already on main and with future #8 retries (retry in agent, clear UI in CLI). Not a duplicate of #23 (Skillware/tools). Consider doing after or in parallel with preflight (#2 above).

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliImprovements to the interactive wizard or terminal output.enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions