Repository navigation
fix(core): normalise the plugin session.list limit before the store (#951) - #954
Conversation
…951) A plugin supplied limit reached Session.list untouched, so a negative value became SQLite's unlimited read (every session) and a fractional or NaN value defected the store query through Effect.orDie. Mirror branchListLimit from PR #946: missing or non-finite becomes the default page of 50, and zero, negative or fractional values clamp to a positive integer. Positive integers pass through unchanged, and the HTTP session.list surface is untouched.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
agent-note:v1 — parked (queue task 3828, worker
|
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
…st for #935 Production fix already delivered on main by #954 (sessionListLimit in packages/core/src/plugin/session-list.ts, host.ts routes through it). This rebases PR #940 down to only its live regression test: 55 child sessions, default page of 50, cursor reaches the remaining 5, explicit limits honoured.
…st for #935 (#940) Production fix already delivered on main by #954 (sessionListLimit in packages/core/src/plugin/session-list.ts, host.ts routes through it). This rebases PR #940 down to only its live regression test: 55 child sessions, default page of 50, cursor reaches the remaining 5, explicit limits honoured.
Closes #951.
Problem
The plugin
session.listsurface passed a plugin-suppliedlimitstraight toSession.listand the SQLite store, wherePositiveIntis never decoded:sessionListInputhadconst bounded = limit(a no-op). SQLite reads a negativeLIMITas unlimited, solimit: -5returned every session; a fractional orNaNlimit raised a datatype-mismatch defect throughEffect.orDie. The HTTPsession.listendpoint rejects the same values at its schema.Change
packages/core/src/plugin/session-list.ts: addsessionListLimit, mirroringbranchListLimitfrom fix(core): bound and normalise the plugin vcs.branch.list limit #946 — missing or non-finite → default page of 50; zero, negative or fractional → clamped/floored to a positive integer. No upper bound, because the HTTP surface applies none and a positive integer must pass through unchanged.packages/core/src/plugin/host.ts:sessionListInputnormaliseslimitwith it instead of passing it through.packages/core/test/plugin/session-list.test.ts: pinslimit: -5(one session, not every session),limit: 0(positive minimum),limit: 2.5(floored page, no defect) andlimit: NaN(default page).Positive integer limits, the HTTP
session.listhandler and the pluginvcs.branch.listsurface are unchanged.Tests
bun test test/plugin/session-list.test.ts(packages/core) — 3 passbun run typecheck(packages/core) — passoxlinton the three changed files — 0 warnings, 0 errorsOverlap
PR #940 (#935) adds the missing-limit default on the same line (
limit ?? 50). This change subsumes it (sessionListLimit(limit)keeps that default); whichever lands second rebases to a one-line resolution.Need help on this PR? Tag
@codesmith-botwith what you need.