Skip to content

fix(formatting): unblock CI for llmFormat response types#120105

Closed
shayna-ch wants to merge 1 commit into
shayna-ch/format-endpointfrom
cursor/fix-llmformat-ci-f69e
Closed

fix(formatting): unblock CI for llmFormat response types#120105
shayna-ch wants to merge 1 commit into
shayna-ch/format-endpointfrom
cursor/fix-llmformat-ci-f69e

Conversation

@shayna-ch

Copy link
Copy Markdown
Member

Summary

Fixes the CI failures on #119545 (backend typing + api docs test).

Root causes

  1. api docs: NotRequired[...] on TypedDict fields is ignored when the module has from __future__ import annotations, so OpenAPI marked formatted as required and example validation failed.
  2. mypy: wrap_event_response returns GroupEventDetailsResponse, which didn't match the annotated Response[GroupEventDetailsFormattedResponse].

Fix

  • Use total=False TypedDict mixins for the optional formatted field (same pattern used elsewhere in serializers).
  • Cast the event details payload to GroupEventDetailsFormattedResponse on return.

Test plan

  • prek mypy on changed files
  • Confirmed formatted is in __optional_keys__ for both response TypedDicts
  • CI: backend typing and api docs test pass on this PR
Open in Web Open in Cursor 

NotRequired is ignored under from __future__ import annotations, so
OpenAPI treated `formatted` as required and example validation failed.
Use total=False TypedDict mixins instead, and cast the event details
response so mypy accepts the annotated return type.

Co-authored-by: Shayna Chambless <shayna-ch@users.noreply.github.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 20, 2026
@shayna-ch shayna-ch closed this Jul 20, 2026
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