When a Linear Agent Session is created, Linear's AgentSessionEvent webhook ships a promptContext string that includes not only the <primary-directive-thread> where the agent was mentioned, but every <other-thread> block on the issue — including threads that belong to other agents' sessions (see the example in Linear's docs: https://linear.app/developers/agent-interaction). linearChannel uses promptContext verbatim as the turn message (messageFromLinearAgentSessionEvent) and unconditionally spreads event.previousComments into the context array in dispatchAgentSession.
There is no hook to influence this: onAgentSession can only return { auth, context } — it can append context strings, but cannot rewrite or filter the message, and event.previousComments is appended regardless of what it returns.
Consequence: when several agents work on the same issue in separate sessions, each new session starts with the other agents' full conversation threads in its model-visible context. That leaks unrelated instructions/state between sessions and inflates the prompt.
Proposal (either would work):
- A
linearChannel config option, e.g. excludeOtherThreads: true, that strips <other-thread> blocks from promptContext before it becomes the turn message; or
- Let
onAgentSession (or a new hook) return a transformed message / replace the outbound payload before dispatch.
Currently the only workaround is patching the minified dist output.
Observed on eve@0.22.3 (dist/src/public/channels/linear/linearChannel.js — dispatchAgentSession; dist/src/public/channels/linear/inbound.js — messageFromLinearAgentSessionEvent).
When a Linear Agent Session is created, Linear's
AgentSessionEventwebhook ships apromptContextstring that includes not only the<primary-directive-thread>where the agent was mentioned, but every<other-thread>block on the issue — including threads that belong to other agents' sessions (see the example in Linear's docs: https://linear.app/developers/agent-interaction).linearChannelusespromptContextverbatim as the turn message (messageFromLinearAgentSessionEvent) and unconditionally spreadsevent.previousCommentsinto the context array indispatchAgentSession.There is no hook to influence this:
onAgentSessioncan only return{ auth, context }— it can append context strings, but cannot rewrite or filter the message, andevent.previousCommentsis appended regardless of what it returns.Consequence: when several agents work on the same issue in separate sessions, each new session starts with the other agents' full conversation threads in its model-visible context. That leaks unrelated instructions/state between sessions and inflates the prompt.
Proposal (either would work):
linearChannelconfig option, e.g.excludeOtherThreads: true, that strips<other-thread>blocks frompromptContextbefore it becomes the turn message; oronAgentSession(or a new hook) return a transformedmessage/ replace the outbound payload before dispatch.Currently the only workaround is patching the minified
distoutput.Observed on
eve@0.22.3(dist/src/public/channels/linear/linearChannel.js—dispatchAgentSession;dist/src/public/channels/linear/inbound.js—messageFromLinearAgentSessionEvent).