Repository navigation
Description
Preflight
- I searched existing issues for this problem.
What happened?
When both ~/.qoder and ~/.qoder-cn exist, the Qoder session analyzer can select the international ~/.qoder home even when it has no sessions and the CN home is populated. hasQoderSessionData() treats the existence of an audit/ or logs/ directory as proof of session data, so an empty ~/.qoder/logs/ is enough to mask a populated ~/.qoder-cn.
This is the residual case left after the home-resolution work in #212 and #213. The default home resolves correctly when ~/.qoder is absent; it still resolves to ~/.qoder when that directory exists with an empty logs/.
Where did it happen?
Qoder
Version and environment
Better Harness 0.7.0-alpha2 on Windows 11 (10.0.26200), Node.js 24.15.0, npm 11.12.1, repository at 9f58e3911d6bff5c0df61c4dd00c8f3abbfc4e87.
Steps to reproduce
- Create an empty directory at
~/.qoder/logs/. - Create a
~/.qoder-cnhome with one session, for exampleprojects/<workspace-slug>/<session>.jsonlpluslogs/sessions/<workspace-slug>/<session>/segments/*.jsonl. - Run Qoder session analysis without
QODER_HOMEor--qoder-home, either throughQoderSessionAnalyzer.analyze({ workspace, command: "sessions" })or the equivalent CLI command. - Check
result.scope.homeand the discovered sessions.
Expected vs actual result
Expected: scope.home is ~/.qoder-cn and the CN session is discovered.
Actual: scope.home is ~/.qoder and the result contains 0 sessions.
Example output from a temporary fixture:
defaultQoderHome: <tmp>\.qoder
auto scope.home: <tmp>\.qoder
auto sessions: 0 []
Logs or screenshots
The same case as a failing assertion:
AssertionError: Expected values to be strictly equal:
+ actual - expected
+ '<tmp>\.qoder'
- '<tmp>\.qoder-cn'
Anything else?
docs/specs/2026-10-24-harness-analysis-defects.mdAC-1 says the default home should prefer~/.qoder-cnwhen~/.qoderis absent or has no session data.- [Bug]:
harness analyzehardcodes the agent home to~/.qoder; Qoder CN installs (~/.qoder-cn) silently lose every session source root #212 is the broader report; fix(analysis): repair host discovery and evidence coverage #213 repaired the main discovery path. This is the remaining empty-directory branch. - I can open a focused fix with a regression test if this matches the intended AC-1 behavior.
- AI disclosure: this issue was drafted with AI assistance; the reproduction, code references, and output were checked by a human.
Activity
sorrycc commentedon Nov 11, 2026
Reproduced on 9f58e39 with an empty
~/.qoder/logs/and a~/.qoder-cnholding one session inprojects/<slug>/andlogs/sessions/<slug>/…/segments.defaultQoderHome()andscope.homeresolved to~/.qoder, with 0 sessions.Cause:
hasQoderSessionData()counted the mere existence ofaudit/orlogs/as session data, and it never looked atprojects/orsessions/.Fixed in #215 (merged as c6240a8). A home now counts as having session data only when a
.jsonltranscript exists underaudit/,logs/sessions/,projects/orsessions/. I added regression tests for your empty-logs case and for a CN home that only hasprojects/transcripts. Both failed before the fix and pass now. Thanks for the clear report.fix(analysis): require Qoder session files before preferring a home