Repository navigation
Closed
Labels
app/atlas-searchpkgs/atlas-search (Atlas search service + atlas-embed)pkgs/atlas-search (Atlas search service + atlas-embed)kind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)source/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsQueue packet kind: bounded fix with reproduction and targeted tests
Description
atlas-search: CLI get-chunk --neighbors has no upper bound — standalone returns the whole message, bypassing the service's 100-neighbor cap
Summary
The service caps get-chunk neighbor context at 100, but the standalone CLI path for the same command enforces no maximum at all:
- The service's get-chunk handler rejects
neighbors > 100:pkgs/atlas-search/crates/atlas-search/src/server.rs:2078-2079—if neighbors > 100 { return Err(bad_request("neighbors must be at most 100")) }. - The CLI's
count()validation — documented as validating "against the service's request contract" (pkgs/atlas-search/crates/atlas-search/src/main.rs:583-591) — validates--neighborsonly as non-negative, no maximum:main.rs:664callscount("--neighbors", args.neighbors, 0, None). - The standalone path then calls
run_get_chunk(backend, chunk_id, neighbors)(main.rs:669), which feedsneighbor_mapinpkgs/atlas-search/crates/atlas-core/src/search.rs:283-284, 401-402— the samechunk_idx ± nrange machinery, with no cap.
So the identical request is a bad_request error via the service and an unbounded whole-message dump via the standalone CLI. This is the sibling of #5593 (--expand on the search surfaces, same missing bound, different flag/command/server check); #5593 does not cover the CLI get-chunk path.
Verified this run (2026-11-04, laptop probe)
Probe DB ~/git/fleet/probe-atlas-neighbors/probe.db (same fixture schema as the #5593 probe: one message with 300 chunks, chunk 151 mid-message), the atlas-search binary built from laptop main 8a8d509f8, local backend:
get-chunk 151 --neighbors 2→ context: 2 before + 2 after (control, as expected).get-chunk 151 --neighbors 100→ 100 before + 100 after (the service cap, honored only by coincidence of the request).get-chunk 151 --neighbors 250→ 150 before + 149 after = 299 context chunks, exit 0 — the whole message, nearly 3× the total the service allows for this exact command.
Why it matters
- Neighbor context is the response-size multiplier the 100 cap exists to bound; the standalone CLI — the fallback path used exactly when no service is running — defeats it completely.
- This is the CLI↔service contract family of atlas-search(CLI): --k/--pool 0 and negative (=form) counts silently clamp to 0 — standalone returns empty success where the service rejects the same request #5407 (closed) and atlas-search: expand has no upper bound — one hit returns its whole message, bypassing the 100-neighbor cap get-chunk enforces #5593 (open): a count the service rejects must not silently pass on the CLI surface. atlas-search(CLI): --k/--pool 0 and negative (=form) counts silently clamp to 0 — standalone returns empty success where the service rejects the same request #5407 fixed the 0/negative clamps; atlas-search: expand has no upper bound — one hit returns its whole message, bypassing the 100-neighbor cap get-chunk enforces #5593 covers
--expand;--neighborson get-chunk is the remaining uncapped count.
Acceptance criteria
- The CLI's
count()validation for--neighborsenforces the same maximum the service enforces (100), exit 2 with a message naming the bound, before any backend work — mirroring the--poolmax handling. - A pinning test covers
--neighborsat the bound (accepted) and above it (rejected), alongside the existingcount_validation_mirrors_the_service_contracttest inmain.rs. - If the fix for atlas-search: expand has no upper bound — one hit returns its whole message, bypassing the 100-neighbor cap get-chunk enforces #5593 introduces a shared neighbor-bound constant, this cap uses it too (one source of truth for the neighbor bound across
expand, get-chunk service, and get-chunk CLI).
Evidence
pkgs/atlas-search/crates/atlas-search/src/server.rs:2078-2079(service get-chunk neighbors cap 100)pkgs/atlas-search/crates/atlas-search/src/main.rs:583-599(count() contract comment),:664(--neighborsmin 0, no max),:669(standalone run_get_chunk call)pkgs/atlas-search/crates/atlas-core/src/search.rs:262, 283-284, 401-402(run_get_chunk → neighbor_map,n as i64)- Probe:
~/git/fleet/probe-atlas-neighbors/(probe.db, out-n2.json / out-n100.json / out-n250.json) on the laptop, 2026-11-04, binary built from8a8d509f8 - Related: atlas-search: expand has no upper bound — one hit returns its whole message, bypassing the 100-neighbor cap get-chunk enforces #5593 (
--expandunbounded — sibling, open), atlas-search(CLI): --k/--pool 0 and negative (=form) counts silently clamp to 0 — standalone returns empty success where the service rejects the same request #5407 (CLI count clamps, closed)
Metadata
Metadata
Assignees
Labels
app/atlas-searchpkgs/atlas-search (Atlas search service + atlas-embed)pkgs/atlas-search (Atlas search service + atlas-embed)kind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)source/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsQueue packet kind: bounded fix with reproduction and targeted tests
Activity
developing-today commentedon Nov 4, 2026
CODE-1385
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed
get-chunk --neighborsis unbounded standalone while the service caps the same parameter at 100; verified with a laptop probe (--neighbors 250→ 299 context chunks, exit 0). Sibling of issue atlas-search: expand has no upper bound — one hit returns its whole message, bypassing the 100-neighbor cap get-chunk enforces #5593 (--expand), which does not cover the get-chunk CLI path.count()maximum for--neighborsmirroring the service cap, with a pinning test; done when the acceptance criteria on issue atlas-search: CLI get-chunk --neighbors has no upper bound — standalone returns the whole message, bypassing the service's 100-neighbor cap #5600 hold.~/git/fleet/probe-atlas-neighbors/(laptop); body evidence in the issue.dezren39 commentedon Nov 4, 2026
🤖 Agent note · handed off
opencodeper §1b — handed off to the opencode claimant, not worked directly. Revalidated fresh: issue atlas-search: CLI get-chunk --neighbors has no upper bound — standalone returns the whole message, bypassing the service's 100-neighbor cap #5600 OPEN, no hard-stop labels; claim labels synced (queue/queued + status/needs-triage removed; queue/claimed + status/in-progress + work/assigned added).85 remaining items
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up
queue/9688-5600-atlas-search-neighbors-capand worktree/home/user/git/fleet/9688; it also names active related work on atlas-search: expand has no upper bound — one hit returns its whole message, bypassing the 100-neighbor cap get-chunk enforces #5593/task 9679.dezren39 commentedon Nov 5, 2026
🤖 Agent note · done — PR opened
--neighborsmaximum of 100 before backend access and pinned boundary/error behavior. Queue task 9688 completed with outcomepr_opened.cargo test -p atlas-search --bin atlas-search— 26 passed;cargo fmt --all -- --check— pass;git diff --check— pass. CodeRabbit is still in progress; no CI wait/merge is claimed.queue/claimed,status/in-progress, andwork/assignedlabels; retained the review label.