Location
ai-code-backends-infra.el:503-518
Severity
Medium
Problem
The ai-code-backends-infra--attached-file-session function now validates sessions only by checking if the buffer name parses correctly for the prefix, ignoring the working-dir parameter.
Before:
(valid (and (buffer-live-p attached)
(memq attached
(ai-code-backends-infra--find-session-buffers
prefix
working-dir))))
After:
(valid (and (buffer-live-p attached)
(ai-code-backends-infra--parse-session-buffer-name
(buffer-name attached)
prefix)))
Impact
A session buffer that was started for a different working directory could now be incorrectly considered valid if its name matches the expected prefix pattern. This could lead to attaching to the wrong session when working across multiple projects.
Scenario
- User has project A open with a session
- User switches to project B in the same frame
- The old session from project A could be incorrectly attached because the buffer name parses correctly
Suggested Fix
Re-add working directory validation to the session attachment check.
Location
ai-code-backends-infra.el:503-518Severity
Medium
Problem
The
ai-code-backends-infra--attached-file-sessionfunction now validates sessions only by checking if the buffer name parses correctly for the prefix, ignoring theworking-dirparameter.Before:
After:
Impact
A session buffer that was started for a different working directory could now be incorrectly considered valid if its name matches the expected prefix pattern. This could lead to attaching to the wrong session when working across multiple projects.
Scenario
Suggested Fix
Re-add working directory validation to the session attachment check.