Skip to content

spec-sync(v2): send pageSize query param and support cancelled extract status - #164

Open
yzld2002 wants to merge 2 commits into
mainfrom
spec-sync/v2
Open

spec-sync(v2): send pageSize query param and support cancelled extract status#164
yzld2002 wants to merge 2 commits into
mainfrom
spec-sync/v2

Conversation

@yzld2002

@yzld2002 yzld2002 commented Sep 10, 2026

Copy link
Copy Markdown
Member

Automated V2 spec-sync PR (client.v2).

  • Commit 1 (mechanical): normalized V2 spec snapshot + regenerated reference models.
  • Commit 2 (AI, only if the spec diff needs SDK changes): client.v2 resources/methods/tests/docs wired from the diff, added after this PR opened. Workflow-only drift is excluded and an AI no-op is skipped, so some drifts produce a mechanical-only PR with no second commit.

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 cancelled as a recognized terminal status for extract jobs.

Changes:

  • The page_size keyword on parse_jobs.list, extract_jobs.list, and build_schema_jobs.list (sync and async) is now sent on the wire as pageSize, with no change to the public kwarg name or the response's page_size field.
  • extract_jobs.wait now treats cancelled as a terminal status (in addition to completed/failed), since the extract list-jobs envelope can report it.
  • Documented that output_save_url is now shared between the async extract wire contract and /api/extract, alongside spec description updates for split-document filename behavior on markdown file uploads.

Copilot AI balanced review requested due to automatic review settings September 10, 2026 10:02
@yzld2002
yzld2002 deployed to spec-sync-contract September 10, 2026 10:02 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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.

Copilot AI review requested due to automatic review settings September 10, 2026 10:10
@yzld2002
yzld2002 deployed to spec-sync-contract September 10, 2026 10:10 — with GitHub Actions Active
@yzld2002 yzld2002 changed the title spec-sync: track V2 spec drift spec-sync(v2): send pageSize query param and support cancelled extract status Sep 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

Comment on lines +214 to +219
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
Comment thread api.md
- <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.
Comment thread docs/v2-testing.md
Comment on lines +179 to +182
(`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.
Comment on lines +307 to +309
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.
@yzld2002

Copy link
Copy Markdown
Member Author

⚠️ New V2 spec drift beyond this PR (live-spec c4c717f89931). This PR is a snapshot of earlier drift and is now stale relative to the live spec — merge or close it and the next spec-sync run will open a fresh PR covering the rest.

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