Skip to content

test(sessions): the picker search check no longer depends on the temp directory's name - #6958

Merged
Hmbown merged 2 commits into
codewhale-hq:mainfrom
Lstarsky0:test/session-listing-search-fixed-workspace
Oct 14, 2026
Merged

Hmbown merged 2 commits into
codewhale-hq:mainfrom
Lstarsky0:test/session-listing-search-fixed-workspace

Conversation

@Lstarsky0

Copy link
Copy Markdown
Contributor

What and why

session_control_acceptance::tests::tui_and_api_listings_agree fails now and then on my Mac:

assertion `left == right` failed
  left: ["charlie", "bravo", "alpha"]
 right: ["bravo"]

The test saves its sessions with a workspace under TempDir, searches for brav and expects only bravo. The matcher looks at title id workspace and falls back to a subsequence match, so the random .tmpXXXXXX part of the path can supply the missing letters. When it does, every session in that workspace matches.

How often depends on the machine's temp path. On my Mac the per-user part of the path already contains b…r, so the random part only needs a…v: about 1 run in 70 by simulation. Under /tmp it is about 1 in 57,000, which is why CI doesn't show it. With TMPDIR pointing at a directory named brav it fails every time.

search_sort_and_preview_are_one_projection in the same file already avoids this, and its comment says why: it pins all three haystack fields. This test now records /repo and /other as the workspaces, the same way. The session store stays in the private temp directory and the assertions are unchanged.

#5929 put this test's failures down to the redirected CODEWHALE_HOME and gave it a private store. It has still failed since then with the output above, which a session written into the store by another test would not produce.

Issue

Refs #5929

How I tested it

  • With TMPDIR set to a directory named brav, the test fails on main with the output above and passes with this change. With my normal TMPDIR it passes on both.
  • The whole session_control_acceptance module: 24 passed.
  • The 1-in-70 and 1-in-57,000 figures come from a small script that applies the matcher's rule (substring, else subsequence, over the lowercased title id workspace) to .tmp plus six random alphanumeric characters, 400,000 draws per path.
  • cargo fmt --all -- --check, cargo clippy -p codewhale-tui --all-targets --all-features with CI's flags, and cargo check -p codewhale-tui --all-targets: clean. Clippy also on 1.99, plus cargo +1.89.0 check -p codewhale-tui.
  • cargo nextest run -p codewhale-tui --lib: 15247 passed, 46 failed. The same 46 fail on main (2e8bc7b) on my machine. Two of them are the command-count checks that 7be1f48 has since updated; most of the rest need an extension-host Node version I don't have.

No new tests; this changes the fixture of an existing one.

Checklist

  • One focused change, rebased on current main
  • cargo fmt --all passes, and tests cover new or changed behavior
  • If this adds or changes a user-facing feature, I updated its docs and its row in docs/features.toml (cargo test -p codewhale-tui --test feature_registry checks it) — n/a

… directory's name

tui_and_api_listings_agree saved its sessions with a workspace under
TempDir, searched for "brav" and asserted that only `bravo` is listed. The
matcher's haystack is "title id workspace" and it falls back to a
subsequence match, so a random `.tmpXXXXXX` component can supply the
missing letters, and then every session in that workspace matches:

      left: ["charlie", "bravo", "alpha"]
     right: ["bravo"]

How often depends on the machine's temp path. On my Mac the per-user part
of the path already has `b...r`, the random part only needs `a...v`, and
about 1 run in 70 fails (simulated with the matcher's rule over tempfile's
six random characters). Under /tmp it is about 1 in 57,000. With TMPDIR
pointing at a directory named `brav` it fails every time.

search_sort_and_preview_are_one_projection in the same file already avoids
this by fixing all three haystack fields. This test now records "/repo"
and "/other" as the workspaces, as that one does. The store stays in the
private temp directory and the assertions are unchanged.

codewhale-hq#5929 put this test's failures down to the redirected CODEWHALE_HOME and
gave it a private store. It has failed since with the output above, which
a session written into the store by another test would not produce.

Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com>
@Lstarsky0
Lstarsky0 requested a review from Hmbown as a code owner October 11, 2026 14:13

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 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-11T14:16:32.665005Z 82f2d0f 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.

@github-actions github-actions Bot added the contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm label Oct 11, 2026
@Hmbown

Hmbown commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you @Lstarsky0 for tracing the picker’s intermittent search failure to the random temporary-directory name and pinning the complete workspace metadata. Your #6958 merged as its own PR at 73e993a295, with your commit and branch preserved. Exact own-head CI passed: macOS19,035/0failed/33skipped, Ubuntu19,032/0/34, Windows18,301passed(oneleaky)/0/27 and Lint. The listing check and owner recovery passed on all three. This is now on main for the 0.10.2 candidate; the assembled release and final packages still require their gates.

@Hmbown

Hmbown commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

What and why

session_control_acceptance::tests::tui_and_api_listings_agree fails now and then on my Mac:

assertion `left == right` failed
  left: ["charlie", "bravo", "alpha"]
 right: ["bravo"]

The test saves its sessions with a workspace under TempDir, searches for brav and expects only bravo. The matcher looks at title id workspace and falls back to a subsequence match, so the random .tmpXXXXXX part of the path can supply the missing letters. When it does, every session in that workspace matches.

How often depends on the machine's temp path. On my Mac the per-user part of the path already contains b…r, so the random part only needs a…v: about 1 run in 70 by simulation. Under /tmp it is about 1 in 57,000, which is why CI doesn't show it. With TMPDIR pointing at a directory named brav it fails every time.

search_sort_and_preview_are_one_projection in the same file already avoids this, and its comment says why: it pins all three haystack fields. This test now records /repo and /other as the workspaces, the same way. The session store stays in the private temp directory and the assertions are unchanged.

#5929 put this test's failures down to the redirected CODEWHALE_HOME and gave it a private store. It has still failed since then with the output above, which a session written into the store by another test would not produce.

Issue

Refs #5929

How I tested it

  • With TMPDIR set to a directory named brav, the test fails on main with the output above and passes with this change. With my normal TMPDIR it passes on both.
  • The whole session_control_acceptance module: 24 passed.
  • The 1-in-70 and 1-in-57,000 figures come from a small script that applies the matcher's rule (substring, else subsequence, over the lowercased title id workspace) to .tmp plus six random alphanumeric characters, 400,000 draws per path.
  • cargo fmt --all -- --check, cargo clippy -p codewhale-tui --all-targets --all-features with CI's flags, and cargo check -p codewhale-tui --all-targets: clean. Clippy also on 1.99, plus cargo +1.89.0 check -p codewhale-tui.
  • cargo nextest run -p codewhale-tui --lib: 15247 passed, 46 failed. The same 46 fail on main (2e8bc7b) on my machine. Two of them are the command-count checks that 7be1f48 has since updated; most of the rest need an extension-host Node version I don't have.

No new tests; this changes the fixture of an existing one.

Checklist

  • One focused change, rebased on current main
  • cargo fmt --all passes, and tests cover new or changed behavior
  • If this adds or changes a user-facing feature, I updated its docs and its row in docs/features.toml (cargo test -p codewhale-tui --test feature_registry checks it) — n/a

Thank you!!! Wonderful contribution as always

@Hmbown
Hmbown merged commit 73e993a into codewhale-hq:main Oct 14, 2026
27 checks passed
Hmbown pushed a commit that referenced this pull request Oct 15, 2026
Folds 26 main commits (incl. #6924 Runtime stores/workspace drivers, #6977,
#6943, #6959, #6958, #6956) into PR #6968's lane. The only conflicts were
web/data/agent-docs.generated.json and features.generated.json, regenerated
with web/scripts/derive-facts.mjs (check-facts OK, version 0.10.2).

Verified: scripts/dev-cargo.sh check --locked -p codewhale-tui --all-targets
finished in 9m00s with no errors. nextest -p codewhale-tui --lib on the overlap filter
(runtime_api|rlm::turn|runtime_threads|workspace_lease|snapshot):
902 passed, 0 failed, 14427 skipped (80.1s). Full suite left to hosted CI.

Branch exception: founder-authorized 2026-10-15 for this lane, recorded in
CW/coordination/BRANCH_EXCEPTIONS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NBKbhx19BRbZtvWK8rVKjz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants