feat(eve): linear - exclude other agents' threads from the dispatched turn - #1452
Open
lucasdoell wants to merge 6 commits into
Open
feat(eve): linear - exclude other agents' threads from the dispatched turn#1452lucasdoell wants to merge 6 commits into
lucasdoell wants to merge 6 commits into
Conversation
…ercel#1226) Signed-off-by: Lucas Doell <lucas@lux.dev>
Signed-off-by: Lucas Doell <lucas@lux.dev>
…ages Signed-off-by: Lucas Doell <lucas@lux.dev>
…ercel#1226) Signed-off-by: Lucas Doell <lucas@lux.dev>
…ercel#1226) Signed-off-by: Lucas Doell <lucas@lux.dev>
Signed-off-by: Lucas Doell <lucas@lux.dev>
Contributor
|
@lucasdoell is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #1226.
On multi-agent Linear issues, Linear's
AgentSessionEvent.promptContextincludes every agent's conversation threads (<other-thread>blocks), andlinearChannelpassed it verbatim as the turn message while unconditionally spreadingpreviousCommentsinto context — leaking other sessions' instructions and state into the model-visible turn.This PR adds, per the design in
research/linear-exclude-other-threads.md(included in this branch):linearChannel({ excludeOtherThreads: true })— strips<other-thread>blocks from the default turn message. Fail-closed: on malformed or drifted markup (including a comment body embedding a literal</other-thread>), the message falls back to the session summary / issue title instead of leaking partial thread content, with a logged warning. An O(n) tag-count guard short-circuits adversarial inputs before the regex runs.onAgentSessioncan now returnmessage(replaces the computed turn message; wins over the flag; empty/whitespace overrides are ignored) andpreviousComments(replaces the webhook's previous comments;[]drops them). The flag deliberately does not touchpreviousComments— those are the primary thread's own prior comments.stripLinearOtherThreadsandLinearMessageOptions(options parameter onmessageFromLinearAgentSessionEvent).docs/channels/linear.mdxdocumenting the exposure and the composed-defaultOnAgentSessionrecipe.How did you test your changes?
pnpm --filter eve exec vitest run --config vitest.unit.config.ts src/public/channels/linear/— 48 tests passing, including 21 new: fail-closed stripping (attribute-bearing fixtures modeled on Linear's documented format, unpaired-tag and embedded-literal attack cases), fallback chain, and full webhook→dispatch tests for the flag, override precedence, empty-override normalization,previousCommentssemantics, and image attachment on overridden messagespnpm test(full unit + integration suite),pnpm typecheck,pnpm lint,pnpm fmt,pnpm docs:check,pnpm guard:invariantsPR Checklist
CONTRIBUTING.mdevepackagegit commit --signoff)