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]: ACP session/load overwrites a session whose header line is unreadable with a new empty session #205
When the first line of a saved session file can't be parsed, ACP session/load returns success and overwrites that file with a brand-new empty session that has a different id. Every earlier entry in the conversation is lost, and the client gets no error.
The session reader skips lines that fail JSON.parse. If the header is among them, it returns no entries, and setSessionFile then calls newSession() and _rewriteFile() on the same path. A damaged line further down is handled safely: it stays on disk and new entries are appended after it. So this only happens when the header line is the damaged one, for example after an interrupted write or a disk-full error.
What did you expect to happen?
session/load should fail with an error naming the unreadable session and leave the file unchanged. It should never replace an existing conversation file with a new session.
Steps to reproduce
Use an isolated HOME. Start auggie --acp, run initialize, session/new with cwd set to /tmp/repro, and send one session/prompt so the session is persisted. The file is ~/.augment/sessions-v2/--tmp-repro--/<id>.jsonl (5 lines in my run).
Truncate only the first line so it is no longer valid JSON:
Start auggie --acp again and send session/load with {"sessionId":"<id>","cwd":"/tmp/repro","mcpServers":[]}.
The response is a success. Inspect the file: it now holds 3 lines, a new session header with a different id followed by fresh model_change and thinking_level_change entries. The original messages are gone.
Auggie version
1.2.3 (official npm build). Also reproduced on 1.3.0-prerelease.202611271510.
Request ID
N/A, no model request is involved.
Environment details
macOS (darwin arm64), Node 24.22.3, ACP mode.
Anything else we need to know?
Rejecting a session whose header can't be read, instead of starting a new one at the same path, would be enough. Validating every line before overwriting anything would also protect the case where several lines are damaged.
Activity