feat(copilot): add provider support for explorer autofix coding agent handoff#106798
feat(copilot): add provider support for explorer autofix coding agent handoff#106798
Conversation
… handoff Add support for the `provider` parameter in the explorer autofix endpoint to enable GitHub Copilot integration. This mirrors the legacy autofix behavior where `provider` is used for user-authenticated integrations like GitHub Copilot, while `integration_id` is used for org-installed integrations like Cursor. Changes: - Add `provider` field to ExplorerAutofixRequestSerializer - Update trigger_coding_agent_handoff to accept provider and user_id - Update launch_coding_agents in coding_agent_handoff.py to support provider-based authentication (GitHub Copilot) - Update SeerExplorerClient.launch_coding_agents to pass through provider and user_id parameters
Adds validation to return a 400 error when both integration_id and provider are specified for coding_agent_handoff. Users must choose one or the other, not both.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| elif integration_id is not None: | ||
| integration, installation = _validate_and_get_integration(organization, integration_id) | ||
| else: | ||
| raise ValidationError("Either integration_id or provider must be provided") |
There was a problem hiding this comment.
Misleading error for unsupported provider values
Low Severity
When a user provides an unsupported provider value (anything other than "github_copilot") without integration_id, the API layer validation passes but the error from launch_coding_agents incorrectly states "Either integration_id or provider must be provided". The provider was provided—it's just not a supported value. The API serializer accepts any string for provider but only "github_copilot" is actually handled, leading to a confusing error message that doesn't reflect the actual problem.
Additional Locations (1)
There was a problem hiding this comment.
eh, we'll handle this better once we have more than 1 provider
… handoff (#106798) ## Summary Adds support for the `provider` parameter in the explorer autofix endpoint to enable GitHub Copilot integration. This mirrors the legacy autofix behavior added in #106289 where `provider` is used for user-authenticated integrations like GitHub Copilot, while `integration_id` is used for org-installed integrations like Cursor. **Changes:** - Add `provider` field to `ExplorerAutofixRequestSerializer` - Update `trigger_coding_agent_handoff` to accept `provider` and `user_id` params - Update `launch_coding_agents` in `coding_agent_handoff.py` to support provider-based authentication (GitHub Copilot uses per-user OAuth tokens) - Update `SeerExplorerClient.launch_coding_agents` to pass through `provider` and `user_id` parameters **Behavior:** - When `provider=github_copilot` is passed, the endpoint uses the user's GitHub Copilot OAuth token instead of an org-wide integration - The endpoint validates that either `integration_id` or `provider` is provided (not both required, just one) - If GitHub Copilot auth is missing, returns a permission error prompting the user to connect their GitHub account Companion to frontend PR: #106788
Summary
Adds support for the
providerparameter in the explorer autofix endpoint to enable GitHub Copilot integration. This mirrors the legacy autofix behavior added in #106289 whereprovideris used for user-authenticated integrations like GitHub Copilot, whileintegration_idis used for org-installed integrations like Cursor.Changes:
providerfield toExplorerAutofixRequestSerializertrigger_coding_agent_handoffto acceptprovideranduser_idparamslaunch_coding_agentsincoding_agent_handoff.pyto support provider-based authentication (GitHub Copilot uses per-user OAuth tokens)SeerExplorerClient.launch_coding_agentsto pass throughprovideranduser_idparametersBehavior:
provider=github_copilotis passed, the endpoint uses the user's GitHub Copilot OAuth token instead of an org-wide integrationintegration_idorprovideris provided (not both required, just one)Companion to frontend PR: #106788