Skip to content

linearChannel: no way to exclude other comment threads (promptContext / previousComments) from the dispatched turn #1226

Description

@Lukavyi

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):

  1. A linearChannel config option, e.g. excludeOtherThreads: true, that strips <other-thread> blocks from promptContext before it becomes the turn message; or
  2. 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.jsdispatchAgentSession; dist/src/public/channels/linear/inbound.jsmessageFromLinearAgentSessionEvent).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions