Files
cc-connect/core
a0bc3f9e28 fix(relay): prevent agent session corruption on timeout (#405)
* fix(feishu): respond to @all messages in group chats

Feishu @all sends {"text":"@_all"} with 0 mentions, which was being
ignored when group_reply_all=false. Add respond_to_at_everyone_and_here
option to allow bots to respond to @all messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(relay): prevent agent session corruption on timeout

Three issues caused agents to become unresponsive after a relay timeout:

1. StartSession received the relay timeout context -- when the deadline
   fired, exec.CommandContext killed the Claude process mid-turn,
   corrupting the session state. Now uses the engine context instead.

2. defer agentSession.Close() killed the process immediately on return.
   Now the session drains in a background goroutine (drainRelaySession)
   so the agent can finish its turn and save state cleanly.

3. No fallback when resuming a corrupted session. Added retry logic that
   clears the stale session ID and starts fresh, matching the existing
   interactive message flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: pinxi_mei <pinxi_mei@lebo.cn>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 09:24:19 +08:00
..
2026-02-28 10:38:24 +08:00