feat(seer): Wire up defaultCodingAgent and defaultCodingAgentIntegrationId in org API#109386
Draft
feat(seer): Wire up defaultCodingAgent and defaultCodingAgentIntegrationId in org API#109386
Conversation
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>
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
defaultCodingAgentanddefaultCodingAgentIntegrationIdto the org details GET/PUT endpointdefaultCodingAgentaccepts"seer"(default),"cursor", ornull(disabled)defaultCodingAgentIntegrationIdis the integration ID, required when the agent needs one (e.g. cursor)INTEGRATION_REQUIRED_AGENTSmust have an integration ID, and others must not