Skip to content

Plan review menus incompatible with strict OpenAI-compatible backends — add compatibility fallback #3846

Description

Problem
Plan review menus rely on model responses that include structured function/tool calls or model-specific output formats. On strict OpenAI-compatible backends (that do not expose function_call metadata or use a stricter chat-completions format), the CLI shows an empty or unusable plan review menu.

Reproduction

  1. Configure CLI to use a strict OpenAI-compatible backend.
  2. Run /plan and attempt to open the plan review/approval menu.
  3. Menu options are missing or malformed; recommended actions are not presented.

Proposed fix

  1. Add capability detection: when the LLM response lacks function_call/tool metadata, fall back to a plaintext-parsing path.
  2. Fallback parsing should accept simple formats the model can produce on strict backends:
    • JSON arrays/objects if present in text
    • Numbered or bulleted lists ("1.", "- Option: ...")
    • A simple marker like ---MENU--- block or YAML front-matter
  3. Prefer a deterministic parser (attempt JSON first, then list heuristics) to build the menu items.
  4. Add unit and integration tests that simulate strict-backend responses (no function_call, no tool metadata) to prevent regressions.
  5. Update the plan-mode e2e tests and changelog.

Why
This keeps the richer function-calling behavior when available while ensuring users on strict OpenAI-compatible backends still get usable plan review menus.

If maintainers are ok with this approach I can open a PR implementing the fallback parser and tests. Please advise if you'd prefer a stricter parsing format (e.g., requiring a special MENU: block).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions