Repository navigation
fix(files): use a monotonic clock for processing timeout - #2657
Conversation
## Summary - Use Node's monotonic clock for the Steady cache lock's existing 10-second acquisition budget. - Add two regression tests through the actual cache CLI for backward and forward wall-clock corrections. The test preloads and child program are static; paths and clock direction are passed as data. - Keep the 50-ms polling interval, cancellation, lease ownership, separate cleanup acquisition, and wall-clock file-aging timestamps unchanged. No generated files, SDK runtime code, dependency pins, or cache policy changes. ## Reproduction On current main, hold the lifecycle lock and release it after 12 real seconds. With no clock adjustment, the wrapper rejects the command with its existing lock-timeout error. With a single 60-second backward `Date.now()` correction after the acquisition deadline is established, the same wrapper incorrectly launches the command after roughly 12.1 seconds and exits successfully. This unaccelerated command-boundary reproduction fails before the fix on Node 22.0.0, 24.19.0, and 26.7.0. After the fix, both the normal-clock and corrected-clock cases reject late execution on all three runtimes, preserve the existing owner's lock until it is released, and leave no leases. The separate cleanup lock explains why the final process exit occurs after the fixture releases the lock; that lifecycle behavior is not changed here. ## Validation - Both new regressions failed before the production change and passed afterward. - New clock and existing cancellation tests: 8 passed on Node 22.0.0, 22.22.3, 24.19.0, and 26.7.0. An independent reviewer also repeated the clock tests five times successfully. - Canonical cache expiry, active-lease, and cleanup checks passed on Node 22.0.0, 24.19.0, and 26.7.0. - Full canonical handwritten suite on the final files: 7,800 tests passed across 205 files. - Canonical lint/format, TypeScript checking, CJS/ESM build, and `git diff --check` passed. - Independent adversarial review found no security, compatibility, lock-ownership, cancellation, or regression-test issues. Windows was reviewed for path/spawn compatibility but not executed locally; the generated suite will run in CI. This is separate from openai#2657's file-processing timeout and retains openai#2636's Steady cancellation behavior.
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Reviewed d9c8f96. No actionable findings. The clock change preserves polling order, terminal-status handling, and the strict > timeout boundary. Source review only; tests were not run.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Castiron custom code✅ No new custom-code files detected. 32 mixed files remain; 0 existing customizations changed. Compared 32 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 34255106618 --repo openai/openai-node \
--name castiron-custom-code-34255106618-1 --dir /tmp/castiron-custom-code-34255106618-1
git apply --stat /tmp/castiron-custom-code-34255106618-1/custom-code.patch
cat /tmp/castiron-custom-code-34255106618-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 80ce89f355ddb2ea74e48da0284a85d536597446 c5d027a0bd5022d48a005eeacda3239a83f8efb7
python3 scripts/castiron/custom_code_report.py report \
--base 80ce89f355ddb2ea74e48da0284a85d536597446 \
--head c5d027a0bd5022d48a005eeacda3239a83f8efb7 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-c5d027a0bd50
cat /tmp/castiron-custom-code-c5d027a0bd50/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Automated Release PR --- ## [7.12.0](openai/openai-node@v7.11.0...v7.12.0) (2026-09-08) ### Features * **api:** add GPT Image 2.5 models and image options ([openai#2705](openai#2705)) ([6500a16](openai@6500a16)) ### Bug Fixes * **assistants:** reject root IDs in run-step deltas ([openai#2698](openai#2698)) ([63dfa4c](openai@63dfa4c)) * **files:** use a monotonic clock for processing timeout ([openai#2657](openai#2657)) ([bb0f51b](openai@bb0f51b)) * preserve suppressed workload authorization ([openai#2699](openai#2699)) ([57bbfd3](openai@57bbfd3)) --- 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>
Changes being requested
files.waitForProcessing()measuresmaxWaitwithDate.now(). A system clock correction can therefore cause a premature timeout or allow a response after the elapsed-time budget.Use
performance.now()in the handwrittensrc/lib/file-processing.tshelper to measure elapsed time. Preserve the existing polling interval, terminal statuses, initially terminal response behavior, and strict>timeout check after retrieval.Add public-client regression cases for forward and backward clock corrections, and update the existing elapsed-time mocks. Both new cases fail with the previous implementation and pass with this change. No generated SDK files or dependencies change.
Additional context & links
Validation on Node.js 24.19.0:
./scripts/test tests/lib/file-processing.test.ts: 18 passed../scripts/lint: passed../node_modules/.bin/tsc: passed../scripts/build: passed../scripts/test: all 7,751 handwritten tests passed. Generated tests could not start locally because the pinned Steady installation failed while fetching the@std/climanifest from JSR.git diff --check: passed.AI assistance: Codex was used to prepare and test this patch.