Repository navigation
feat: read both forms of the Lenz API's responses - #107
Merged
Merged
Conversation
…on verify Every model, the webhook parser, the error mapping and the CLI read the API's newer response shape as well as the original one. The newer field names are attributes (ExtractedClaims.claims, AssessClaim.status/failure/ more_claims, TaskStatus.failure, completed_at, claim, FailureBlock.code, the *_limit_exceeded flags, webhook event_id), and every older attribute keeps its original meaning, computed from whichever shape arrives. model_dump() returns the shape the server sent. verify and verify_batch leave webhook_url out instead of sending "" (both meant the key's default); review and citecheck bodies are unchanged. The /me/usage deprecations no longer name a removal date. Parity tests freeze what the previous release produced from each original-shape response (models, CLI text and JSON, wait outcomes, errors, webhooks, request bodies) and hold both shapes to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d on newer-shape review webhooks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arlier release Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… properties A body is read as the newer response shape only when it carries a key only that shape has; every other body goes through the same fields, values, dump, repr, exclude_unset, JSON schema and pickle as before. The newer names (claims, status, failure, more_claims, completed_at, claim, code, detail, the *_exceeded flags, webhook event_id / failure / claims / reason) are read-only properties, not fields, and the model-level serializer is gone. Errors read the newer failure block, retry_after and a computed remaining only for a newer-shape body and only where the original key is absent. Webhook events keep their dataclass fields; a needs_input option with a null domain no longer raises. The CLI renderers are back to 2.20's code. Parity fixtures are rebuilt from the real recorded pairs (responses and webhooks), extract goes through the client with the recorded locate, and the oracle now also freezes exclude_unset dumps, repr, JSON schemas and pickles. The remaining removal-date text is gone, and the changelog lists what to settle before the SDK asks for the newer shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew_id / citecheck_id as task_id Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
The Lenz API is adding a newer, dated response form alongside the current one. This SDK and CLI keep sending
X-Lenz-API-Version: 2026-05-13, so they keep receiving the current form. This release makes them read both, without changing anything for existing code.model_dump(incl.exclude_unset),repr, JSON schema, pickle and CLI output. This is pinned by an oracle of origin/main's outputs over 353 recordings, with a mutation check.status,failure,more_claims,claims,completed_at, …)."Error"/"low",error_codemapped back,modified_atlater-UTC-day rule, /me/usage blocks recomputed fromcredits+costs).asdict/==unchanged);event_id,failure,claimsandreasonare properties.webhook_url:verify/verify_batchno longer send""by default.review/citecheckbodies are unchanged and pinned.openapi.json, which is byte-identical with the Node SDK's). The changelog has a correction entry and lists what to settle before the SDK sends the newer date.Tests
1526 passed, 8 skipped, coverage 93.3%; mypy --strict and ruff clean. The parity fixtures are excluded from the wheel and sdist.
Release
Changelog under Unreleased, marked minor (2.21.0); the release is tag-gated.
🤖 Generated with Claude Code