Transform Linear persona into chat lead

Merged
KH
6mo ago
+816-261

User description

Summary

  • transform agents/linear in place into the sandbox:false Linear chat lead
  • add AgentSessionEvent.created/.prompted and issueCommentMention fallback trigger coverage for /linear/comments/**
  • use @agentworkforce/runtime 3.0.41 unwrapResourceRecord and @relayfile/relay-helpers 0.3.31 Linear agent activity helpers
  • route implement intent through ctx.workflow.run instead of direct ctx.harness.run, then post the PR URL back to the session/comment
  • preserve #23 mention/parser fallback behavior for real relayfile resource payloads

Verification

  • npm run typecheck
  • npm test
  • npm run compile

Deploy note

No persona deploy in this PR. Operator-gated morning deploy should run: agentworkforce persona compile ./linear/persona.ts && agentworkforce deploy ./linear/persona.json --mode cloud


Summary by cubic

Transforms the Linear persona into a chat lead that runs agent-session conversations, posts thought/response activities, remembers short context, and delegates implementation to a workflow that opens PRs via the Cloud API. Adds a small PR script used by the workflow.

  • New Features

    • Triggers: AgentSessionEvent.created/prompted on /linear/agent-sessions/** and /linear/comments/**, plus AppUserNotification.issueCommentMention on /linear/app-user-notifications/** with comment fallback; keep label-scoped issue.create on /linear/issues/**.
    • Chat handling: post a "thought" then a "response"; skip self activity; fall back to issue comments when no session; store short thread memory per session. Parse Linear payloads with unwrapResourceRecord to read issue id, session id, and prompt body across formats.
    • Implementation: classify intent with LLM; on "implement", write workflows/linear-chat-lead.ts, run the linear-chat-lead workflow, and post the PR URL. Workflow clones the repo and embeds linear/create-pr.script.ts to open PRs via the Cloud API using the workspace token (no gh).
    • Persona: renamed to linear-chat-lead with sandbox: false, memory: true, and model gpt-5.5.
  • Dependencies

    • Bump @agentworkforce/persona-kit to ^3.0.41, @agentworkforce/runtime to ^3.0.41, @relayfile/relay-helpers to ^0.3.31, and dev agentworkforce to ^3.0.41.

CodeAnt-AI Description

Turn Linear issues into chat-led conversations that can answer, remember context, and hand off implementation

What Changed

  • Linear now treats agent-session prompts and comment mentions as chat, replying in the thread and keeping short memory per session.
  • When the user asks for implementation, it starts a coding workflow, then posts the PR link back into Linear when finished.
  • The agent now handles more Linear event formats and keeps working on real comment payloads with mention fallbacks.
  • It no longer runs through the old sandbox-based path; self-replies are still ignored to avoid loops.

Impact

✅ Faster Linear responses
✅ Less repeated context in follow-up chats
✅ Fewer missed PR links after implementation requests

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.