spec-sync(v2): send pageSize query param and support cancelled extract status - #164
spec-sync(v2): send pageSize query param and support cancelled extract status#164yzld2002 wants to merge 2 commits into
pageSize query param and support cancelled extract status#164Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The PR explicitly requires human review before merge despite being a valid mechanical-only synchronization.
Pull request overview
Updates the mirrored V2 OpenAPI snapshot and regenerated reference models to track upstream specification drift.
Changes:
- Refreshes the V2 specification snapshot.
- Regenerates reference Pydantic models from that snapshot.
File summaries
| File | Description |
|---|---|
specs/v2-aide.json |
Updates the upstream V2 specification snapshot. |
specs/_generated/v2_models.py |
Regenerates reference models from the updated specification. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
pageSize query param and support cancelled extract status
There was a problem hiding this comment.
🟡 Changes recommended
The documentation overstates cancelled-status behavior for wait(), and the live pagination test can pass without verifying the parameter.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 4
- Review effort level: Balanced
| jobs = ( | ||
| staging_client.v2.parse_jobs.list(page=0, page_size=1) | ||
| if resource == "parse" | ||
| else staging_client.v2.extract_jobs.list(page=0, page_size=1) | ||
| ) | ||
| assert len(jobs) <= 1 |
| - <code>client.v2.extract_jobs.<a href="./src/landingai_ade/resources/v2/extract.py">wait</a>(job_id, \*, timeout=600, poll_interval=None, raise_on_failure=False) -> <a href="./src/landingai_ade/types/v2/job.py">Job</a></code> | ||
|
|
||
| Same polling/timeout semantics as `parse_jobs.wait`. Extract jobs have no `cancelled` status, so `raise_on_failure` only ever triggers on `failed`. | ||
| Same polling/timeout semantics as `parse_jobs.wait`. `cancelled` is a terminal extract status (the list-jobs envelope reports it alongside `pending` / `processing` / `completed` / `failed`), so waiting stops on it like any other terminal state. |
| (`test_extract_job_list_normalizes_cancelled_status` in | ||
| `tests/api_resources/v2/test_extract.py`) proving the value survives | ||
| normalization and counts as terminal, so `wait()` stops on it instead of polling | ||
| to its deadline. |
| set and the job ends failed/cancelled with an error attached. `cancelled` | ||
| is a terminal extract status (the spec added it to the list-jobs envelope | ||
| on 2026-09-10), so waiting stops on it like any other terminal state. |
|
|
Automated V2 spec-sync PR (
client.v2).Gates (surface-lock, V2 contract tests, lint/test/typecheck) must pass. When present, the AI commit is a draft a human finishes (the V2 ergonomic layer — unified Job, dual-host, schema coercion — is not in the spec). Human review required before merge.
What changed
AI-generated from the PR diff — verify against the actual changes.
This PR updates the V2 job-listing query parameter to match the gateway's wire naming and adds
cancelledas a recognized terminal status for extract jobs.Changes:
page_sizekeyword onparse_jobs.list,extract_jobs.list, andbuild_schema_jobs.list(sync and async) is now sent on the wire aspageSize, with no change to the public kwarg name or the response'spage_sizefield.extract_jobs.waitnow treatscancelledas a terminal status (in addition tocompleted/failed), since the extract list-jobs envelope can report it.output_save_urlis now shared between the async extract wire contract and/api/extract, alongside spec description updates for split-documentfilenamebehavior onmarkdownfile uploads.