Repository navigation
test(sessions): the picker search check no longer depends on the temp directory's name - #6958
Conversation
… 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>
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. |
|
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. |
Thank you!!! Wonderful contribution as always |
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
What and why
session_control_acceptance::tests::tui_and_api_listings_agreefails now and then on my Mac:The test saves its sessions with a workspace under
TempDir, searches forbravand expects onlybravo. The matcher looks attitle id workspaceand falls back to a subsequence match, so the random.tmpXXXXXXpart 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 needsa…v: about 1 run in 70 by simulation. Under/tmpit is about 1 in 57,000, which is why CI doesn't show it. WithTMPDIRpointing at a directory namedbravit fails every time.search_sort_and_preview_are_one_projectionin the same file already avoids this, and its comment says why: it pins all three haystack fields. This test now records/repoand/otheras 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_HOMEand 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
TMPDIRset to a directory namedbrav, the test fails on main with the output above and passes with this change. With my normalTMPDIRit passes on both.session_control_acceptancemodule: 24 passed.title id workspace) to.tmpplus six random alphanumeric characters, 400,000 draws per path.cargo fmt --all -- --check,cargo clippy -p codewhale-tui --all-targets --all-featureswith CI's flags, andcargo check -p codewhale-tui --all-targets: clean. Clippy also on 1.99, pluscargo +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
maincargo fmt --allpasses, and tests cover new or changed behaviordocs/features.toml(cargo test -p codewhale-tui --test feature_registrychecks it) — n/a