Skip to content

feat: migrate autofix to agent-based (explorer) endpoint#962

Open
MathurAditya724 wants to merge 2 commits into
mainfrom
issue-961-migrate-autofix-agent-endpoint
Open

feat: migrate autofix to agent-based (explorer) endpoint#962
MathurAditya724 wants to merge 2 commits into
mainfrom
issue-961-migrate-autofix-agent-endpoint

Conversation

@MathurAditya724
Copy link
Copy Markdown
Member

Switches all Seer autofix API calls to the agent-based endpoint (?mode=explorer), which returns blocks instead of steps. This is the path forward — the old endpoint will be deprecated.

  • API layer uses apiRequestToRegion with mode=explorer instead of @sentry/api SDK functions
  • Status values normalized from agent lowercase (processing, completed, error, awaiting_user_input) to CLI uppercase
  • Root cause extraction handles both agent artifact format (key: "root_cause") and legacy step format
  • triggerSolutionPlanning simplified: posts step: "solution" with run_id instead of legacy select_root_cause update
  • --cause flag removed from issue plan (agent determines the root cause)

Testing

bun test test/lib/api-client.seer.test.ts test/types/seer.test.ts test/lib/formatters/seer.test.ts test/commands/issue/utils.test.ts — 140 tests pass.

Closes #961

MathurAditya724 and others added 2 commits May 13, 2026 10:05
Switch all Seer autofix API calls to use the agent-based endpoint
(`?mode=explorer`) which returns blocks instead of steps. The agent
endpoint is the path forward and the old endpoint will be deprecated.

Key changes:
- API layer uses `apiRequestToRegion` with `mode=explorer` query param
  instead of `@sentry/api` SDK functions
- Status values normalized from agent lowercase to CLI uppercase format
- Root cause extraction handles agent artifact format (`key: "root_cause"`)
  alongside legacy step format
- Progress messages extracted from block messages in agent format
- `triggerSolutionPlanning` simplified: posts `step: "solution"` with
  `run_id` instead of legacy `select_root_cause` update payload
- `--cause` flag removed from `issue plan` (agent determines root cause)

Fixes #961
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-962/

Built to branch gh-pages at 2026-05-13 10:07 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

6949 passed | Total: 6949 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +4
Passed Tests 📈 +4
Failed Tests
Skipped Tests

All tests are passing successfully.

❌ Patch coverage is 63.72%. Project has 14150 uncovered lines.
✅ Project coverage is 76.99%. Comparing base (base) to head (head).

Files with missing lines (4)
File Patch % Lines
src/commands/issue/plan.ts 11.11% ⚠️ 16 Missing
src/lib/formatters/seer.ts 22.22% ⚠️ 14 Missing
src/types/seer.ts 75.86% ⚠️ 7 Missing
src/lib/api/seer.ts 91.67% ⚠️ 4 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    76.99%    76.99%        —%
==========================================
  Files          320       320         —
  Lines        61455     61504       +49
  Branches         0         0         —
==========================================
+ Hits         47319     47354       +35
- Misses       14136     14150       +14
- Partials         0         0         —

Generated by Codecov Action

@MathurAditya724 MathurAditya724 marked this pull request as ready for review May 13, 2026 10:16
@MathurAditya724
Copy link
Copy Markdown
Member Author

all 20 CI checks green, self-review clean — marked ready for review. the migration covers API calls, status normalization, root cause extraction from agent artifacts, and the --cause flag removal. tests updated to match the new response format.

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.

Migrate Autofix to new agent-based endpoint

1 participant