Skip to content

plan: extractSolution reads artifacts[] but API returns step.solution #958

Description

@MathurAditya724

Discovery

While testing #951 fix against live API responses, found that extractSolution() in src/types/seer.ts looks for solution data in step.artifacts[].key === "solution" with data: { one_line_summary, steps }, but the Seer API actually returns solution data directly on the step object:

{
  "key": "solution",
  "type": "solution",
  "status": "COMPLETED",
  "description": "One-line summary of the fix plan",
  "solution": [
    {
      "title": "Description of what to change",
      "code_snippet_and_analysis": "...",
      "relevant_code_file": { "file_path": null, "repo_name": "getsentry/repo" }
    }
  ]
}

The artifacts array is always empty on solution steps.

Related issues

  1. triggerSolutionPlanning() sends { run_id, step: "solution" } which may create a new run instead of advancing the existing one. The correct call may be to the /autofix/update/ endpoint with { type: "select_root_cause", cause_id, stopping_point: "solution" }.

  2. The plan command polls until COMPLETED but the API returns NEED_MORE_INFORMATION when a solution is ready (waiting for user to accept/reject). The poll should stop on this status too.

Confirmed with

  • SENTRY-5K7G (7286418866) — 1-step solution
  • MCP-SERVER-FTB (7466005949) — 2-step solution
  • CLI-A0 (7297183155) — 1-step solution

All had status: NEED_MORE_INFORMATION with solution step fully completed and zero artifacts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions