Skip to content

fix(vision): bound Anthropic sidecar SSE and error reads - #3874

Merged
lidge-jun merged 6 commits into
devfrom
codex/260907-c2-anthropic-vision
Sep 7, 2026
Merged

fix(vision): bound Anthropic sidecar SSE and error reads#3874
lidge-jun merged 6 commits into
devfrom
codex/260907-c2-anthropic-vision

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

Carry #3841 with the matching 64 KiB accepted-byte bound for Anthropic vision SSE and HTTP error bodies. Pin partial-description preservation and incomplete-tail rejection at the cap, including non-settling cancellation. Safe public error projection and downstream description clamps remain intact.

Verification

  • Cross-platform CI: all required per-chain jobs SUCCESS, exact top head f1b8f2d2f1edee55b68202469f86a5334710688d: Linux 4, macOS 2, gates, storage, API, all keyring/npm smokes and Docker. Overall run status is completed / success; this is not an assertion that every workflow job passed.
  • Explicit user policy defers the six Windows test shards and macos control to one run on the final release-train head. They are excluded only from this per-chain LANDABLE decision. Windows keyring/npm smoke jobs remain required. Lower product CI is represented by the cumulative top-head result.
  • Attempt 1 macOS 1/2 timed out before a test result in codex-inject-write-lock.test.ts. Main explicitly authorized retrying the failed job at the unchanged head. The required-job evidence above uses each job's latest attempt; earlier failure is retained in run history. Independent Astra diagnosis found no proven C-cache interaction, and the same-head macOS control passed that file.
  • Local tests/typecheck/build/install: NOT RUN, explicitly prohibited for this train. Runtime verification is remote CI only.
  • git diff --check: passed.
  • Darwin, independent Astra high explorer: PASS for source/security review at the pinned layer head (partial-description cap semantics, cancellation and safe errors).

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Manual dependent PR chain

Native stack: null. Review only this layer’s diff. Main integrates bottom-up after refreshing dev ancestry, live heads/bases, review threads and required gates. This task does not merge. The CI-tested cumulative top tree is the integration target; advancing dev requires another cascade and top-head verification.

Layer Source PR Head
1 #3839 #3873 51b44371860b2ec933d66de1b68ca790be3b81fb
2 #3841 #3874 8eaa5641902b84bec6c97a94de6c2fe6d810c31d
3 #3863 #3875 91b54b79bc780011031b00354621cc9fcaef360e
4 #3860 #3876 abbdb227f385443228656c8440282187cb5dec75
5 #3252 #3878 f1b8f2d2f1edee55b68202469f86a5334710688d

Maintainer integration decision (MAINTAINERS.md, dev-only admin integration): @lidge-jun integrates lane C's manual chain (#3873#3874#3875#3876#3878) into dev bottom-up. Chain-top evidence at head f1b8f2d2f: Cross-platform CI run 34116228181, aggregate ci = success (attempt 2: macos 1/2 timed out at 20 min in attempt 1 after codex-inject-write-lock.test.ts with no output; independent diagnosis found no causal link to this chain and the same head's macos control passed those tests; the failed job alone was rerun and passed — no code change). Windows 6/6 and macos control also green on this head. Prospective merge tree of origin/dev@522ce5f8c + top = e0b0e5886 = tested tree. Independent source/security/GUI reviews PASS per PR bodies; screenshots from this run's dashboard-preview artifact. Local suites NOT RUN. Maintainer integration, not self-approval.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 75043842-02d5-4ab0-b9a7-1190f083e3b8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 7, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 69 / 80

이 PR은 #3841을 Lane C 2층(base=codex/260907-c1-anthropic-search)으로 올린 캐리입니다. Anthropic vision 사이드카 SSE·error body에 web-search와 같은 64 KiB 상한을 겁니다. 부분 description은 남기고, 상한 tail은 버리며, cancel이 settle되지 않아도 hang하지 않습니다. 공개 에러 문자열 계약은 그대로입니다.

지금 devsrc/vision/anthropic-describe.ts도 web-search Anthropic 경로와 같이 SSE buffer가 separator 없이 커질 수 있고, 실패 분기는 res.text()를 씁니다. 이 캐리는 로컬 MAX_SIDECAR_RESPONSE_BYTES = 64 * 1024readBoundedText를 두고, parseAnthropicVisionSSE 루프에 responseBytes를 넣습니다. web-search(#3873)처럼 parse.ts를 import하지 않은 것은 vision↔web-search 계층을 섞지 않으려는 선택으로 보이며, 숫자만 같으면 계약은 충분합니다.

테스트는 partial-description 보존·discarded tail·non-settling cancel을 잠급니다. astra-high PASS. types/config 분할과 무관하고, #3873 위에만 올리면 됩니다. Lane C top CI는 8f8ac0d에서 공유합니다.

anthropic-describe.ts parseAnthropicVisionSSE - 64KiB bound, 완성 프레임 유지·tail discard
anthropic-describe.ts readBoundedText - untrusted error body 상한(401 메시지용)
vision-anthropic.test.ts - partial/oversized/cancel 회귀
상수 중복 vs web-search/parse.ts import - 계층 분리상 로컬 복제가 더 안전. 숫자만 동기화하면 됨

메인테이너의 판단이 필요한 지점

너의 추천
#3873 다음에 머지하세요. web-search와 대칭인 vision 바운드이고 테스트·보안 리뷰가 맞춰져 있습니다. 머지 후 #3841은 landed-via로 닫으세요.

이 댓글은 grok-bot이 작성했습니다

@lidge-jun
lidge-jun force-pushed the codex/260907-c1-anthropic-search branch from c07456e to 47803f1 Compare September 7, 2026 10:14
@lidge-jun
lidge-jun force-pushed the codex/260907-c2-anthropic-vision branch from 788ed57 to 71ec4c7 Compare September 7, 2026 10:14
t and others added 6 commits September 7, 2026 20:21
…ip ci]

`parseAnthropicSidecarSSE` folded frames only when it found a `\n\n`
separator, and appended every decoded chunk to `buffer` until then. An
upstream that streams without ever emitting a separator therefore grew the
buffer for the whole response. The non-OK branch had the same shape: it read
the untrusted error body with an unbounded `res.text()` just to build one
auth-failure message.

Reuse the existing `MAX_SIDECAR_RESPONSE_BYTES` cap and the reader-cancel
helper that `parseSidecarSSE` already applies in the same folder, so both
paths stop reading at the same 64 KiB bound. Frames folded before the cap are
kept; only the unterminated tail is dropped. `cancelReaderWithoutWaiting` is
exported for this, unchanged.

The regression drives a stream that never terminates a frame and asserts the
read is cancelled well before the producer finishes. It fails without the cap
and passes with it.

(cherry picked from commit c25bdab)

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
…ion [skip ci]

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
…[skip ci]

(cherry picked from commit 55b009b)

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
…cel [skip ci]

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
@lidge-jun
lidge-jun force-pushed the codex/260907-c1-anthropic-search branch from 47803f1 to 51b4437 Compare September 7, 2026 11:21
@lidge-jun
lidge-jun force-pushed the codex/260907-c2-anthropic-vision branch from 71ec4c7 to 8eaa564 Compare September 7, 2026 11:21
@lidge-jun
lidge-jun marked this pull request as ready for review September 7, 2026 11:53
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 7, 2026 11:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 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 ⚠️ Failed 2026-09-07T11:54:06.697887Z 8eaa564 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.

@lidge-jun
lidge-jun changed the base branch from codex/260907-c1-anthropic-search to dev September 7, 2026 11:53
@lidge-jun
lidge-jun merged commit 3f07e09 into dev Sep 7, 2026
15 of 17 checks passed
@lidge-jun
lidge-jun deleted the codex/260907-c2-anthropic-vision branch September 7, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants