Auto-attach agent deliverables to the originating Linear issue#1214
Open
alicejt wants to merge 2 commits into
Open
Auto-attach agent deliverables to the originating Linear issue#1214alicejt wants to merge 2 commits into
alicejt wants to merge 2 commits into
Conversation
When an issue-bound agent session completes, deliverable files the agent created or modified in its worktree are uploaded to Linear and attached to the issue — so the work is one click away on the issue instead of buried in a git branch or PR. - deliverables.ts: pure detection helpers — DELIVERABLE_EXTENSIONS, parseGitPorcelain, filterDeliverables (extension allowlist + noise exclusion: node_modules/dist/build/coverage, lockfiles, dotfiles, CHANGELOG), contentTypeForFile. - GitService.detectDeliverables(worktreePath): runs `git status --porcelain`, filters, resolves to existing absolute paths. Best-effort — git failure returns [] rather than throwing. - IIssueTrackerService.createAttachment + AttachmentCreateRequest/Response types; implemented in LinearIssueTrackerService (Linear attachmentCreate mutation), stubbed in CLIIssueTrackerService. - AgentSessionManager gains an optional onSessionDeliverables hook, fired after addResultEntry on successful completion, wrapped so a failure never blocks the session. - EdgeWorker.handleSessionDeliverables: detect → requestFileUpload → PUT bytes → createAttachment, per file. Worktree-free sessions (Slack, Project Update chats) no-op; files >10MB skipped; batch capped at 10. - Unit tests for the detection/filter helpers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
What this does
When an issue-bound agent session completes, the deliverable files the agent created or modified in its worktree are uploaded to Linear and attached to the originating issue — so the work is one click away on the issue instead of buried in a git branch or PR.
How it works
deliverables.ts— pure, unit-tested helpers:DELIVERABLE_EXTENSIONS(documents + images:.md,.pdf,.docx,.csv,.xlsx,.png, …),parseGitPorcelain,filterDeliverables(extension allowlist + excludesnode_modules/dist/build/coverage, lockfiles, dotfiles,CHANGELOG.md),contentTypeForFile.GitService.detectDeliverables(worktreePath)— runsgit status --porcelain, filters, resolves to existing absolute paths. Best-effort: a git failure returns[]rather than throwing.IIssueTrackerService.createAttachment+AttachmentCreateRequest/AttachmentCreateResponse— implemented inLinearIssueTrackerService(LinearattachmentCreatemutation), stubbed inCLIIssueTrackerService. (requestFileUploadalready existed.)AgentSessionManagergains an optionalonSessionDeliverableshook, fired afteraddResultEntryon successful completion, wrapped so a failure never blocks the session.EdgeWorker.handleSessionDeliverables— detect →requestFileUpload→ PUT bytes →createAttachment, per file.Safety / scope
Testing
pnpm build+pnpm typecheckclean across the monorepo; fulledge-workersuite shows no new failures (the pre-existingrunner-selection/screenshot-upload-hooksfailures onmainare unrelated).🤖 Generated with Claude Code