Skip to content

fix: reject unknown Run execution statuses - #9

Merged
pppolf merged 1 commit into
mainfrom
agent/validate-run-status-enum
Aug 12, 2026
Merged

pppolf merged 1 commit into
mainfrom
agent/validate-run-status-enum

Conversation

@pppolf

@pppolf pppolf commented Aug 12, 2026

Copy link
Copy Markdown
Member

What

  • validate run_status against the closed Run status enum in execution responses
  • add a forged-response regression for an arbitrary status string

Why

The generated OpenAPI contract exposes run_status as a closed enum, but the runtime parser accepted any string. A malformed or drifted server response could therefore enter UI state instead of failing as an invalid response.

Impact

The client now fails closed when execution response status semantics drift from the Go/OpenAPI contract. Valid statuses are unchanged.

Checks

  • npm test -- --run src/api/client.test.ts (66 tests)
  • npm test (55 files, 212 tests)
  • npm run typecheck
  • npm run check:api
  • npm run build
  • npm audit --audit-level=moderate
  • git diff --check

All checks ran with Node 24.19.0. Vite retains the existing large-chunk warning.

@pppolf
pppolf marked this pull request as ready for review August 12, 2026 14:07
@pppolf
pppolf merged commit e4da1f6 into main Aug 12, 2026
4 checks passed
@NanaseInori
NanaseInori deleted the agent/validate-run-status-enum branch September 16, 2026 09:09
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