test: agent-session-bash-persistence 'cleans spill' races with other suites' pi-bash spills in the shared temp dir
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- testing
Research direction
Open packages/coding-agent/test/suite/agent-session-bash-persistence.test.ts and read the spillFiles helper plus the assertion at line 341; the failure is that it diffs the shared tmpdir() rather than a directory owned by this test. Copy the pattern from bash-spill-final-update.test.ts, which stubs TMPDIR with a fresh mkdtemp dir before the run. Done means the file passes alone and inside the full 59-file coding-agent invocation, with the spill diff scoped to the fresh dir.
Written by the indexing model from the issue text.
Description
Failure
packages/coding-agent/test/suite/agent-session-bash-persistence.test.ts > "propagates public executeBash <stdout|stderr> async callback <string|object|Error> rejection and cleans spill" fails intermittently when the file runs in one Vitest invocation together with other suites that run bash:
AssertionError: expected [ 'pi-bash-5757882df0d3b219.log' ] to deeply equal []
❯ test/suite/agent-session-bash-persistence.test.ts:341:66
expect(spillFiles().filter((file) => !before.includes(file))).toEqual([]);
Cause
The assertion diffs the shared temp directory (spillFiles = () => readdirSync(tmpdir()).filter(startsWith "pi-bash-")) before and after the run. Any other test in the same run whose bash output is truncated keeps its pi-bash-*.log spill in that same directory by design, and when it lands between the two reads this test counts it as its own leak. Which case fails changes from run to run.
Evidence (base 848ae794565fab877c4280e0aec0a5a0ec9bd2ec)
The same 59 coding-agent test files (every file importing the bash/read/write/edit tool modules), run twice in one invocation each at the base: run 1 failed "stdout async callback object rejection"; run 2 failed "stderr async callback string" and "stderr async callback object". The file alone passes (17/17, twice).
Suggested fix
Give the test its own temp directory (vi.stubEnv("TMPDIR", <fresh mkdtemp dir>) before the run, as bash-spill-final-update.test.ts does) so only this test's spills are counted.
Found while validating #6740 (identical at that PR's head and at its base; not caused by it).
- Dominant language
- TypeScript
- Stars
- 517
- Forks
- 163
- Avg merge
- 23h 31m
- Merged PRs (30d)
- 700
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from code-yeongyu/senpi
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
code-yeongyu/senpi#6813 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
code-yeongyu/senpi#6746 ·
Maintainers usually reply within 1 day
-
host ensure fails with EACCES for a second OS user: senpi-rpc-host-locks is shared across usersOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
code-yeongyu/senpi#6738 · 1 comment ·
Maintainers usually reply within 1 day
-
[review-low] code-yeongyu/senpi#6726: glob error text for plain and '..' patterns, and UNC prefixesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
code-yeongyu/senpi#6734 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
code-yeongyu/senpi#6723 ·
Maintainers usually reply within 1 day
All issues in code-yeongyu/senpi
Similar issues
-
bug(core): JsonOutputKeyToolsParser ignores returnId: truePossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
langchain-ai/langchainjs#12239 ·
Maintainers usually reply within 1 day
-
Board view: the Monitoring column is always empty because compact issue rows drop displayStatusOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
paperclipai/paperclip#21837 ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 93/100
lingdojo/kana-dojo#34169 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100