Skip to content

Handle HTTPError from Seer API in autofix endpoint#107732

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-seer-github-access-error
Draft

Handle HTTPError from Seer API in autofix endpoint#107732
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-seer-github-access-error

Conversation

Copy link

Copilot AI commented Feb 5, 2026

When Seer's IP is blocked by GitHub org allowlists, get_autofix_state() raises unhandled requests.HTTPError (403/500), bubbling to users as raw errors.

Changes

  • Added requests.HTTPError handling in GroupAutofixEndpoint._get_legacy() and _get_explorer()
  • Handlers log exceptions with context (group_id, organization_id, status_code) and return graceful 500 with error message
  • Added test coverage for 403, 500, and null response scenarios
try:
    autofix_state = get_autofix_state(
        group_id=group.id,
        organization_id=group.organization.id,
        check_repo_access=check_repo_access,
        is_user_fetching=bool(is_user_watching),
    )
except requests.HTTPError as e:
    logger.exception(
        "group_ai_autofix.get.http_error",
        extra={
            "group_id": group.id,
            "organization_id": group.organization.id,
            "status_code": e.response.status_code if e.response is not None else None,
        },
    )
    return Response(
        {"detail": "Failed to fetch autofix state"},
        status=status.HTTP_500_INTERNAL_SERVER_ERROR,
    )

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 5, 2026 22:55
…oint

Co-authored-by: JoshFerge <1976777+JoshFerge@users.noreply.github.com>
Co-authored-by: JoshFerge <1976777+JoshFerge@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Seer service GitHub access verification issue Handle HTTPError from Seer API in autofix endpoint Feb 5, 2026
Copilot AI requested a review from JoshFerge February 5, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants