Skip to content

feat(seer): Forward result_target in search-agent start options - #125886

Merged
skaasten merged 6 commits into
masterfrom
shaunkaasten/aiml-3596-forward-result_target-in-search-agent-start-options
Oct 5, 2026
Merged

skaasten merged 6 commits into
masterfrom
shaunkaasten/aiml-3596-forward-result_target-in-search-agent-start-options

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

The search agent accepts a result_target option (ui_search | agent_search) that selects guidance for the result shapes a caller can use. But /search-agent/start/ builds a fixed options dict, so the option never gets forwarded and every caller gets the ui_search default. That keeps agent callers like getsentry/sentry-mcp#1342 from getting agent-oriented guidance.

This infers result_target from how the request is authenticated and forwards it:

  • Cookie-authenticated requests with no token (is_frontend_request, i.e. the web UI) get ui_search.
  • Everything else (token-authenticated MCP, CLI, scripts) gets agent_search.
  • The chosen target is tagged as search_agent.result_target.

Callers can't set result_target themselves; there's no use case for it yet, and it's easy to add later.

result_target only changes behavior in code mode, which is enabled by the seer-assisted-query-codemode flag. The frontend needs no changes.

Fixes AIML-3596

via shaun.kaasten.

--

View Junior Session [Sentry]

Callers can declare options.result_target (ui_search | agent_search). When
omitted, infer it from the credential: cookie-authenticated web UI requests
get ui_search, token-authenticated callers (MCP, CLI, scripts) get
agent_search.

Fixes AIML-3596

Co-Authored-By: Shaun Kaasten <shaun.kaasten@sentry.io>
@linear-code

linear-code Bot commented Sep 29, 2026

Copy link
Copy Markdown

AIML-3596

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 29, 2026
Co-Authored-By: Shaun Kaasten <shaun.kaasten@sentry.io>
@skaasten
skaasten marked this pull request as ready for review September 29, 2026 16:53
@skaasten
skaasten requested a review from a team as a code owner September 29, 2026 16:53
Comment thread src/sentry/seer/endpoints/search_agent_start.py Outdated
@skaasten
skaasten requested a review from shruthilayaj October 1, 2026 14:46
…596-forward-result_target-in-search-agent-start-options

# Conflicts:
#	src/sentry/seer/endpoints/search_agent_start.py

Co-Authored-By: shaun.kaasten <shaun.kaasten@sentry.io>
Comment thread src/sentry/seer/endpoints/search_agent_start.py

@DominikB2014 DominikB2014 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@skaasten
skaasten enabled auto-merge (squash) October 5, 2026 18:56
@skaasten
skaasten merged commit 323c088 into master Oct 5, 2026
72 checks passed
@skaasten
skaasten deleted the shaunkaasten/aiml-3596-forward-result_target-in-search-agent-start-options branch October 5, 2026 19:01

This branch was successfully deployed

1 active deployment
Preview — d80b1430 Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants