Skip to content

fix(linear): stabilize agent session event threads - #885

Merged
dancer merged 2 commits into
vercel:mainfrom
dcbuild3r:codex/linear-agent-sessions
Sep 2, 2026
Merged

dancer merged 2 commits into
vercel:mainfrom
dcbuild3r:codex/linear-agent-sessions

Conversation

@dcbuild3r

Copy link
Copy Markdown
Contributor

Summary

Route every event in a Linear agent session to the stable issue/session thread instead of deriving a new thread from each source comment. Also accept sessions created without a root comment and attribute creator-less sessions to a distinct Linear automation identity instead of the bot itself, which previously caused automation-created sessions to be dropped as self-messages.

Test plan

  • bunx vitest run packages/adapter-linear/src/index.test.ts (164 passed)
  • bunx tsc -p packages/adapter-linear/tsconfig.json --noEmit
  • bunx biome check on changed files

Checklist

  • All commits are signed and verified
  • All commits are signed off for the DCO (git commit -s)
  • pnpm validate passes (targeted package validation run)
  • Changeset added
  • Documentation updated (N/A; documented stable session thread format is now used consistently)

Signed-off-by: dcbuild3r <dcbuilder@pm.me>
@dcbuild3r
dcbuild3r requested a review from a team as a code owner September 1, 2026 21:08
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@dcbuild3r is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Signed-off-by: dancer <josh@afterima.ge>
@dancer
dancer enabled auto-merge (squash) September 2, 2026 17:24
@dancer
dancer disabled auto-merge September 2, 2026 17:25
@dancer
dancer merged commit 3d2cb22 into vercel:main Sep 2, 2026
13 of 15 checks passed
patrick-chinchill added a commit to Chinchill-AI/chat-sdk-python that referenced this pull request Oct 1, 2026
…termined comment mentions (#232)

Linear agent sessions now route every event to one stable thread, linear:{issueId}:s:{agentSessionId}, instead of one :c:{comment}:s:{session} thread per source comment.
Ports upstream 3d2cb22a (vercel/chat#885, chat@4.40.0): rootless sessions are dispatched with a synthetic root comment, creator-less sessions are authored by linear-automation, prompted events fall back to the activity id, and fetch pages agentSession.activities for sessions with no root comment.
Ports the Linear half of fcdc1c9e (vercel/chat#946, chat@4.41.0): agent-session comments are is_mention=True, and ordinary comments leave is_mention unset so core @mention detection runs.
Divergence: the activities query is raw GraphQL, checked against Linear's published schema (no Python @linear/sdk). Documented in docs/UPSTREAM_SYNC.md.
Consumer impact: new agent-session events use the stable session thread id. Stored old :c:...:s:... ids still decode to the same session, so posting to them still works.
Closes #232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants