Skip to content

docs(inband): write down that Responses over a WebSocket is a no-op - #1394

Merged
amiddavid merged 3 commits into
mainfrom
feat/inv-1388-tools
Nov 25, 2026
Merged

amiddavid merged 3 commits into
mainfrom
feat/inv-1388-tools

Conversation

@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

Writes down that Responses over a WebSocket is a known no-op for the in-band loop. Refs #1388 (point 1).

What changed

Behaviour

None. Comments only.

Data dependence

None. No code path changes.

How it was tested

macOS, Go 1.27.4: go build ./inband and gofmt -l inband are clean.

Technical notes

  • Codex tries a WebSocket first (codex-api/src/endpoint/responses_websocket.rs, openai/codex f64f003).
  • Through this proxy the upgrade gets 426 (proxy/proxy.go, Handler.Mux), so Codex falls back to HTTPS.
  • The no-op applies only when a client reaches the provider by a route with no HTTP host.

A client that sends Responses over a WebSocket bypasses the HTTP host.
No inject, offload or expand runs on that path. This is safe because
nothing lossy happens. The proxy answers the upgrade with 426, so Codex
uses HTTPS through it.

Refs #1388

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
Refs #1388

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddaid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddaid's session fresh 1 of 2 1 of 2 5a3cb6e963da blocking

Verdict: blocking

Findings

  1. inband/doc.go:5 — the Codex citation path does not resolve; it is missing the codex-rs/ prefix
    • What fails: a reader follows codex-api/src/endpoint/responses_websocket.rs, openai/codex f64f003 and gets a 404. The file lives at codex-rs/codex-api/src/endpoint/responses_websocket.rs. The second citation in the same doc (codex-rs/core/src/client.rs) keeps the prefix, so the two disagree on how the repo is laid out.
    • Proof: https://github.com/openai/codex/blob/f64f003/codex-api/src/endpoint/responses_websocket.rs returns 404. The GitHub code search for filename:responses_websocket.rs in openai/codex returns codex-rs/codex-api/src/endpoint/responses_websocket.rs, and gh api repos/openai/codex/contents/codex-rs/codex-api/src/endpoint/responses_websocket.rs?ref=f64f003 returns the file. The file does send Responses over a WebSocket, so only the path is wrong.
    • Fix: write codex-rs/codex-api/src/endpoint/responses_websocket.rs.

Non-blocking

  • The doc says OpenCode "keeps HTTP for the rest of the session". The source comment says "pins the Session to HTTP until restart or move" (model-transport.ts, v2.4.1). A session move can end the pin earlier. The simplification is fair for this doc.

What I checked

  • Read the full diff (both commits, 20e335e and 5a3cb6e) and the code around it: inband/doc.go, inband/loop.go, inband/sse.go, proxy/proxy.go:584-609.
  • The package description matches inband/loop.go:18-25: the host answers our own tools (expand, adjudicate, tool search) and the package keeps the decisions.
  • The 426 claim matches proxy/proxy.go:602-609: GET /openai/v1/responses with an Upgrade: websocket header answers http.StatusUpgradeRequired. It also matches docs/tool-search-matrix.md:103-104.
  • The "no-op is safe" reasoning holds: a marker needs an offload, and offload, inject and expand all run in the HTTP host, so a route with no HTTP host does nothing lossy. Fail open by construction.
  • Verified the external citations against the upstream repos: codex-rs/core/src/client.rs exists at openai/codex f64f003 and contains the UPGRADE_REQUIRED arms; packages/core/src/session/model-transport.ts exists at sst/opencode v2.4.1 and its comment says any connect failure "pins the Session to HTTP until restart or move" (finding 1 is the only citation that does not resolve).
  • The doc follows the repo's doc.go convention (lifecycle, reqfacts, respfacts, schema all have one) and is the only package comment in inband — loop.go and sse.go carry no package comment, so there is no duplicate.
  • Docs-only PR: no behavior change, no data-dependence change, no new binaries. Consistent with docs/design.md:23.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session fresh 2 of 2 1 of 2 5a3cb6e963da blocking

Verdict: blocking

Findings

  1. inband/doc.go:5 — the Codex citation path is wrong: the file is under codex-rs/, not at the repo root
    • What fails: a reader who follows the citation codex-api/src/endpoint/responses_websocket.rs in openai/codex at f64f003 gets a 404. At that commit the repo has no top-level codex-api directory; the file is at codex-rs/codex-api/src/endpoint/responses_websocket.rs. The same doc cites codex-rs/core/src/client.rs with the correct prefix, so the missing prefix is an error, not a style choice.
    • Proof: GitHub API, repo openai/codex at ref f64f003: contents/codex-api/src/endpoint returns 404; contents/codex-rs/codex-api/src/endpoint/responses_websocket.rs returns the file. The root listing at f64f003 has codex-cli and codex-rs, no codex-api.
    • Fix: add the prefix: codex-rs/codex-api/src/endpoint/responses_websocket.rs. One word.

Non-blocking

  • The OpenCode citation names version "2.4.1". The git tag in sst/opencode is v2.4.1. As a version number, not a ref, it reads fine. No change needed.
  • Issue #1388 point 1 also asks for the client-coverage page. PR #1400 (docs/client-coverage-tools) covers that half. The split is fine, but the two PRs should merge together or #1400 first, so issue #1388 point 1 does not sit half-done on main.
  • The doc says OpenCode falls back "after any failed WebSocket connect". The cited file also falls back after repeated stream failures mid-session ("session websocket failed repeatedly; using http"). The doc's sentence is true as written; the stream-failure case is extra, not a contradiction.

What I checked

  • Read the full diff: 2 commits, one new file inband/doc.go (18 lines). Docs-only. No behavior change, no data-dependence change, no new binaries.
  • inband package sources (loop.go, sse.go): the package doc claim "nothing in this package runs" on a WebSocket path matches the architecture. inband is called by HTTP hosts only. doc.go is the only package comment, so no duplicate-doc vet issue.
  • The 426 claim against this repo: proxy/proxy.go:602-605 answers GET /openai/v1/responses with 426 when Upgrade: websocket is present. Codex builds its WebSocket URL from RESPONSES_PATH = "/responses" (codex-rs/codex-api/src/lib.rs:19), so the upgrade lands on that route.
  • The Codex fallback claim, in openai/codex at f64f003: codex-rs/core/src/client.rs has two StatusCode::UPGRADE_REQUIRED arms (lines 1940 and 2442); each calls try_switch_fallback_transport and returns, so the turn continues over HTTP at once.
  • The "full history over HTTP" claim, at f64f003: the HTTP path (stream_responses_http → build_responses_request) builds the input from the whole prompt and never sets previous_response_id; the incremental previous_response_id continuation exists only on the WebSocket path (prepare_websocket_request). This also matches our own note in inband/sse.go:846-848.
  • The OpenCode claim, in sst/opencode at v2.4.1, packages/core/src/session/model-transport.ts: "Any connect failure, transient or not, pins the Session to HTTP until restart or move" — the connect-failure catch sets httpFallback = true, and every later exchange checks it first. Code search finds no previous_response_id in sst/opencode, so OpenCode sends full history.
  • Issue #1388: this PR delivers point 1's package-doc half.

@amiddavid

Copy link
Copy Markdown
Collaborator Author

Both findings fixed in 1b2bedf (comments only):

  1. The Codex path now has the codex-rs/ prefix: codex-rs/codex-api/src/endpoint/responses_websocket.rs. The path came from the issue text. The issue body is fixed too.
  2. The OpenCode sentence now says "until restart or a session move", as model-transport.ts (v2.4.1) says.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddaid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session resumed 1 of 2 2 of 2 1b2bedf46318 approve

Verdict: approve

Findings

None. Both round-1 findings are fixed.

Non-blocking

  • Agree with reviewer 2, non-blocking note on PR #1400: this PR delivers the package-doc half of issue #1388 point 1. The client-coverage page is the other half. Merge the two together, or #1400 first, so the issue does not sit half-done on main.

What I checked

  • Last review: round 1, 5a3cb6e, 2026-11-25T11:32:41Z.
  • New commits read: 1 (1b2bedf, "docs(inband): fix the Codex path and the OpenCode fallback wording").
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files).
  • New items since my last review, and what I did about each:
    • Reviewer 2's round-1 review (11:36:21Z). Its finding is the same as my round-1 finding: the missing codex-rs/ prefix. Its non-blocking notes (version tag name, the #1400 split, the extra stream-failure fallback in OpenCode) need no change here. I checked each against the diff; none is contradicted by the fix commit.
    • The author's comment (11:37:52Z): "Both findings fixed in 1b2bedf". Verified below.
    • Commit 1b2bedf. Read the full diff and the file around it. It changes two comment lines only:
      1. My round-1 finding, fixed. The citation now reads codex-rs/codex-api/src/endpoint/responses_websocket.rs, which is the path I verified against openai/codex at f64f003 (gh api repos/openai/codex/contents/codex-rs/codex-api/src/endpoint/responses_websocket.rs?ref=f64f003 returns the file). It now agrees with the codex-rs/core/src/client.rs citation in the same doc.
      2. My round-1 non-blocking note, fixed too. The OpenCode sentence now says "until restart or a session move", which matches the source comment in model-transport.ts at sst/opencode v2.4.1 ("pins the Session to HTTP until restart or move").
  • The fix commit touches no code, so the round-1 verification stands: the 426 claim matches proxy/proxy.go:602-609, the no-op is fail-open by construction, and the doc is the only package comment in inband.
  • Docs-only PR: no behavior change, no data-dependence change, no new binaries.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session resumed 2 of 2 2 of 2 1b2bedf46318 approve

Verdict: approve

Findings

None.

Earlier findings

  1. inband/doc.go:5 — wrong Codex citation path (round 1, mine, same as reviewer 1's finding 1): fixed.
    • The new head writes codex-rs/codex-api/src/endpoint/responses_websocket.rs. I verified in round 1 that this path resolves at openai/codex f64f003. The two Codex citations in the doc now agree on the prefix.
  2. OpenCode "keeps HTTP for the rest of the session" (reviewer 1's non-blocking): fixed too.
    • The doc now says "until restart or a session move". This matches the source comment in model-transport.ts at v2.4.1: "pins the Session to HTTP until restart or move". I checked this against the file in round 1.

Non-blocking

  • None new. My round-1 non-blocking notes stand and need no change: the "2.4.1" version reads fine; the client-coverage half of issue #1388 point 1 is PR #1400, so merge the two together or #1400 first.

What I checked

  • Last review: round 1, 5a3cb6e, 2026-11-25T11:36:21Z.
  • New commits read: 1 (1b2bedf, "docs(inband): fix the Codex path and the OpenCode fallback wording"). The diff changes 2 lines in inband/doc.go and nothing else.
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files). No output was cut.
  • New items since my last review: commit 1b2bedf (read the full diff and the final inband/doc.go), and the author's comment at 2026-11-25T11:37:52Z (read; it states both fixes, and both check out).
  • Older items read now for completeness: reviewer 1's round-1 review (posted 11:32:41Z, before my round 1). Its finding 1 is the same citation error as mine; I verified the fix myself rather than taking the author's word.
  • The fix commit touches comments only. No behavior change, no data-dependence change, no new binaries. doc.go stays the only package comment in inband.

@amiddavid
amiddavid merged commit 94625c5 into main Nov 25, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 25, 2026
amiddavid added a commit that referenced this pull request Nov 25, 2026
…eze) (#1405)

docs(release): tell the PR owner after every merge

Add a bullet to RELEASING.md section 3: after every merge, send the PR
owner one message in the same step. Owner decision (David Amid,
2026-11-25): "put the rule into the realsing.md file so other
integrators on other machines would know it".

Refs #1394, #1388

docs(release): add Refs-only and full-freeze merge rules

Add two bullets to RELEASING.md section 3, by owner decision ("add both"):
write issue numbers in a PR body as "Refs #N" only, and freeze every
merge for a PR stuck in a merge-of-main loop.

Refs #1303, #1370, #1331

Docs only. The owner approved the text and the merge with no review round, in
the integrator session, 2026-11-25: "1405 merge".

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant