Skip to content

Revert "ref(seer): Filter private fields from explorer chat API response"#113195

Closed
chromy wants to merge 1 commit intomasterfrom
chromy/ref/revert-filter-private-fields-explorer-chat
Closed

Revert "ref(seer): Filter private fields from explorer chat API response"#113195
chromy wants to merge 1 commit intomasterfrom
chromy/ref/revert-filter-private-fields-explorer-chat

Conversation

@chromy
Copy link
Copy Markdown
Contributor

@chromy chromy commented Apr 16, 2026

Reverts #113125 (commit a2b4584).

Why

Adding Field(exclude=True) to SeerRunState.metadata (and coding_agents, usage) breaks the open_pr autofix path. trigger_push_changes in src/sentry/seer/autofix/autofix_agent.py calls client.get_run(run_id), which round-trips the state through SeerRunState.dict(). With exclude=True, metadata is dropped, so the subsequent state.metadata.get("group_id") != group.id check raises SeerPermissionError, which the endpoint converts to a 404.

Breaks these tests in GroupAutofixEndpointExplorerRoutingTest:

  • test_open_pr
  • test_open_pr_with_repo_name
  • test_open_pr_without_repo_name

The original PR's goal (not leaking private fields from the chat GET endpoint) is still worth doing — but it needs to avoid mutating .dict() on fields that internal callers (autofix, night shift) rely on. Recommended follow-up: filter at the chat endpoint's serialization layer instead of at the model level.

Test plan

  • All 13 tests in GroupAutofixEndpointExplorerRoutingTest pass locally

Agent transcript: https://claudescope.sentry.dev/share/UNpzUgEqDq3qylO2yWNXUNup8rl7E67hslWFRdN21Mo

…nse (#113125)"

This reverts commit a2b4584.

Adding `Field(exclude=True)` to `SeerRunState.metadata` (and `coding_agents`,
`usage`) causes `trigger_push_changes` to raise `SeerPermissionError` — the
`open_pr` path calls `client.get_run(run_id)` which round-trips the state
through `.dict()`, dropping `metadata` and failing the
`state.metadata.get("group_id") != group.id` check in autofix_agent.py, which
the endpoint surfaces as 404.

Breaks `test_open_pr`, `test_open_pr_with_repo_name`, and
`test_open_pr_without_repo_name` in `GroupAutofixEndpointExplorerRoutingTest`.

Agent transcript: https://claudescope.sentry.dev/share/jrltmqqO9R5-5IFIdaBmPVdw_GfoseCtIvlM1JXrb90
@chromy chromy requested a review from a team as a code owner April 16, 2026 17:52
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 16, 2026
@chromy chromy closed this Apr 16, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant