Skip to content

Stabilize parallel provider status tests - #1443

Merged
kojiwakayama merged 1 commit into
mainfrom
fix/provider-release-followup
May 5, 2026
Merged

kojiwakayama merged 1 commit into
mainfrom
fix/provider-release-followup

Conversation

@kojiwakayama

Copy link
Copy Markdown
Contributor

Summary

Follow-up after #1430 to keep the parallel pre-push/CI suite deterministic.

  • Prefer an already-ready tool input stream part before emitting a stale pending_input heartbeat.
  • Make the API route matcher cache regression assert cache behavior directly instead of wall-clock timing.
  • Remove scheduler-sensitive timing assertions from detached-run tracker and constant-time tests while preserving behavior coverage.

Verification

Targeted:

deno fmt --check src/agent/detached-run-tracker.test.ts src/security/utils/constant-time.test.ts src/provider/runtime-loader/tool-input-status.ts src/routing/api/api-route-matcher.test.ts
DENO_NO_PACKAGE_JSON=1 deno lint src/agent/detached-run-tracker.test.ts src/security/utils/constant-time.test.ts src/provider/runtime-loader/tool-input-status.ts src/routing/api/api-route-matcher.test.ts
VF_DISABLE_LRU_INTERVAL=1 SSR_TRANSFORM_PER_PROJECT_LIMIT=0 REVALIDATION_PER_PROJECT_LIMIT=0 NODE_ENV=production LOG_FORMAT=text deno test --no-check --allow-all --parallel --unstable-worker-options --unstable-net src/agent/detached-run-tracker.test.ts src/security/utils/constant-time.test.ts src/provider/runtime-loader.test.ts src/routing/api/api-route-matcher.test.ts

Targeted result: 4 passed (55 steps) | 0 failed.

Full pre-push hook:

  • format: passed (Checked 3305 files)
  • lint: passed (Checked 3274 files)
  • typecheck: passed
  • unit tests: passed (1663 passed (17210 steps) | 0 failed | 0 ignored (2 steps), 7m27s)

Parallel pre-push runs exposed two nondeterministic checks: tool-input status heartbeats could beat an already-ready stream part, and the route matcher asserted wall-clock timing under shared CI load. The stream helper now prefers a resolved stream part before emitting a pending heartbeat, and the route matcher test checks the cache contract directly.

Constraint: Tests run concurrently in the pre-push hook and CI.

Rejected: Raising the route-matching timing threshold | keeps the same host-load flake with a larger number.

Confidence: high

Scope-risk: narrow

Tested: VF_DISABLE_LRU_INTERVAL=1 SSR_TRANSFORM_PER_PROJECT_LIMIT=0 REVALIDATION_PER_PROJECT_LIMIT=0 NODE_ENV=production LOG_FORMAT=text deno test --no-check --allow-all --parallel --unstable-worker-options --unstable-net src/provider/runtime-loader.test.ts src/routing/api/api-route-matcher.test.ts

Tested: deno fmt --check src/provider/runtime-loader/tool-input-status.ts src/routing/api/api-route-matcher.test.ts

Tested: DENO_NO_PACKAGE_JSON=1 deno lint src/provider/runtime-loader/tool-input-status.ts src/routing/api/api-route-matcher.test.ts
@kojiwakayama
kojiwakayama enabled auto-merge (squash) May 5, 2026 20:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 099535fe4b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +74 to +77
const ready = await Promise.race([
nextPartPromise.then((result) => ({ kind: "part" as const, result })),
Promise.resolve({ kind: "pending" as const }),
]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not let the sentinel win over settled stream parts

When the timeout branch runs after iterator.next() has already settled, this helper still returns null: nextPartPromise.then(...) creates a new pending promise, while Promise.resolve({ kind: "pending" }) is already fulfilled, so the sentinel can win the Promise.race even for a ready part. In that timing window the code still emits a pending_input heartbeat before processing the already-ready tool-input-delta or tool-call, which is the stale status this change is trying to avoid.

Useful? React with 👍 / 👎.

@kojiwakayama
kojiwakayama merged commit 15dabed into main May 5, 2026
16 checks passed
@kojiwakayama
kojiwakayama deleted the fix/provider-release-followup branch May 5, 2026 20:46
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