Skip to content

feat(api): add compaction progress events - #2749

Merged
markstuart-oai merged 1 commit into
mainfrom
castiron/promotions/pr-139
Sep 16, 2026
Merged

markstuart-oai merged 1 commit into
mainfrom
castiron/promotions/pr-139

Conversation

@markstuart-oai

Copy link
Copy Markdown
Contributor

Summary

Adds typed compaction progress events to Responses streams and WebSocket listeners.

Changes

  • Expose response.compaction.compacting with its item ID, output index, and sequence number
  • Accept compaction progress in response stream helpers while preserving the response snapshot
  • Recognize credit_balance_exhausted errors from managed agent turns
  • Keep direct WebSocket error access while excluding the underlying event from automatic serialization

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

45 mixed files remain; 0 existing customizations changed; 7 generated baselines changed.

Compared 0d69cb9338d0 → 724e9a3536da. Generated baselines verified.

File Result Current custom patch
api.md Generated baseline changed +28 / −0
src/resources/beta/beta.ts Generated baseline changed +109 / −0
src/resources/beta/index.ts Generated baseline changed +3 / −0
src/resources/beta/responses/internal-base.ts Generated baseline changed +8 / −11
src/resources/beta/responses/responses.ts Generated baseline changed +12 / −0
src/resources/responses/internal-base.ts Generated baseline changed +8 / −11
src/resources/responses/responses.ts Generated baseline changed +158 / −41
38 existing customizations unchanged
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/client.ts
  • src/resources/audio/transcriptions.ts
  • src/resources/audio/translations.ts
  • src/resources/beta/agents/environments/files.ts
  • src/resources/beta/agents/sessions/sessions.ts
  • src/resources/beta/assistants.ts
  • src/resources/beta/responses/ws-base.ts
  • src/resources/beta/responses/ws.ts
  • src/resources/beta/threads/index.ts
  • src/resources/beta/threads/runs/index.ts
  • src/resources/beta/threads/runs/runs.ts
  • src/resources/beta/threads/threads.ts
  • src/resources/chat/completions/completions.ts
  • src/resources/chat/completions/index.ts
  • src/resources/conversations/index.ts
  • src/resources/embeddings.ts
  • src/resources/files.ts
  • src/resources/fine-tuning/checkpoints/permissions.ts
  • src/resources/images.ts
  • src/resources/live/forks/ws-base.ts
  • src/resources/live/forks/ws.ts
  • src/resources/live/sideband/ws-base.ts
  • src/resources/live/sideband/ws.ts
  • src/resources/live/ws-base.ts
  • src/resources/live/ws.ts
  • src/resources/responses/ws-base.ts
  • src/resources/responses/ws.ts
  • src/resources/skills/skills.ts
  • src/resources/skills/versions/versions.ts
  • src/resources/vector-stores/file-batches.ts
  • src/resources/vector-stores/files.ts
  • src/resources/webhooks/index.ts
  • src/resources/webhooks/webhooks.ts
  • tests/api-resources/beta/agents/environments/files.test.ts
  • tests/lib/data-residency.test.ts

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 35034535575 --repo openai/openai-node \
  --name castiron-custom-code-35034535575-1 --dir /tmp/castiron-custom-code-35034535575-1
git apply --stat /tmp/castiron-custom-code-35034535575-1/custom-code.patch
cat /tmp/castiron-custom-code-35034535575-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 0d69cb9338d01e77487b1548f08c3efdb21711d3 724e9a3536dac10e1eee0da1ab4c574f5539ceb1
python3 scripts/castiron/custom_code_report.py report \
  --base 0d69cb9338d01e77487b1548f08c3efdb21711d3 \
  --head 724e9a3536dac10e1eee0da1ab4c574f5539ceb1 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-724e9a3536da
cat /tmp/castiron-custom-code-724e9a3536da/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

Castiron-Internal-PR: openai/openai-node-internal#139
Castiron-Source-SHA: aa7e1df65e916e52acd28f945760bc9e9b13d6ae
Castiron-Public-Base-SHA: 0d69cb9
@markstuart-oai
markstuart-oai force-pushed the castiron/promotions/pr-139 branch from ab62611 to 724e9a3 Compare September 15, 2026 22:18
@markstuart-oai
markstuart-oai marked this pull request as ready for review September 15, 2026 23:11
@markstuart-oai
markstuart-oai requested a review from a team as a code owner September 15, 2026 23:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-15T23:13:20.756305Z 724e9a3 Draft marked ready
🔒 Security Review ✅ Completed 2026-09-15T23:14:39.753745Z 724e9a3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openai-sdks

openai-sdks Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 7.59s for Node SDK PR #2749.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 114ms
tests/chat-completions-create.test.ts ✅ Passed 159ms
tests/chat-completions-stream.test.ts ✅ Passed 104ms
tests/files-content-binary.test.ts ✅ Passed 104ms
tests/files-create-multipart.test.ts ✅ Passed 98ms
tests/files-list-pagination.test.ts ✅ Passed 95ms
tests/initialize-config.test.ts ✅ Passed 159ms
tests/instance-isolation.test.ts ✅ Passed 100ms
tests/models-list.test.ts ✅ Passed 82ms
tests/responses-background-lifecycle.test.ts ✅ Passed 119ms
tests/responses-body-method-errors.test.ts ✅ Passed 282ms
tests/responses-cancel-timeout.test.ts ✅ Passed 173ms
tests/responses-cancel.test.ts ✅ Passed 136ms
tests/responses-compact-retries.test.ts ✅ Passed 145ms
tests/responses-compact.test.ts ✅ Passed 143ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 86ms
tests/responses-create-advanced.test.ts ✅ Passed 123ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.009s
tests/responses-create-errors.test.ts ✅ Passed 148ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 86ms
tests/responses-create-retries.test.ts ✅ Passed 202ms
tests/responses-create-stream-failures.test.ts ✅ Passed 85ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.117s
tests/responses-create-stream-wire.test.ts ✅ Passed 1.593s
tests/responses-create-stream.test.ts ✅ Passed 61ms
tests/responses-create-terminal-states.test.ts ✅ Passed 141ms
tests/responses-create-timeout.test.ts ✅ Passed 154ms
tests/responses-create.test.ts ✅ Passed 145ms
tests/responses-delete.test.ts ✅ Passed 138ms
tests/responses-input-items-errors.test.ts ✅ Passed 106ms
tests/responses-input-items-list.test.ts ✅ Passed 125ms
tests/responses-input-items-options.test.ts ✅ Passed 130ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 186ms
tests/responses-input-tokens-count.test.ts ✅ Passed 152ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.265s
tests/responses-not-found-errors.test.ts ✅ Passed 173ms
tests/responses-parse.test.ts ✅ Passed 104ms
tests/responses-retrieve-retries.test.ts ✅ Passed 165ms
tests/responses-retrieve.test.ts ✅ Passed 120ms
tests/responses-stored-method-errors.test.ts ✅ Passed 358ms
tests/retry-behavior.test.ts ✅ Passed 2.771s
tests/sdk-error-shape.test.ts ✅ Passed 190ms

View OkTest run #35034509851

SDK merge (d5b2d60957b0) · head (724e9a3536da) · base (0d69cb9338d0) · OkTest (08ec4299e769)

@jbeckwith-oai jbeckwith-oai 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.

Reviewed exact head 724e9a3536dac10e1eee0da1ab4c574f5539ceb1. Stable/beta and WebSocket unions expose the compaction progress event with the expected fields. The accumulator recognizes the compaction item scope but deliberately ignores progress for mutation, while SSE, named listeners, generic listeners, async iteration, and WebSocket delivery retain repeated events; focused tests also confirm snapshot and output-item identity are unchanged. The accompanying WebSocket error hardening preserves direct .error access while making the payload non-enumerable and safely selecting string messages, with coverage. Current-head build, lint, Node 22/24/26, ecosystem, CodeQL, breaking-change, performance, and Castiron checks pass, and exact-head code/security reviews completed with no threads.

@markstuart-oai
markstuart-oai added this pull request to the merge queue Sep 16, 2026
Merged via the queue into main with commit 425502d Sep 16, 2026
60 checks passed
@markstuart-oai
markstuart-oai deleted the castiron/promotions/pr-139 branch September 16, 2026 00:08
@openai-sdks openai-sdks Bot mentioned this pull request Sep 16, 2026
HAYDEN-OAI pushed a commit that referenced this pull request Sep 16, 2026
Automated Release PR
---


##
[7.17.0](v7.16.0...v7.17.0)
(2026-09-16)


### Features

* **api:** add compaction progress events
([#2749](#2749))
([425502d](425502d))


### Bug Fixes

* **ci:** retry transient Deno download failures
([#2752](#2752))
([e39037b](e39037b))
* preserve chat runner abort reasons
([#2607](#2607))
([eda4d0c](eda4d0c))
* **realtime:** preserve native WebSocket error causes
([#2715](#2715))
([58fa72a](58fa72a))
* **responses:** reject function-based API keys in WebSocket
constructors
([#2586](#2586))
([eea7618](eea7618))
* **runners:** reject unfinished turns in streaming runTools
([#2716](#2716))
([937ed67](937ed67))
* **streaming:** emit terminal SSE events missing a trailing blank line
([#2726](#2726))
([94d6418](94d6418))
* **zod:** omit impossible optional branch in strict schemas
([#2751](#2751))
([2b4c2c7](2b4c2c7))


### Chores

* update lint tooling and tailor anti-slop for the SDK
([#2753](#2753))
([21a03c2](21a03c2))


### Documentation

* **examples:** preserve split UTF-8 in raw stream consumer
([#2714](#2714))
([f44152a](f44152a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
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