Skip to content

test(host-service): exercise session scan limits with small directories - #9665

Open
PresentJay wants to merge 1 commit into
ParadevAI:mainfrom
PresentJay:test/session-search-caps
Open

PresentJay wants to merge 1 commit into
ParadevAI:mainfrom
PresentJay:test/session-search-caps

Conversation

@PresentJay

@PresentJay PresentJay commented Nov 12, 2026 •

Copy link
Copy Markdown

What & why

Two tests created and removed 7,000 directories to reach the Claude and Codex session search limits. Pass a small limit through each store for the tests and exercise the incomplete-search result on real directories. Normal callers still use 5,000 and 2,000 respectively.

How I tested it

  • On this branch, macOS arm64 with Bun 1.4.3 and TERM=dumb: from packages/host-service, bun test src/terminal-agents/harness-sessions/claude.test.ts src/terminal-agents/harness-sessions/codex.test.ts — 17 pass, 0 fail.
  • This patch was also part of the combined macOS verification for fix(desktop): let IME users confirm text without submitting a chat answer #9625: all 30 repository test tasks passed in one uncached run, with default workers and timeouts. Repo-wide lint and typecheck passed on that combined checkout.

Checklist

  • Conventional PR title
  • Lint and typecheck passed on the combined verification checkout
  • Allow maintainer edits
  • Signed CLA

Summary by cubic

Makes the session-scan-limit tests pass a small cap through each store so they no longer create thousands of directories to trigger the incomplete-search result.

The Claude and Codex tests now exercise their scan caps with just a few real directories instead of creating 7,000. Production callers keep the existing 5,000 and 2,000 defaults.

Written for commit 68e091a. Summary will update on new commits.

View guided diff

Summary by CodeRabbit

  • Improvements
    • Session checks can now limit how many project directories they scan, helping keep lookups bounded in large directory trees.
    • When a scan reaches its limit, the result distinguishes an incomplete search from a complete search that found no session.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Claude and Codex session searches now accept an optional per-call directory limit. Each search uses that limit to decide whether a miss is complete. Tests exercise capped searches through the session stores.

Changes: Harness session search limits

Layer / File(s) Summary
Pass scan limits through session searches
packages/host-service/src/terminal-agents/harness-sessions/claude.ts, packages/host-service/src/terminal-agents/harness-sessions/claude.test.ts, packages/host-service/src/terminal-agents/harness-sessions/codex.ts, packages/host-service/src/terminal-agents/harness-sessions/codex.test.ts
Claude and Codex search functions use an optional per-call limit instead of relying only on the fixed cap. Their stores forward the limit. Tests call the stores with explicit caps and check incomplete searches.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: kitenite

Merge Risk: Minimal · up to 68e09

This change lets the Claude and Codex session searches take a per-call directory limit and makes their tests lighter. Normal callers keep the existing limits, so the risk of merging is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title uses conventional commit format and names the main change: tests now exercise session scan limits with small directory counts. The changeset adds a per-call directory limit to the Claude and…
Description check Passed The description covers the what and why, and it gives concrete testing steps with results. The title checklist item is ticked, but the description does not link an issue and does not include screensho…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses conventional commit format and names the main change: tests now exercise session scan limits with small directory counts. The changeset adds a per-call directory limit to the Claude and Codex session stores and rewrites the tests to use it, so the title matches the primary change.

Full details: Description check

Explanation

The description covers the what and why, and it gives concrete testing steps with results. The title checklist item is ticked, but the description does not link an issue and does not include screenshots. Screenshots are not needed here because the change is test-only and not user-visible. The description says lint and typecheck passed only on a combined checkout, not on this branch alone, so the reviewer must rely on that claim. The template's sections are all present and filled in.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

Recent review info

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: 7b440778-1706-44a9-b841-6f3abd4243bb
Commits

Reviewing files that changed from the base of the PR and between e9dc091 and 68e091a.

Files selected for processing: 4

  • packages/host-service/src/terminal-agents/harness-sessions/claude.test.ts
  • packages/host-service/src/terminal-agents/harness-sessions/claude.ts
  • packages/host-service/src/terminal-agents/harness-sessions/codex.test.ts
  • packages/host-service/src/terminal-agents/harness-sessions/codex.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

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