Skip to content

fix(core): normalise the plugin session.list limit before the store (#951) - #954

Merged
dezren39 merged 1 commit into
mainfrom
queue/3828-951-plugin-session-list-limit
Oct 30, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/3828-951-plugin-session-list-limit

Conversation

@dezren39

@dezren39 dezren39 commented Oct 30, 2026 •

Copy link
Copy Markdown

Closes #951.

Problem

The plugin session.list surface passed a plugin-supplied limit straight to Session.list and the SQLite store, where PositiveInt is never decoded: sessionListInput had const bounded = limit (a no-op). SQLite reads a negative LIMIT as unlimited, so limit: -5 returned every session; a fractional or NaN limit raised a datatype-mismatch defect through Effect.orDie. The HTTP session.list endpoint rejects the same values at its schema.

Change

  • packages/core/src/plugin/session-list.ts: add sessionListLimit, mirroring branchListLimit from 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: sessionListInput normalises limit with it instead of passing it through.
  • packages/core/test/plugin/session-list.test.ts: pins limit: -5 (one session, not every session), limit: 0 (positive minimum), limit: 2.5 (floored page, no defect) and limit: NaN (default page).

Positive integer limits, the HTTP session.list handler and the plugin vcs.branch.list surface are unchanged.

Tests

  • bun test test/plugin/session-list.test.ts (packages/core) — 3 pass
  • bun run typecheck (packages/core) — pass
  • oxlint on the three changed files — 0 warnings, 0 errors

Overlap

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.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…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.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 702f3d59-957a-49cc-8714-60a11eb2c7cc
Commits

Reviewing files that changed from the base of the PR and between 01cf577 and 3f19738.

Files selected for processing: 3
  • packages/core/src/plugin/host.ts
  • packages/core/src/plugin/session-list.ts
  • packages/core/test/plugin/session-list.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T05:45:04.852057Z 3f19738 PR opened
ℹ️ 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.

@dezren39

Copy link
Copy Markdown
Author

agent-note:v1 — parked (queue task 3828, worker repo-worker-opencode, lane openchamber-scheduled-lane)

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

@dezren39
dezren39 merged commit 2990c37 into main Oct 30, 2026
11 of 13 checks passed
dezren39 added a commit that referenced this pull request Nov 1, 2026
…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.
dezren39 added a commit that referenced this pull request Nov 1, 2026
…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.
@dezren39
dezren39 deleted the queue/3828-951-plugin-session-list-limit branch November 1, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(core): plugin session.list limit from PR #766 is never normalised — negative returns every session, fractional/NaN defects the store query

1 participant