Files
cc-connect/core
sidney061212-aiandClaude Opus 4.6 7eb6f34b02 fix(core): persist agent_session_id using CurrentSessionID()
event.SessionID can be empty in some cases, causing the
agent_session_id to never be written to disk. When cc-connect
restarts, the session resumes without any agent_session_id and
Claude Code treats it as a brand new conversation, losing all
context.

Fix: use state.agentSession.CurrentSessionID() (interactive mode)
and agentSession.CurrentSessionID() (relay mode) instead, which
always returns the actual session ID held by the agent. Also call
sessions.Save() after SetAgentSessionID() to ensure the change
is flushed to disk.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 02:00:46 +08:00
..
2026-02-28 10:38:24 +08:00