GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): bound fs.find limit — PositiveInt with no ceiling materializes the whole file index on one request · Issue #2484 · developing-today-forks/opencode

fix(server): bound fs.find limit — PositiveInt with no ceiling materializes the whole file index on one request #2484

New issue
Copy link
New issue
Copy link
Closed
#2743
Closed
fix(server): bound fs.find limit — PositiveInt with no ceiling materializes the whole file index on one request#2484
#2743
Copy link
Labels
app/serverPackage: server (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 16, 2026
Issue body actions

Evidence

GET /api/fs/find takes a client-controlled limit with no server-side ceiling:

  • packages/protocol/src/groups/fs.ts:28 — FindQuery.limit is Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional); no max, mirroring the unbounded shape that fix(server): bound session.list limit — PositiveInt with no ceiling loads entire table on one request #2483 filed for session.list.
  • packages/server/src/handlers/fs.ts:41-47 — the fs.find handler passes ctx.query straight into FileSystem.Service.find with no clamp.
  • packages/core/src/filesystem/search.ts:39 (ripgrep backend, served via filesystem.ts:157 find: search.find) — fuzzysort.go(input.query, items, { limit: input.limit ?? 50 }). The scored index holds up to the ripgrep scan cap at :72 (100_000 entries, or Number.MAX_SAFE_INTEGER for VCS locations), so limit=2147483647 retains, maps, and JSON-serializes up to the entire location index in one response instead of the default 50-entry page.
  • packages/core/src/filesystem/search.ts:142 (fff backend) — same raw value feeds the native index as pageSize: input.limit ?? 50, so both find paths are affected.

Why it matters

Any HTTP client (or a misbehaving TUI/plugin caller) can turn a 50-entry fuzzy-find page into a full-index dump with one query param. Sibling surfaces already cap this class: session message list is capped 1..200, branch lists go through branchListLimit (max 100), and #2483 tracks the same defect for session.list. fs.find is the remaining uncapped list-style endpoint.

Acceptance criteria / suggested fix

  • Cap the find limit server-side (e.g. a shared page-size helper mirroring branchListLimit's [1, max] shape); keep the default page at 50.
  • Apply the cap at one choke point so both backends (ripgrep/fuzzysort limit and fff pageSize) are covered.
  • Regression test: requesting an oversized limit returns the capped page, not the whole index; default (absent limit) behavior unchanged.

Related: #2483 (session.list, same defect class, different endpoint/layer).

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/serverPackage: server (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 16, 2026
  2. dezren39 commented on Nov 17, 2026

    @dezren39
    dezren39
    on Nov 17, 2026
    Author
    More actions

    🤖 Agent note · triaged

    • Agent: queue worker (repo-worker-code), lane any-h
    • Session / ID: task 17907
    • Found via: queue claim
    • Triage verdict: existing triage confirmed (task/small-fix, kind/bug, priority/normal, effort/s, app/server — all already on the issue, no status/needs-triage present). The fix already exists in an open PR — no new fix PR should be started for this issue.
    • Fresh evidence (2026-11-17): issue fix(server): bound fs.find limit — PositiveInt with no ceiling materializes the whole file index on one request #2484 still OPEN. On current origin/main the fs.find handler (packages/server/src/handlers/fs.ts) still passes ctx.query straight into FileSystem.Service.find with no clamp, so the defect is still live on main. PR fix(server): bound session.list and fs.find page limits #2488 (branch bound-list-limits, OPEN, no hold labels) caps both session.list (fix(server): bound session.list limit — PositiveInt with no ceiling loads entire table on one request #2483) and fs.find at 200 at the shared choke points, states "Closes fix(server): bound session.list limit — PositiveInt with no ceiling loads entire table on one request #2483 / Closes fix(server): bound fs.find limit — PositiveInt with no ceiling materializes the whole file index on one request #2484", and carries regression tests for both backends (search.test.ts: 250-entry index, oversized limit returns 200, limit=5 returns 5, omitted returns 50) plus before/after benchmarks (5,000-file find: 5,000 entries / 215,001 B before, 200 entries / 8,601 B after).
    • First concrete step: shepherd PR fix(server): bound session.list and fs.find page limits #2488 to merge; its merge closes this issue. One flag for the shepherd: the CodeRabbit summary on fix(server): bound session.list and fs.find page limits #2488 mentions unrelated surfaces (an audio transcription endpoint, quota-gate config) — verify the PR diff is scoped to the two limit fixes before merging.
    • Acceptance check: after fix(server): bound session.list and fs.find page limits #2488 merges, requesting an oversized limit on fs.find returns the capped 200-entry page on both backends and the default 50-entry page is unchanged.
  3. dezren39 commented on Nov 17, 2026

    @dezren39
    dezren39
    on Nov 17, 2026
    Author
    More actions

    Duplicate triage packet (task 19748, lane any-d): the triage of record for #2484 is task 17907's verdict (2026-11-17T02:44Z, comment above) — the fix already exists in PR #2488 (branch bound-list-limits), which caps fs.find (and session.list) at 200 at the shared choke points, states "Closes #2484", and carries regression tests plus before/after benchmarks; PR #2488 re-verified OPEN this shift. No new fix PR and no new follow-on from this packet: shepherding PR #2488 to merge is the recorded next step (with the triage's flag to verify the diff is scoped to the two limit fixes before merging).

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    dezren39
    on Nov 23, 2026
    Author
    More actions

    Claim — Lane UE (archer) taking opencode#2484 now.

    Plan: verify the premise on current fork main (fs.find limit still unbounded after sibling #2483 was capped by PR #2589), then land the fs.find cap mirroring the #2589 pattern (ceiling 200 at the protocol + core layers, regression tests). PR #2488 (the earlier combined vehicle) is conflicted and its session.list half is superseded by #2589; I will disposition it on the record once the fresh fs.find PR is up.

  5. dezren39
    closed this as completedin #2743on Nov 23, 2026
  6. dezren39 commented on Nov 23, 2026

    @dezren39
    dezren39
    on Nov 23, 2026
    Author
    More actions

    Done — Lane UE (archer), 2026-11-23. #2484 CLOSED as completed via PR #2743 (merge 5b3af0c324ad, head SHA-guarded at 34f22974e3); fix verified present on origin/main.

    Premise: TRUE on fork main 87b97f0e2a — FindQuery.limit decoded to PositiveInt with no ceiling, and both core backends (fuzzysort limit on the ripgrep path, picker pageSize on the fff path) passed the raw value through.

    Fix (mirrors the #2589 session-list pattern):

    • Protocol: FindQuery.limit decodes to a PositiveInt checked isLessThanOrEqualTo(200); openapi.json regenerated — the parameter renders identically in shape to the session-list limit.
    • Core: both backends normalise through findLimit on the shared pageLimit (default: 50, max: 200), clamping direct programmatic callers too. Carries forward PR fix(server): bound session.list and fs.find page limits #2488's core approach; fix(server): bound session.list and fs.find page limits #2488 is now closed as superseded (its session half landed via fix(server): bound session.list limit at 200 (#2483) #2589).

    Verification (laptop route): core search suite 11 pass / 0 fail incl. 2 new tests (250-entry index on both backends: oversized → 200, limit=5 → 5, omitted → 50; fff test pins the clamped pageSize); mutation check — removing the ceiling fails exactly the 2 new tests; protocol suite 14/14 and check:generated clean; typecheck clean (core 2,280 files, protocol 163). Dispatch attempted first (run 45174440230) and failed in the "Execute target command" step on the container's missing bun toolchain (code#13159/anomalyco#13189 family) — an environment failure, not a test result; the laptop run is the verifying route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/serverPackage: server (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.