Repository navigation
fix(console): reject oversized composed chat requests before send - #1313
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Threat model review — advisoryReviewed head Review not completed for this head. Previous findings are superseded, not confirmed resolved. Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging. Coverage: 0/0 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned. Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens. Saved findings and earlier report · Historical findings are not confirmed resolved. |
…r/tests Upstream reorganized the coordinator (#1324): sender encryption is now owned by coordinator/api/inference and every Go test lives under coordinator/tests. - Move TestSealedRequest_BodyBudget to coordinator/tests/api/inference/sender_encryption_budget_test.go and build it on inference.Owner.SealedTransport. Both subtests and the exact-cap arithmetic are unchanged. - The test used to read the private sealed-request context marker inside the downstream handler. An external test cannot reach that marker, so the sealed path is now observed through the X-Eigen-Sealed response header, which only that path sets. The marker itself is no longer asserted here. - Keep both sides of the documentation tables and both changelog entries; cited coordinator paths follow the new layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gajesh2007
left a comment
There was a problem hiding this comment.
Reviewed head 4c44fd0, including UTF-8 accounting, NaCl/base64 overhead, actual envelope validation, and send/retry state preservation. No blocking correctness or security findings. Expanded UI selection passed 71 tests, including all 23 new tests; TestSealedRequest_BodyBudget passed locally under -race. Current applicable CI and integration checks pass; E2E benchmarks remain awaiting environment approval. Local tests do not establish deployed image inference acceptance.
Summary
Reject oversized composed chat requests locally before sending them. The existing four-image/10 MiB-per-image allowance can exceed the coordinator’s 16 MiB body cap after JSON composition or sender encryption; the guard checks UTF-8 plaintext bytes, a safe sealed-size lower bound, and the actual encrypted envelope. Send and retry keep the user’s message and images and return an actionable size error.
Linked issue
Addresses Layr-Labs/d-inference#343. The original qualification base was
27a165e831e23dd9276f0b279068abe948982902; current integration evidence is recorded below.Before
After
Current target and integration status
Integrated current master
c5552d3af7(after #1324, #1338 and #1340) with signed merge commits5999ad7eand4c44fd00; the resolved source tree isee530f47. The consumed SDK is1ee8675a035d0d842d5df663938d66cfedf88a8e, from master.What the reorganization changed for this pull request:
coordinator/api/sender_encryption_budget_test.go(packageapi, private server state)coordinator/tests/api/inference/sender_encryption_budget_test.go(packageinference_test), built oninference.Owner.SealedTransport.TestSealedRequest_BodyBudget, both subtests and the exact-cap arithmetic are unchangedX-Eigen-Sealedresponse header, which only that path sets. The marker itself is no longer asserted by this testcoordinator/api/sender_encryption.goThe console code is exactly as before; master changed none of those files.
Refactor pass. A dedicated refactor subagent reviewed the ported change against the structure and clean-code rules in
AGENTS.md. Outcome: no change needed. Two things it recorded and left: no test now pins the sealed-request marker itself (master had none either; closing that needs a new end-to-end test with a remote image URL, which is new coverage), anddocs/architecture/components/console-ui.mddoes not yet describe the preflight.Validation on the merged head (Go 1.25.0):
gofmtclean,go build ./coordinator/...,go vet ./coordinator/..., layout guardTestCoordinatorTestsAreIsolated.TestSealedRequest_BodyBudget:exact_capandone_byte_overpass; the wholecoordinator/tests/api/inferencepackage passes, also under-race.python3 scripts/run-coordinator-tests.py --jobs 1 ./coordinator/...: 8,131 passed, 0 failed, 5 skipped. The same five tests skip on master (environment-gated performance and fixture suites).make docs-check(330 files) andmake docs-impact-check BASE=origin/master.Previous integration (2026-10-02)
Integrated current master
c56b98e8638f1895b80e22c00122880bed9b11b9with a signed merge commitd59b2f823894cb5e0f3c15bf405e48f7765f5ec4; the resolved source tree is85511539a7c08db8c4985e2da70645e99a209268. The merge preserves the focused fix and incoming master behavior. The consumed SDK is1ee8675a035d0d842d5df663938d66cfedf88a8e.Fresh local validation: 834 UI invocations passed; the overlapping focused selection passed 70. Restoring current-master transport code produced four expected assertion failures and two passing controls. Typecheck, ESLint (zero errors), default production build, docs lint and docs impact passed. All nine executable coordinator boundary cases passed under pinned Go 1.25.0; the initial compile-only disk-limit stop is retained.
Ready for maintainer review of the documented scoped fix and test evidence. Main CI and Integration Tests passed on this head; benchmark approval and the qualification limits below remain open. Local component results do not establish production deployment or full native qualification.
Earlier qualification
The original candidate
e8e164c7c499883eabc46774d7d364eb8913b952was qualified against base27a165e831e23dd9276f0b279068abe948982902. Those results remain historical; the current-base results and outstanding gates are stated above.Components touched
Protocol / interface changes
Documentation impact
Notes for reviewers
Node 24.15.0 was available locally; the repository’s Node 22 environment remains a hosted-CI gate. The browser fixture evidence from the original composition is historical. Live Privy, deployed Next/coordinator/provider behavior and real model inference remain unverified. The unchanged Before/After figures were visually checked in their actual GitHub rendering. Original failing controls, resource stops, passing reruns and independent reviews remain preserved; none imply an absolute no-regression guarantee.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.