Skip to content

feat(seer): migrate analyze_issue_with_seer + summary to explorer sections#966

Draft
JoshFerge wants to merge 1 commit into
feat/autofix-explorer-schemasfrom
feat/autofix-explorer-migrate
Draft

feat(seer): migrate analyze_issue_with_seer + summary to explorer sections#966
JoshFerge wants to merge 1 commit into
feat/autofix-explorer-schemasfrom
feat/autofix-explorer-migrate

Conversation

@JoshFerge
Copy link
Copy Markdown
Member

@JoshFerge JoshFerge commented May 13, 2026

Stacked on #963 (feat/autofix-explorer-schemas), which is stacked on #962 (chore/evals-unblock-prediction-scorer). Review those first.

Summary

Final piece of the autofix explorer-mode migration. Swaps every Seer consumer over to the explorer schemas/API methods added in #963 and deletes the legacy plumbing.

Consumer rewrites

  • `internal/tool-helpers/seer.ts` rebuilt around explorer sections. New `getOrderedAutofixSections` mirrors the section splitter in `static/app/components/events/autofix/useExplorerAutofix.tsx`, and `getOutputForAutofixSection` renders the typed `root_cause` / `solution` artifacts, the merged file patches, and the synthesized `pull_request` section from `repo_pr_states`.
  • `analyze_issue_with_seer` now drives the run sequentially: `root_cause` then `solution`, reusing the existing `run_id` from the GET when one already exists. Polling per section instead of one global terminal-state poll.
  • `formatSeerSummary` rebuilt against the new sections; falls back to the most substantive assistant message in a section when the structured artifact is missing.

Drop-legacy

  • Deleted `AutofixStatusSchema` (uppercase enum), `AutofixRunStepBaseSchema` and its variants, and the legacy `AutofixRunStateSchema` (steps[] shape).
  • Renamed PR-2's `AutofixExplorer*` schemas/types to canonical `Autofix*` names — they're the only autofix contract now.
  • Deleted the legacy `getAutofixState` / `startAutofix` and renamed the explorer variants onto those names.
  • Rewrote the legacy `autofix-state.json` fixture so it still validates after the swap.

Warden bot fix (from #961)

When an existing run is already in a terminal state (`error` / `awaiting_user_input`) and only carries an earlier section (e.g. `root_cause`), the tool no longer POSTs a follow-up `solution` step against the dead run — it renders what's there and stops. Covered by a new regression test (`does not POST a follow-up step when the existing run already failed`).

Other

  • MSW + undici handlers updated to the explorer payload shape. The undici interceptor paths now include `?mode=explorer`.
  • Regenerated `toolDefinitions.json` / `skillDefinitions.json` for the updated tool description.

Test plan

  • `pnpm run tsc`
  • `pnpm run lint`
  • `pnpm run test` — all packages green (8 tests in analyze-issue-with-seer.test.ts, including the new Warden regression)
  • `pnpm vitest run autofix.eval.ts` with `OPENAI_API_KEY` set — both cases score 1.00 against the new flow (validated on the previous attempt at feat(seer): migrate autofix tool to explorer-mode endpoint #961)

Stack

  1. chore(evals): unblock ToolPredictionScorer #962 — chore(evals): unblock ToolPredictionScorer
  2. feat(seer): add explorer-mode autofix schemas + API methods #963 — feat(seer): add explorer-mode schemas + API methods
  3. this PR — feat(seer): migrate analyze_issue_with_seer + summary

Once this stack lands, the standalone #961 will be closed (it tried to do all of this in one PR).

🤖 Generated with Claude Code

Agent transcript: https://claudescope.sentry.dev/share/bK6AeGdIztC20JC3ZCsSQDTayVFoR5jHqK1jm-CH1rU

…tions

Swap the consumers over to the explorer-mode schemas/API methods added in
#963, then delete the legacy plumbing.

What changes
- `internal/tool-helpers/seer.ts` rewritten around explorer sections:
  `getOrderedAutofixSections` mirrors the section splitter in
  `static/app/components/events/autofix/useExplorerAutofix.tsx`, and
  `getOutputForAutofixSection` renders the typed `root_cause` / `solution`
  artifacts, code-changes patches, and PR state.
- `analyze_issue_with_seer` now drives the run sequentially: `root_cause`
  then `solution`, reusing the existing `run_id` from the GET when there
  already is one.
- `formatSeerSummary` rebuilt against the new sections.

Drop-legacy
- Deleted `AutofixStatusSchema` (uppercase enum), `AutofixRunStepBaseSchema`
  and its `default` / `root_cause_analysis` / `solution` variants, and the
  legacy `AutofixRunStateSchema` (steps[] shape).
- Renamed PR-2's `AutofixExplorer*Schema` and `AutofixExplorer*` types to
  the canonical `Autofix*` names now that they're the only autofix
  contract.
- Deleted the legacy `getAutofixState` / `startAutofix` client methods and
  renamed the explorer variants from PR-2 onto those names.
- Updated the legacy `autofix-state.json` fixture to the explorer shape so
  it still validates after the swap.

Warden fix from #961
- When an existing autofix run is already in a terminal state (`error` or
  `awaiting_user_input`) and only carries an earlier section (e.g.
  `root_cause`), the tool now stops there instead of POSTing a follow-up
  `solution` step against a dead run. Covered by a new regression test in
  `analyze-issue-with-seer.test.ts`.

Other
- Updated MSW + undici handlers to match the explorer endpoint payload
  shape; the undici interceptor paths now include `?mode=explorer`.
- Regenerated `toolDefinitions.json` / `skillDefinitions.json` for the
  updated tool description.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Agent transcript: https://claudescope.sentry.dev/share/j6cVvnKV84v1-_h_HvrYUe63LYuzahaBZot6tESW9CE
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