fix(copilot): Update models for GitHub Copilot Tasks API field migrations#111890
Merged
Conversation
…ions GitHub is migrating several fields on their Copilot Tasks API: - creator_id/owner_id (int) → creator/owner (object with id) - last_updated_at → updated_at - user_collaborators will change from list[int] to list[User] - repo_id → repository object - status is deprecated in favor of state Update our Pydantic models to match the current live API response shape and handle the upcoming user_collaborators type change gracefully. Agent transcript: https://claudescope.sentry.dev/share/rNNf31sxU5AKRpBHV8KBbVC0ZlYKtV-jniNfeaRfnus
Our code only reads task.state; Pydantic ignores the extra field in API responses, so keeping it on the model is misleading.
…askResponse
The API no longer wraps responses in {"task": {...}}. Remove the dead
code path, the unused model, and the test that covered it.
dashed
pushed a commit
that referenced
this pull request
Apr 1, 2026
…ions (#111890) ## Summary - Update `GithubCopilotTask`, `GithubCopilotSession`, and related models to match the current live GitHub Copilot Tasks API response shape - `creator_id`/`owner_id` (int) → `creator`/`owner` (object with `id` field) - `last_updated_at` → `updated_at` - `user_collaborators` changed from `list[int]` to `list[Any]` to handle the upcoming migration from int IDs to User objects - Added new fields: `repository`, `html_url`, `url`, `slug` on collaborators - Removed deprecated `status` field from `GithubCopilotTask` — our code only reads `state` - Removed legacy `{"task": {...}}` response envelope handling and `GithubCopilotTaskResponse` model — the API returns task objects directly now **Context:** GitHub is rolling out breaking changes to their Copilot Tasks API. We verified the current API state by testing against a live repo — `last_updated_at`, `creator_id`, `owner_id`, and the `{"task": ...}` envelope are already gone. `status` is still present alongside `state` but deprecated. `user_collaborators` type change (int → object) is coming soon. Our polling flow (`poll_github_copilot_agents`) only reads `task.state` and `task.artifacts`, so it's unaffected. These changes prevent Pydantic validation failures when parsing API responses with the new field shapes. ## Test plan - [x] All existing tests pass (54 tests across `test_client.py` + `test_coding_agent.py`) - [x] Verified against live GitHub Copilot API
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
GithubCopilotTask,GithubCopilotSession, and related models to match the current live GitHub Copilot Tasks API response shapecreator_id/owner_id(int) →creator/owner(object withidfield)last_updated_at→updated_atuser_collaboratorschanged fromlist[int]tolist[Any]to handle the upcoming migration from int IDs to User objectsrepository,html_url,url,slugon collaboratorsstatusfield fromGithubCopilotTask— our code only readsstate{"task": {...}}response envelope handling andGithubCopilotTaskResponsemodel — the API returns task objects directly nowContext: GitHub is rolling out breaking changes to their Copilot Tasks API. We verified the current API state by testing against a live repo —
last_updated_at,creator_id,owner_id, and the{"task": ...}envelope are already gone.statusis still present alongsidestatebut deprecated.user_collaboratorstype change (int → object) is coming soon.Our polling flow (
poll_github_copilot_agents) only readstask.stateandtask.artifacts, so it's unaffected. These changes prevent Pydantic validation failures when parsing API responses with the new field shapes.Test plan
test_client.py+test_coding_agent.py)