Skip to content

feat(seer): Wire up defaultCodingAgent and defaultCodingAgentIntegrationId in org API#109386

Draft
JoshFerge wants to merge 4 commits intomasterfrom
feat/seer-organization-settings-api
Draft

feat(seer): Wire up defaultCodingAgent and defaultCodingAgentIntegrationId in org API#109386
JoshFerge wants to merge 4 commits intomasterfrom
feat/seer-organization-settings-api

Conversation

@JoshFerge
Copy link
Member

@JoshFerge JoshFerge commented Feb 25, 2026

Summary

  • Adds defaultCodingAgent and defaultCodingAgentIntegrationId to the org details GET/PUT endpoint
  • defaultCodingAgent accepts "seer" (default), "cursor", or null (disabled)
  • defaultCodingAgentIntegrationId is the integration ID, required when the agent needs one (e.g. cursor)
  • Cross-field validation enforces that agents in INTEGRATION_REQUIRED_AGENTS must have an integration ID, and others must not

JoshFerge and others added 3 commits February 25, 2026 17:01
Expose the SeerOrganizationSettings.default_coding_agent_integration_id
field through the organization details GET and PUT endpoints. When null,
Sentry's built-in Seer agent is the default coding agent; when set, it
overrides to a specific integration (e.g. Cursor).

Validation ensures the integration belongs to the requesting org via
integration_service. Bulk-fetches settings in get_attrs() to avoid N+1.

Co-Authored-By: Claude <noreply@anthropic.com>
Update SeerOrganizationSettings imports to new seer module path and add
defaultCodingAgentIntegrationId to the organization PUT example response.
Add defaultCodingAgent field to the org details GET/PUT endpoint
alongside the existing defaultCodingAgentIntegrationId. Includes
cross-field validation: agents in INTEGRATION_REQUIRED_AGENTS (e.g.
cursor) require an integration ID, while others (e.g. seer) must not
have one set.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 25, 2026
- Return None (not "seer") for defaultCodingAgent when no settings exist
- Remove ChoiceField empty string hack, use allow_null=True properly
- Extract validation to _validate_coding_agent_fields method
- Validate against merged DB state for partial updates (prevents
  clearing integration_id while agent requires it, or vice versa)
- Update tests to cover partial update edge cases

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant