[GH-ISSUE #5008] [GUI] Parallel chats in the same folder mix up each other's messages and files #2313

Closed
opened 2026-11-04 01:58:21 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @streamcfd on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5008

When two chats run at the same time and both were opened in the same working
folder
, their messages and their working files get mixed up. Everything about
both chats is keyed to the folder, not to the chat: the session records, the
scratch files on disk, and (at the model level) the conversation cache. So while
one chat is mid-turn, the other chat writes into the same directory tree, waits
on the same single model slot, and borrows/evicts conversation state from the
same parked cache as the first chat.
This is not a display glitch: the files on disk really are shared, and the model
side really is swapping conversation state between chats.

Environment

  • Strata desktop app (ai.strata.desktop), Windows 11.
  • Bundled inference engine component 0.1.55-windows-x86_64-cuda-cuda13, running
    one local quantized model ("one request at a time", 1 request in flight).
  • Context window reported to the harness: 131072 tokens.
  • Two chats were active at once, plus a third opened mid-turn, plus a fourth.

How to reproduce

  1. Start the app with a local model whose concurrency is set to one request at a
    time.
  2. Open Chat A with working folder W. Start a long task that creates many
    files inside W (scratch folder, scripts, background shell jobs).
  3. While Chat A is still mid-turn, open Chat B with the same working
    folder W. Start a second task that also writes files inside W.
  4. Observe the four things below.

What actually happens

1. All chats opened in the same folder are stored in one per-folder session bucket

Every chat opened in the same folder is persisted under one directory keyed by
that folder path
, not per chat:

~\.strata\data\agent\home\sessions\--<folder-path-with-separators>--\session-<redacted>\session.v4.jsonl.zstd

and the same per-folder mapping is in ~\.strata\data\agent\sessions.json, where
every entry has the identical cwd and only the sessionId differs. So four
different chats from the last hour share one storage bucket.

2. The working files are genuinely shared between the two chats

Both chats wrote into the same folder tree: one chat created its own scratch
subfolder and scripts, the other created a different scratch subfolder and its
own scripts, and a tool launched from one chat dropped an unrelated third‑party
crash-report folder into the shared root. Each chat's pwsh / glob / read
calls operate on the shared root, so each chat sees the other's intermediate
files and can read, edit or clean up the other's work. In the logs of the last
hour the shared root path appears 42 times in one chat and 44 times in the other.
There is no per-chat scratch namespace and no ownership marker on files, so a
"cleanup my temp files" step in one chat is a hazard for the other chat.

3. A chat stalls mid-turn because the other chat owns the model slot

Both chats were assembling prompts of roughly 70k tokens each against one
131k context window served one-request-at-a-time. Chat A's turn was interrupted
by a ~40 s wait for a shell request while Chat B's request was in flight; a new
chat opened at 16:12 while Chat A was mid-turn, and Chat A's next model step
only continued after the new chat's request had run.

4. The engine parks, restores, borrows and evicts conversation state across chats

Engine log (<install>\<engine>.log) while both chats were running:

Engine log line Count
conversation cache: dropped … superseded copy of this conversation 1135
conversation cache: restored … 289
conversation cache: parked … 26
conversation cache: borrowed <N> tokens from a parked conversation, which stays parked 13
conversation cache: no room beside the parked conversation this request starts with; taking it instead of borrowing 3
cancelled request keeps its conversation: <N> tokens live 2
VRAM-pressure WARNING 17
The borrow sizes show that this is not limited to a shared system-prompt prefix:
borrowed 10813 tokens …  parked=4  borrowed=1..7
borrowed 14630 / 22822 / 54244 / 55277 / 71507 / 71661 tokens …  parked=3..4
no room beside the parked conversation this request starts with; taking it instead of borrowing   (x3)

Three or four conversations are parked in the cache at the same time, a request
borrows up to ~71k tokens from a conversation that is not the one it starts
with, and three times the engine says there was no room and it took the parked
conversation instead of borrowing from it
. Those are exactly the moments where a
chat's reply starts looking like it belongs to a different chat.

5. The text reaching the model gets garbled under this load

One chat's transcript contains a stray combining diacritic (U+036D) inserted
into the workspace path, twice, 38 seconds apart:

16:15:15  assistant reasoning: "… a file path with a strange character
          (<home>\<user>ͭ\Documents\…). … some corruption in display."
16:15:53  assistant reasoning: "… the file path in the error display is garbled,
          but the file clearly exists (read works) … where did that ͭ come from?"

The persisted tool-call arguments and tool-result text in the same session store
are clean, so the corrupted path is not coming from disk or from the tool layer —
it appears only in the text the model was working with and produced, during a turn
that ran interleaved with another chat. The visible effect was real: edits failed
with old_string was not found / FS_EDIT_NOT_FOUND on a file that read
opened normally, and the chat burned several steps re-checking a path that was
never wrong.

6. Setting changes made in one chat appear in another chat's transcript

A change of the approval policy (ask → never) made while working in one chat
shows up in the other chats as an injected user-role message:

kind=user-approval  "The approval policy changed from "ask" to "never" (changed by the user)"

in each chat's own history, at the moment that chat's next turn started — although
the user only made that change in one of the chats. A user-role line describing an
action the user did not take in that chat is indistinguishable from something the
user actually typed there.

What should happen instead

  • Each chat gets its own session record and its own scratch namespace, or at least
    per-chat ownership of files created during that chat, so listing/cleaning files
    in one chat cannot touch another chat's work.
  • Each chat's parked conversation is isolated: a request should only reuse KV state
    that belongs to the same conversation (shared static prefix aside), and "no room"
    should evict the requesting chat's own superseded copy rather than take over a
    parked conversation belonging to a different chat.
  • Under a one-request-at-a-time local model, show which chat is holding the slot
    and how long the current chat is queued, instead of a silent mid-turn stall.
  • A policy change made in one chat should be labelled as a harness/system notice in
    the other chats, not injected as a user-role message.

Impact

Mid-turn context corruption plus shared file namespace. On the affected chats this
cost several wasted tool steps, produced failed edits against files that existed,
and left two chats' output files interleaved in one folder where either chat could
overwrite or delete the other's work.

Notes

  • The stored transcripts themselves stay separate: no job id, call id, request id
    or message text from one chat appears in another chat's session file. The mixing
    is in the shared on-disk workspace, the shared per-folder session bucket, and the
    shared conversation/model cache.
  • All identifiers, paths, session ids and job ids above are redacted or replaced
    with placeholders; no user name, machine name, document names or hardware
    identifiers are included.
    Read
    Source
Originally created by @streamcfd on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5008 When two chats run at the same time and both were opened in the **same working folder**, their messages and their working files get mixed up. Everything about both chats is keyed to the folder, not to the chat: the session records, the scratch files on disk, and (at the model level) the conversation cache. So while one chat is mid-turn, the other chat writes into the same directory tree, waits on the same single model slot, and borrows/evicts conversation state from the same parked cache as the first chat. This is not a display glitch: the files on disk really are shared, and the model side really is swapping conversation state between chats. ## Environment - Strata desktop app (`ai.strata.desktop`), Windows 11. - Bundled inference engine component `0.1.55-windows-x86_64-cuda-cuda13`, running **one local quantized model** ("one request at a time", 1 request in flight). - Context window reported to the harness: **131072 tokens**. - Two chats were active at once, plus a third opened mid-turn, plus a fourth. ## How to reproduce 1. Start the app with a local model whose concurrency is set to one request at a time. 2. Open **Chat A** with working folder `W`. Start a long task that creates many files inside `W` (scratch folder, scripts, background shell jobs). 3. While Chat A is still mid-turn, open **Chat B** with the **same** working folder `W`. Start a second task that also writes files inside `W`. 4. Observe the four things below. ## What actually happens ### 1. All chats opened in the same folder are stored in one per-folder session bucket Every chat opened in the same folder is persisted under **one directory keyed by that folder path**, not per chat: ``` ~\.strata\data\agent\home\sessions\--<folder-path-with-separators>--\session-<redacted>\session.v4.jsonl.zstd ``` and the same per-folder mapping is in `~\.strata\data\agent\sessions.json`, where every entry has the identical `cwd` and only the `sessionId` differs. So four different chats from the last hour share one storage bucket. ### 2. The working files are genuinely shared between the two chats Both chats wrote into the *same* folder tree: one chat created its own scratch subfolder and scripts, the other created a different scratch subfolder and its own scripts, and a tool launched from one chat dropped an unrelated third‑party crash-report folder into the shared root. Each chat's `pwsh` / `glob` / `read` calls operate on the shared root, so each chat sees the other's intermediate files and can read, edit or clean up the other's work. In the logs of the last hour the shared root path appears 42 times in one chat and 44 times in the other. There is no per-chat scratch namespace and no ownership marker on files, so a "cleanup my temp files" step in one chat is a hazard for the other chat. ### 3. A chat stalls mid-turn because the other chat owns the model slot Both chats were assembling prompts of roughly **70k tokens each** against one 131k context window served one-request-at-a-time. Chat A's turn was interrupted by a ~40 s wait for a shell request while Chat B's request was in flight; a new chat opened at 16:12 while Chat A was mid-turn, and Chat A's next model step only continued after the new chat's request had run. ### 4. The engine parks, restores, borrows and evicts conversation state across chats Engine log (`<install>\<engine>.log`) while both chats were running: | Engine log line | Count | |---|---| | `conversation cache: dropped … superseded copy of this conversation` | 1135 | | `conversation cache: restored …` | 289 | | `conversation cache: parked …` | 26 | | `conversation cache: borrowed <N> tokens from a parked conversation, which stays parked` | 13 | | `conversation cache: no room beside the parked conversation this request starts with; taking it instead of borrowing` | 3 | | `cancelled request keeps its conversation: <N> tokens live` | 2 | | VRAM-pressure `WARNING` | 17 | The borrow sizes show that this is not limited to a shared system-prompt prefix: ``` borrowed 10813 tokens … parked=4 borrowed=1..7 borrowed 14630 / 22822 / 54244 / 55277 / 71507 / 71661 tokens … parked=3..4 no room beside the parked conversation this request starts with; taking it instead of borrowing (x3) ``` Three or four conversations are parked in the cache at the same time, a request borrows up to ~71k tokens from a conversation that is *not* the one it starts with, and three times the engine says there was no room and it **took the parked conversation instead of borrowing from it**. Those are exactly the moments where a chat's reply starts looking like it belongs to a different chat. ### 5. The text reaching the model gets garbled under this load One chat's transcript contains a stray combining diacritic (**U+036D**) inserted into the workspace path, twice, 38 seconds apart: ``` 16:15:15 assistant reasoning: "… a file path with a strange character (<home>\<user>ͭ\Documents\…). … some corruption in display." 16:15:53 assistant reasoning: "… the file path in the error display is garbled, but the file clearly exists (read works) … where did that ͭ come from?" ``` The persisted tool-call arguments and tool-result text in the same session store are clean, so the corrupted path is not coming from disk or from the tool layer — it appears only in the text the model was working with and produced, during a turn that ran interleaved with another chat. The visible effect was real: edits failed with `old_string was not found` / `FS_EDIT_NOT_FOUND` on a file that `read` opened normally, and the chat burned several steps re-checking a path that was never wrong. ### 6. Setting changes made in one chat appear in another chat's transcript A change of the approval policy (`ask` → `never`) made while working in one chat shows up in the other chats as an injected user-role message: ``` kind=user-approval "The approval policy changed from "ask" to "never" (changed by the user)" ``` in each chat's own history, at the moment that chat's next turn started — although the user only made that change in one of the chats. A user-role line describing an action the user did not take in that chat is indistinguishable from something the user actually typed there. ## What should happen instead - Each chat gets its own session record and its own scratch namespace, or at least per-chat ownership of files created during that chat, so listing/cleaning files in one chat cannot touch another chat's work. - Each chat's parked conversation is isolated: a request should only reuse KV state that belongs to the same conversation (shared static prefix aside), and "no room" should evict the requesting chat's own superseded copy rather than take over a parked conversation belonging to a different chat. - Under a one-request-at-a-time local model, show which chat is holding the slot and how long the current chat is queued, instead of a silent mid-turn stall. - A policy change made in one chat should be labelled as a harness/system notice in the other chats, not injected as a user-role message. ## Impact Mid-turn context corruption plus shared file namespace. On the affected chats this cost several wasted tool steps, produced failed edits against files that existed, and left two chats' output files interleaved in one folder where either chat could overwrite or delete the other's work. ## Notes - The stored transcripts themselves stay separate: no job id, call id, request id or message text from one chat appears in another chat's session file. The mixing is in the shared on-disk workspace, the shared per-folder session bucket, and the shared conversation/model cache. - All identifiers, paths, session ids and job ids above are redacted or replaced with placeholders; no user name, machine name, document names or hardware identifiers are included. Read Source
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6581829114 --> @github-actions[bot] commented on GitHub (Nov 2, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6581871381 --> @github-actions[bot] commented on GitHub (Nov 2, 2026): Thanks, this follows the format now.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Hello streamcfd,

Thank you for the clear description. We reproduced it: one chat's end-of-turn sweep listed the other chat's file as its own. In Strata 0.2.11 a turn reports only the files its own tools wrote, and when turns overlap, files nobody claimed are withheld. In a real-app test two parallel chats in one folder gave four clean rounds, each with its own file. The things that are not ours (the agent's per-folder bucket and its approval-policy notice) are unchanged. If chats still mix up on 0.2.11, please send which tool wrote the file.

The Strata project

<!-- gh-comment-id:6658466933 --> @Niko1221 commented on GitHub (Nov 5, 2026): Hello streamcfd, Thank you for the clear description. We reproduced it: one chat's end-of-turn sweep listed the other chat's file as its own. In Strata 0.2.11 a turn reports only the files its own tools wrote, and when turns overlap, files nobody claimed are withheld. In a real-app test two parallel chats in one folder gave four clean rounds, each with its own file. The things that are not ours (the agent's per-folder bucket and its approval-policy notice) are unchanged. If chats still mix up on 0.2.11, please send which tool wrote the file. The Strata project
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2313
No description provided.