You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(tests): backend tests write chat history into the source tree — data/chats/ appears in the worktree after a run #22029
Developers on three separate PRs (#22012, #22028, and a run on #22024's branch) each found an untracked autobot-backend/data/chats/ in their worktree after running targeted backend tests. Each removed it by hand before committing.
Cause (code, not yet confirmed by running)
chat_history/base.py:204-207_get_chats_directory falls back to the relative path "data/chats" when AUTOBOT_CHATS_DIRECTORY and the SSOT misc.chats_directory are unset. The SSOT default is "" (autobot_shared/ssot_config.py:1470).
The relative path resolves against the cwd. session.py:446 and session_locked.py:194 create the directory on save.
Suspected writers are tests that construct ChatHistoryManager() without temp paths:
utils/concurrency_safety_test.py:117,140,159,452;
chat_history/initialize_test.py:58, which uses history_file="data/chat_history.json".
Acceptance criteria
The test (or tests) that write into the tree are identified by running them, with the command pasted here.
Test runs never write chat data into the source tree. Either an autouse fixture points AUTOBOT_CHATS_DIRECTORY (and the history file) at tmp_path, or the tests pass temp paths. A guard test fails if a backend test run leaves autobot-backend/data/ behind.
A relative default chats directory resolves against the configured data root, never against the process cwd, or the backend refuses to start without one. The relative fallback is the same defect in production.
autobot-backend/data/ is not committable: add a .gitignore entry as defence in depth, never as the fix.
Activity