Skip to content

fix(onboard): fit streaming probe within phase budget - #8038

Merged
senthilr-nv merged 1 commit into
mainfrom
codex/fix-streaming-probe-e2e-contract
Aug 1, 2026
Merged

senthilr-nv merged 1 commit into
mainfrom
codex/fix-streaming-probe-e2e-contract

Conversation

@senthilr-nv

@senthilr-nv senthilr-nv commented Aug 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Onboarding could spend 12 seconds on a stalled Responses API stream even though the calibrated full-E2E inference-phase budget is 6 seconds. This change limits that probe to the budget's existing 5-second headroom, preserves Chat Completions API fallback, and leaves the E2E budget unchanged.

Changes

  • Change the shared curl and native Responses streaming deadline from 12 seconds to 5 seconds. The five calibration samples measured the complete inference phase at 563–805 ms, and the accepted gate adds 5 seconds of minimum headroom for a 6,000 ms cap.
  • Extend the curl public-boundary test to prove that a 300-second general validation override produces a 5-second streaming request between unchanged 300-second non-streaming requests.
  • Update the native stalled-stream test to prove fallback after the 5-second deadline without shortening the initial Responses request.
  • Document the user-visible deadline and correct the v0.0.100 release entry.

No new abstraction, configuration, fallback, migration, compatibility path, or supported surface is added. The existing custom-endpoint onboarding flow and Chat Completions API fallback are the current consumers.

The product root cause was a source deadline introduced after the blocking phase gate without checking the two contracts together. The detection gap was that PR #7884 tested the 12-second value in isolation; the full-E2E run exercised the real stalled-stream path and measured 11,950 ms for the inference phase.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Codex Desktop reviewed exact commit 134e9cbf77d43859bbaf84c5d02d3005ac847b5b. All nine categories pass. The diff changes no credential, input-validation, authorization, dependency, logging, cryptography, configuration, header, policy, or SSRF boundary. Both transports retain authentication, address pinning, and the established Chat Completions API fallback. Focused tests cover the curl and native deadline boundaries.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: Reviewed docs/inference/understand-provider-validation.mdx and docs/changelog/2026-07-31.mdx, plus changed comments and test titles. Generated OpenClaw, Hermes, and Deep Agents variants render the 5-second deadline. Focused inference tests passed 54 tests with 1 skipped, changelog tests passed 6 tests, the docs build completed with 0 errors and 2 existing warnings, and git diff --check passed.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit: Not applicable; scripts/prepare-dgx-station-host.sh is unchanged.
  • Station profile/scenario: Not applicable.
  • Result: Not applicable.
  • Supporting evidence: Not applicable.

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — npx vitest run --project cli src/lib/inference/probe-http-helpers.test.ts src/lib/inference/onboard-probes.test.ts src/lib/inference/openai-validation-session.test.ts src/lib/inference/openai-validation-session-fallback.test.ts: 4 files passed, 54 tests passed, 1 skipped. npx vitest run test/changelog-docs.test.ts: 1 file and 6 tests passed.
  • Applicable broad gate passed — not applicable; this changes one bounded onboarding deadline, focused regression coverage, and matching documentation. Required CI runs the broader suite.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only) — the build completed with 0 errors and 2 existing warnings.
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only) — no new pages.

Signed-off-by: Senthil Ravichandran [email protected]

Summary by CodeRabbit

  • Improvements

    • Compatible-endpoint onboarding now completes streaming validation after up to 5 seconds instead of 12.
    • Chat Completions fallback remains available when no Responses API streaming event is received.
  • Documentation

    • Updated validation guidance to reflect the five-second streaming wait and fallback behavior.
  • Tests

    • Expanded coverage for timeout handling, fallback requests, retries, and configurable validation timeouts.

@senthilr-nv senthilr-nv added the area: docs Documentation, examples, guides, or docs build label Aug 1, 2026
@senthilr-nv senthilr-nv self-assigned this Aug 1, 2026
@senthilr-nv senthilr-nv added the area: docs Documentation, examples, guides, or docs build label Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Responses API streaming probe timeout changed from 12 seconds to 5 seconds. Chat Completions fallback behavior remains unchanged. Tests and documentation now cover the updated timeout and fallback sequence.

Changes

Streaming probe timeout

Layer / File(s) Summary
Reduce streaming probe timeout
src/lib/inference/probe-http-helpers.ts
The streaming event probe maximum duration changed from 12 seconds to 5 seconds.
Update fallback validation coverage
src/lib/inference/onboard-probes.test.ts, src/lib/inference/openai-validation-session.test.ts, src/lib/inference/probe-http-helpers.test.ts, docs/changelog/2026-07-31.mdx, docs/inference/understand-provider-validation.mdx
Tests verify the five-second probe timeout and the 300-second, 5-second, and 300-second request sequence. Documentation describes the updated fallback behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: area: inference, area: onboarding, bug-fix

Suggested reviewers: cv, apurvvkumaria

Sequence Diagram(s)

sequenceDiagram
  participant OnboardingValidation
  participant ResponsesAPI
  participant ChatCompletionsAPI
  OnboardingValidation->>ResponsesAPI: Probe streaming events for up to 5 seconds
  ResponsesAPI-->>OnboardingValidation: No response.output_text.delta
  OnboardingValidation->>ChatCompletionsAPI: Run fallback validation
  ChatCompletionsAPI-->>OnboardingValidation: Return fallback result
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adjusting the onboarding streaming probe to fit the phase budget.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-streaming-probe-e2e-contract

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

@github-code-quality

github-code-quality Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 134e9cb in the codex/fix-streaming-... branch remains at 96%, unchanged from commit 4feccff in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 134e9cb in the codex/fix-streaming-... branch remains at 81%, unchanged from commit 99d5b66 in the main branch.

Show a code coverage summary of the most impacted files.
File main 99d5b66 codex/fix-streaming-... 134e9cb +/-
src/lib/actions...opair-budget.ts 100% 100% 0%
src/lib/sandbox...rce-identity.ts 88% 88% 0%
src/lib/tunnel/services.ts 75% 75% 0%
src/lib/onboard...erialization.ts 90% 92% +2%
src/lib/domain/.../connect-env.ts 89% 97% +8%
src/lib/actions...air-approval.ts 66% 88% +22%

Updated August 01, 2026 03:13 UTC

@senthilr-nv senthilr-nv added bug-fix PR fixes a bug or regression area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: inference Inference routing, serving, model selection, or outputs labels Aug 1, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/inference/understand-provider-validation.mdx`:
- Line 40: In the Responses streaming description, format the API event
identifier response.output_text.delta as inline code by wrapping it in
backticks; leave the surrounding prose unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 57f0e614-a86d-416a-915d-cb546f499b07

📥 Commits

Reviewing files that changed from the base of the PR and between 227e8b9 and 134e9cb.

📒 Files selected for processing (6)
  • docs/changelog/2026-07-31.mdx
  • docs/inference/understand-provider-validation.mdx
  • src/lib/inference/onboard-probes.test.ts
  • src/lib/inference/openai-validation-session.test.ts
  • src/lib/inference/probe-http-helpers.test.ts
  • src/lib/inference/probe-http-helpers.ts

@senthilr-nv
senthilr-nv requested review from apurvvkumaria and cv August 1, 2026 03:05
@github-actions

github-actions Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized E2E selections differ; severity counts match.
2 additional E2E selections from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • onboard-resume: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • onboard-repair: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

Second-opinion E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: inference-routing, network-policy

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@senthilr-nv
senthilr-nv enabled auto-merge (squash) August 1, 2026 03:15
@senthilr-nv
senthilr-nv merged commit 3aeee69 into main Aug 1, 2026
76 of 77 checks passed
@senthilr-nv
senthilr-nv deleted the codex/fix-streaming-probe-e2e-contract branch August 1, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation, examples, guides, or docs build area: inference Inference routing, serving, model selection, or outputs area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants