Skip to content

fix(batch): a status value the server adds later broke callers' types; type response enum fields open, keep named types closed - #31

Merged
AnderRV merged 2 commits into
mainfrom
fix/open-response-enums
Oct 1, 2026
Merged

AnderRV merged 2 commits into
mainfrom
fix/open-response-enums

Conversation

@AnderRV

@AnderRV AnderRV commented Sep 30, 2026

Copy link
Copy Markdown
Member

Why

Response enum fields were typed as closed unions, so any value the server adds later (a new status or failure reason) breaks callers' types and exhaustive handling.

What

  • Extensible<T> = T | (string & {}) on response enum fields (run/job/task/export status, ingest status, failure reason) and the matching handle getters.
  • Named types (RunStatus, JobStatus, …) stay closed, so passing them as request input is unchanged.
  • Tests are now typechecked under vitest (tsconfig.test.json); without it the expectTypeOf assertions never ran. Fixed the 3 type errors this exposed.
  • README: "Extensible values".

No new fields or values. No version bump.

Verification

  • vitest run: 248 passed, 0 type errors. tsc --noEmit clean on both configs. npm run build OK.
  • Reverting to closed types makes the new test fail with 3 type errors.
  • biome check fails only on package.json formatting, same as on main.

🤖 Generated with Claude Code

AnderRV and others added 2 commits September 30, 2026 13:15
…; type response enum fields open, keep named types closed

Response enum fields (run, job, task and export status, ingest_status,
failure_reason) and handle status getters are now Extensible<T> =
T | (string & {}), matching the server's x-extensible-enum contract while
keeping autocomplete. The named types stay closed so they still work as
request input. vitest now typechecks tests/ via tsconfig.test.json so the
expectTypeOf assertions actually run; fixes three test type errors that
surfaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds were not in biome's format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnderRV
AnderRV marked this pull request as ready for review October 1, 2026 10:09
@AnderRV
AnderRV merged commit 48351af into main Oct 1, 2026
1 check passed
@AnderRV
AnderRV deleted the fix/open-response-enums branch October 1, 2026 10:10
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.

1 participant