Skip to content

fix(cli): allow 32 MiB canonical knowledge index requests - #5679

Open
kwakayama wants to merge 1 commit into
mainfrom
fix/m125-4947-index-32mib
Open

kwakayama wants to merge 1 commit into
mainfrom
fix/m125-4947-index-32mib

Conversation

@kwakayama

Copy link
Copy Markdown
Contributor

The CLI now accepts one canonical index request up to 32 MiB, the same limit as the API, so book-length PDFs index as one document.

  • MAX_INDEX_BYTES rises from 10 MiB to 32 MiB. The error text is built from the constant.
  • The 500-chunk cap stays unchanged.
  • New tests: a 200-chunk index above 10 MiB commits once; an index above 32 MiB under the chunk cap is rejected with no commit.
  • The ingestion guide states the new limit.

Refs veryfront/veryfront-issue-inbox#4947

The CLI capped one atomic index request at 10 MiB while the API accepts
32 MiB. With 3,072-dim embeddings this rejected books near 160 chunks,
well below the 500-chunk cap. Match the API limit.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T17:20:20.344394Z 8923d4a Manual request
ℹ️ 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.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

📦 Client bundle boundary

Entrypoint Modules Source size Server leaks
src/index.client.ts 66 371 KiB ✅ 0
src/react/components/Head.tsx 5 74 KiB ✅ 0
src/react/router/index.tsx 5 74 KiB ✅ 0
src/react/context/index.tsx 5 74 KiB ✅ 0
src/react/fonts/index.ts 6 81 KiB ✅ 0
src/react/components/ui/index.ts 111 720 KiB ✅ 0
src/react/components/ui/adapter/contract.ts 1 18 KiB ✅ 0
src/react/components/ui/icons/index.ts 3 17 KiB ✅ 0
src/chat/index.ts 305 2055 KiB ✅ 0
src/chat/ag-ui.ts 61 464 KiB ✅ 0
src/chat/protocol.ts 1 11 KiB ✅ 0
src/chat/types.ts 46 248 KiB ✅ 0
src/chat/message-prep.ts 68 519 KiB ✅ 0
src/markdown/index.ts 6 30 KiB ✅ 0
src/mdx/index.ts 2 2 KiB ✅ 0
src/agent/identity-contracts.ts 1 3 KiB ✅ 0
src/schemas/index.ts 43 222 KiB ✅ 0
src/platform/env.ts 5 55 KiB ✅ 0
src/workflow/claude-code/react/index.ts 9 91 KiB ✅ 0
src/events/index.ts 37 631 KiB ✅ 0
src/events/ag-ui/public.ts 36 624 KiB ✅ 0
src/run-events/index.ts 54 323 KiB ✅ 0

A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in scripts/lint/client-bundle-baseline.json to burn down.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

@codex review

Copy link
Copy Markdown
Contributor Author

Review score: 84/100

Summary: Small, focused limit increase with good boundary tests. The main risk is rollout order with the API, which this repo cannot verify.

  • Strength: tight diff and single source of truth. MAX_INDEX_BYTES drives the error text now, so the message and the check cannot drift. The 500-chunk cap stays unchanged, and the docs are updated together with the code.
  • Strength: tests cover both sides of the new limit. One test commits a 200-chunk payload over 10 MiB once and asserts the request path, chunk count and receipt. The other test proves an over-32-MiB payload under the chunk cap is rejected with zero commits. Using a fixed-width float vector (wideEmbedder) keeps the byte size deterministic.
  • Concern: dependency on the API deploy. The comment says the constant mirrors the API's MAX_CANONICAL_INDEX_BYTES, but nothing in this repo enforces that. If this CLI release ships before the API accepts 32 MiB, requests from 10 to 32 MiB get a raw 413 or body-limit failure instead of today's clear "split the source" error. Confirm that the API change is already deployed, or link the API PR in the description.
  • Nit: docs estimate. "About 450 pages of prose" comes from the 500-chunk cap (about 1,800 chars per chunk), not from the byte limit. At 3072 dims, the chunk cap applies first. At 4096 dims, the byte limit applies first, at roughly 390 chunks. A short note that the effective ceiling depends on embedding dimension would be more accurate.
  • Nit: memory at the new ceiling. The payload is serialized once for the size check and again in client.post, plus one TextEncoder copy. At 32 MiB that is roughly 100 MB of transient strings and bytes for each document. This is acceptable for a CLI, but you could serialize once and pass the bytes through. This is optional and the double serialization existed before this PR.

I could not run the test file locally because deno is not available in the review container, so CI is the source of truth for the new tests.


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 8923d4a38c

ℹ️ 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".

@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
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