Where
lua/eca/state.lua around line 106-108 (handler for chat/contentReceived)
Symptom
self.mediator:id() returns subagent chatId (subagent-toolu_...) instead of parent chat chatId.
Why
State updates id from any incoming chat/contentReceived params.chatId. Subagent messages carry their own chatId AND a parentChatId field. Parent's chatId gets overwritten when the subagent emits its first message.
Fix
Skip the id update when the message has parentChatId field present.
Impact
chat/promptStop on parent may target subagent (mostly harmless — correct behavior by accident)
- Stale subagent chatId after subagent finishes could send messages to dead chat
- Breaks assumptions in any code that relies on
mediator:id() returning parent chatId
Size
1-2 line guard, ~10 minutes.
Found
During manual testing of editor-code-assistant#63 (chat/promptStop implementation).
Where
lua/eca/state.luaaround line 106-108 (handler forchat/contentReceived)Symptom
self.mediator:id()returns subagent chatId (subagent-toolu_...) instead of parent chat chatId.Why
State updates
idfrom any incomingchat/contentReceivedparams.chatId. Subagent messages carry their own chatId AND aparentChatIdfield. Parent's chatId gets overwritten when the subagent emits its first message.Fix
Skip the
idupdate when the message hasparentChatIdfield present.Impact
chat/promptStopon parent may target subagent (mostly harmless — correct behavior by accident)mediator:id()returning parent chatIdSize
1-2 line guard, ~10 minutes.
Found
During manual testing of editor-code-assistant#63 (chat/promptStop implementation).