Skip to content

feat: expand Cue model with 8 missing fields (drift fix-up)#29

Merged
govindkavaturi-art merged 1 commit intomainfrom
feat/sdk-cue-model-fields
May 4, 2026
Merged

feat: expand Cue model with 8 missing fields (drift fix-up)#29
govindkavaturi-art merged 1 commit intomainfrom
feat/sdk-cue-model-fields

Conversation

@mikemolinet
Copy link
Copy Markdown
Collaborator

Summary

Closes the Cue portion of cueapi-python #24's model_drift manifest. The SDK's Cue Pydantic model was silently dropping 8 fields the server returns (Pydantic default extra=\"ignore\"); callers reading e.g. the catch_up policy or stats blob via the SDK got nothing.

Fields added

All Optional with defaults so legacy server responses still parse cleanly:

Field Type Notes
delivery Optional[DeliveryConfig] timeout_seconds + outcome_deadline_seconds
alerts Optional[AlertConfig] extra="allow" forward-compat
catch_up Optional[str] run_once_if_missed / skip_missed / replay_all
verification Optional[VerificationConfig] mode + required_assertions; extra="allow"
on_success_fire Optional[str] cue ID for 1:1 chaining (Gap 1)
require_payload_override bool = False hosted PR #590 — default matches server
required_payload_keys Optional[List[str]] hosted PR #590
stats Optional[Dict[str, Any]] CueDetailResponse-only blob (7d success rate etc.)

Three new nested models

  • DeliveryConfig — typed schema for 2-phase delivery
  • AlertConfigextra=\"allow\" forward-compat (alert kinds evolve server-side)
  • VerificationConfig — typed mode + required_assertions plus extra=\"allow\" for forward-compat on assertion kinds

Forward-compat note

AlertConfig and VerificationConfig use extra=\"allow\" so the SDK doesn't break when the server grows the object. Pinned by tests:

  • test_alerts_config_forward_compat — unknown server-side keys land in model_extra without raising
  • test_verification_config_forward_compat — same

Tests

11 new (30 → 41 unit tests passing). Coverage:

  • Old response (without new fields) still parses cleanly — pinning backward compat
  • Each new field round-trips correctly with a realistic payload
  • AlertConfig and VerificationConfig forward-compat
  • Full-response roundtrip with every field set
  • CueList parses correctly with new fields in each row

Backward compat

No breaking change for SDK callers:

  • Fields are additive
  • All Optional or defaulted to match the server
  • The server's prior shape still parses (pinned by test_old_response_still_parses)

Worth a minor version bump (0.3.0) at next release for the new accessor surface, but no API removals.

Companion PRs from this session

  • #25mark_verified bug fix + replay()
  • #26WorkersResource + UsageResource
  • #27AgentsResource
  • #28MessagesResource

After this lands, the remaining model_drift items are:

  • Execution: still no dedicated class (returns dicts everywhere) — separate PR
  • Worker: missing entirely — sibling to the WorkersResource PR
  • Agent + Message: missing entirely — could be added now or deferred until callers complain

🤖 Generated with Claude Code

Closes the Cue portion of cueapi-python #24's `model_drift` manifest.
The SDK's Cue Pydantic model was silently dropping 8 fields the server
returns (Pydantic default extra="ignore"); callers reading e.g. the
``catch_up`` policy or ``stats`` blob via the SDK got nothing.

Fields added (all Optional with defaults so legacy responses still
parse):

- delivery: Optional[DeliveryConfig]    — timeout_seconds, outcome_deadline_seconds
- alerts: Optional[AlertConfig]          — extra="allow" forward-compat
- catch_up: Optional[str]                — run_once_if_missed / skip_missed / replay_all
- verification: Optional[VerificationConfig]  — mode + required_assertions; extra="allow"
- on_success_fire: Optional[str]         — cue ID for 1:1 chaining (Gap 1)
- require_payload_override: bool = False — hosted PR #590; default False matches server
- required_payload_keys: Optional[List[str]]  — hosted PR #590
- stats: Optional[Dict[str, Any]]        — CueDetailResponse-only blob (7d success rate etc.)

Three new nested models:

- DeliveryConfig: typed schema for the 2-phase delivery config
- AlertConfig:    forward-compat (extra="allow") since alert kinds
                  evolve server-side
- VerificationConfig: typed `mode` + `required_assertions` plus
                  extra="allow" for forward-compat on assertion kinds

Tests: 11 new (30 → 41 unit tests). Coverage:

- Old response (without new fields) still parses cleanly — pinning
  backward compat
- Each new field round-trips correctly with a realistic payload
- AlertConfig forward-compat: unknown server-side keys land in
  model_extra without raising
- VerificationConfig forward-compat: same
- Full-response roundtrip with every field set
- CueList parses correctly with new fields in each row

No breaking change for SDK callers — fields are additive, all
Optional/defaulted, server's prior shape still parses. Bump warranted
at next minor (0.3.0) for the new accessor surface.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copy link
Copy Markdown
Member

@govindkavaturi-art govindkavaturi-art left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra="allow" + forward-compat config classes is the right shape for evolving server-side schemas. Drift fix-up that doesn't lock the model into today's surface. Approve.

@govindkavaturi-art govindkavaturi-art merged commit cc55599 into main May 4, 2026
3 of 4 checks passed
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