Skip to content

fix(github-copilot): Fall back to now() when started_at is missing from API response#110638

Merged
JoshFerge merged 1 commit intomasterfrom
jferg/fix-coding-agent-state-started-at
Mar 13, 2026
Merged

fix(github-copilot): Fall back to now() when started_at is missing from API response#110638
JoshFerge merged 1 commit intomasterfrom
jferg/fix-coding-agent-state-started-at

Conversation

@JoshFerge
Copy link
Member

@JoshFerge JoshFerge commented Mar 13, 2026

Handle the case where the GitHub Copilot task API returns a response
without created_at, which caused a ValidationError when constructing
CodingAgentState since started_at is a required datetime field.

The fix defaults started_at to datetime.now(UTC) instead of None,
so the model always receives a valid value even when the API omits
created_at or returns an unparseable value.

Also adds test coverage for the launch method which previously had none.

Fixes SENTRY-5M3C

Agent transcript: https://claudescope.sentry.dev/share/5qkI2aryj526Coe9fx0te4tGVYgGTo4Qxopds0Sqdgk

…om API response

The GitHub Copilot task API can return a response without created_at,
causing a ValidationError when constructing CodingAgentState since
started_at is a required datetime field. Default to datetime.now(UTC)
instead of None so the model always receives a valid value.

Fixes SENTRY-5M3C
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Agent transcript: https://claudescope.sentry.dev/share/awC9wODGzJtuLf-etik04hfTumtp3ph-SbpRtjfrZ5c
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 13, 2026
@JoshFerge JoshFerge marked this pull request as ready for review March 13, 2026 14:59
@JoshFerge JoshFerge requested review from a team as code owners March 13, 2026 14:59
@JoshFerge JoshFerge merged commit b44efdd into master Mar 13, 2026
60 checks passed
@JoshFerge JoshFerge deleted the jferg/fix-coding-agent-state-started-at branch March 13, 2026 15:30
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.

2 participants