Skip to content

fix: accept Claude JSON event arrays - #48

Merged
thisguymartin merged 1 commit into
mainfrom
codex/38-claude-event-arrays
Oct 13, 2026
Merged

thisguymartin merged 1 commit into
mainfrom
codex/38-claude-event-arrays

Conversation

@thisguymartin

Copy link
Copy Markdown
Owner

Closes #38

What changed

Claude and gateway lanes rejected JSON event arrays. The shared parser now accepts legacy objects and selects the last type: "result" event from arrays, including its model, session, usage, and cost metadata.

  • Reject terminal errors before requiring final text; never fall back to an earlier success.
  • Preserve fork model matching and gateway costUsd: null accounting.
  • Add regression cases for Claude, DeepSeek, MiniMax, and OpenRouter, including missing results and malformed output.

Syncs the parser change from open-pstack PR #130. Its Grok changes are outside this PR.

Verification

  • Bun tests, strict typecheck, static invariants, and plugin validation pass.
  • The exact candidate is installed in every affected harness.
  • The changed behavior passes from each real user surface.
  • The installed version, action, and observed result appear below.

bash scripts/check.sh passed on a clean copy of base 33eba49 plus this PR's two files: 284 tests, strict typechecks, static invariants, manifest parsing, and both Claude plugin validators. All 32 focused parser tests passed; the new cases exposed 16 failures before the fix. Unrelated concurrent workspace edits were excluded from the candidate and PR.

Security scan: PASS for the complete two-file diff and parser -> model verification -> receipt boundary. No confirmed findings. No dependency audit requested.

Live evidence:

Candidate: pstack 1.5.0 @ 735b8d45699a0ac1ea20f8bfc64ea786f124918d.

Claude Code, Codex, OpenCode beta, and OMP: candidate installation and real-surface tests not run, as requested. No installed version or live result is claimed. Setup, scope, and Claude/gateway dispatch checks remain pending under docs/LIVE-GATE.md.

A pull request without live evidence remains a draft. Do not merge, tag, release, or roll it out.

Claude and gateway lanes rejected event arrays before reaching the terminal result. Sync the parser behavior from open-pstack PR ericlitman#130 for #38 while preserving fork-specific model verification and gateway accounting.

- Select the last result event and retain legacy object output.

- Reject terminal errors before requiring final text.

- Cover terminal metadata, malformed output, and error precedence across Claude, DeepSeek, MiniMax, and OpenRouter.
@thisguymartin
thisguymartin marked this pull request as ready for review October 13, 2026 22:40
@thisguymartin
thisguymartin merged commit 75b413d into main Oct 13, 2026
1 check passed
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.

Sync 2: Accept Claude JSON event arrays

1 participant