Skip to content

feat(seer): add explorer-mode autofix schemas + API methods#963

Draft
JoshFerge wants to merge 1 commit into
chore/evals-unblock-prediction-scorerfrom
feat/autofix-explorer-schemas
Draft

feat(seer): add explorer-mode autofix schemas + API methods#963
JoshFerge wants to merge 1 commit into
chore/evals-unblock-prediction-scorerfrom
feat/autofix-explorer-schemas

Conversation

@JoshFerge
Copy link
Copy Markdown
Member

@JoshFerge JoshFerge commented May 13, 2026

Stacked on #962 (chore/evals-unblock-prediction-scorer). Review that one first.

Summary

Additive only — introduces the Zod schemas, types, and `SentryApiService` methods we'll need to model Seer's explorer-mode autofix endpoint, without touching any consumer code. The legacy `AutofixRunStateSchema`, `getAutofixState`, and `startAutofix` are untouched; nothing in the codebase calls the new methods yet.

The follow-up PR (PR-3 in the stack) is the one that actually rewrites `analyze_issue_with_seer` and `formatSeerSummary` to consume these new schemas and then deletes the legacy plumbing.

What's in here

  • New Zod schemas in `api-client/schema.ts`:
    • `AutofixExplorerStatusSchema` (`processing` / `completed` / `error` / `awaiting_user_input`)
    • `AutofixExplorerStepSchema` (`root_cause` / `solution` / `code_changes`)
    • `AutofixExplorerBlockSchema` with typed message, `metadata.step` marker, and inline `artifacts` / `merged_file_patches`
    • `AutofixExplorerArtifactSchema`, `…FilePatchSchema`, `…RepoPRStateSchema`, `…CodingAgentStateSchema`
    • `AutofixExplorerRunStateSchema` (the top-level GET response)
  • Inferred types exported from `api-client/types.ts`.
  • Two new `SentryApiService` methods:
    • `getAutofixExplorerState(...)` — hits `?mode=explorer`
    • `startAutofixExplorer({step, runId?, userContext?, insertIndex?})` — also `?mode=explorer`, POSTs the explorer payload shape
  • Realistic explorer payload in `autofix-state-explorer.json` (the previous file was a placeholder using the legacy shape).
  • Schema tests against the new fixture.

Why passthrough

Upstream the explorer endpoint is still marked experimental and the source in `group_ai_autofix.py` / `useExplorerAutofix.tsx` is the working source of truth. `.passthrough()` on the block and artifact schemas means additive upstream fields don't break parsing in production.

Test plan

  • `pnpm run tsc`
  • `pnpm run lint`
  • `pnpm run test` — all packages green

Stack

  1. chore(evals): unblock ToolPredictionScorer #962 — chore(evals): unblock ToolPredictionScorer
  2. this PR — feat(seer): add explorer-mode schemas + API methods
  3. next — feat(seer): migrate analyze_issue_with_seer + summary to explorer sections (deletes the legacy schemas and methods; includes the Warden status-guard fix from PR-961)

🤖 Generated with Claude Code

Agent transcript: https://claudescope.sentry.dev/share/UrueuTcE0n9OQzUhuYzDuVk3hp_0wmjTKFPs6Rv-atI

Additive only. Introduces the Zod schemas, types, and SentryApiService
methods that model Seer's explorer-mode autofix endpoint:

- `AutofixExplorerStatusSchema` (processing/completed/error/awaiting_user_input)
- `AutofixExplorerStepSchema` (root_cause/solution/code_changes)
- `AutofixExplorerBlockSchema` with typed messages, metadata.step markers,
  and inline artifacts/file_patches
- `AutofixExplorerArtifactSchema`, `…FilePatchSchema`,
  `…RepoPRStateSchema`, `…CodingAgentStateSchema`
- `AutofixExplorerRunStateSchema` (the top-level GET response)
- `getAutofixExplorerState` / `startAutofixExplorer` on `SentryApiService`,
  both hitting `?mode=explorer`; POST takes
  `{step, run_id?, user_context?, insert_index?}`
- Realistic explorer payload in `autofix-state-explorer.json` for fixtures
  and tests

Legacy `AutofixRunStateSchema`, `getAutofixState`, and `startAutofix` are
unchanged — consumers stay on them until the follow-up PR swaps them out.

🤖 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/BavqXcygdtvUIoYVD3Az-HczhjKqeB2zTtw8VJ1Al-s
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