Skip to content

feat: patch Linear issues and projects - #475

Open
ianw-oai wants to merge 1 commit into
mainfrom
dev/ianw/linear-ticket-patching
Open

feat: patch Linear issues and projects#475
ianw-oai wants to merge 1 commit into
mainfrom
dev/ianw/linear-ticket-patching

Conversation

@ianw-oai

Copy link
Copy Markdown
Collaborator

Summary

Import Linear issues and patch them with the existing CLI workflow.

Changes

  • Patch selected issues or every open issue in a project.
  • Support native Linear issue filters and automatic pagination.
  • Use the existing Linear SDK and keep credentials out of the patch subprocess.
codex-security patch --linear SEC-123 --linear SEC-124
codex-security patch --linear-project "Security backlog"
codex-security patch --linear-project "Security backlog" \
  --filter '{"labels":{"name":{"eq":"security"}}}'

Testing

  • Full test suite: 1,292 passed, 11 skipped.
  • TypeScript, formatting, build, and installed npm package checks passed.

Risk and rollout

Linear access is read-only. Existing patch behavior is unchanged, and Linear credentials are not passed to Codex.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@ianw-oai ianw-oai changed the title Patch Linear issues and projects feat: patch Linear issues and projects Aug 16, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Aug 16, 2026
@ianw-oai
ianw-oai marked this pull request as ready for review August 16, 2026 03:46
@ianw-oai
ianw-oai requested a review from kmbroai August 16, 2026 04:30

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking QA notes on 4d3aeb5c. The adapter is already a good size. Pagination, credential precedence, error handling, and removing Linear credentials before starting the patch subprocess passed with the real Linear SDK against a synthetic service. The full local suite passed: 1,292 tests, 11 skipped. The current GitHub checks are green.

I'd keep the adapter small and retain the issue ID and URL when connecting it to the common patch result. This covers intake and patch handoff, not a live Linear-to-PR run.

Comment on lines +79 to +82
return issues.map(
({ identifier, title, url, description }) =>
`Linear issue: ${identifier}\nTitle: ${title}\nURL: ${url}\n\n${description ?? ""}`,
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: when this feeds the common patch result, could we retain the issue ID and URL alongside the text? A small { source, id, url, text } value, formatted at the prompt boundary, would save later stages from parsing this string. I'd keep the SDK adapter and pagination as they are.

@zcrab-oai zcrab-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found two input-handling issues affecting imported issue content and explicitly selected Linear workspaces.

Comment thread sdk/typescript/src/cli.ts
exitCode = await runSkill(
"fix-finding",
positionals,
[...positionals, ...imports],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Keep imported Linear issue content literal

Could imported Linear issues take a literal-only path into runSkill instead of sharing positional file-or-text resolution? User-selected local files and remotely supplied issue descriptions have different trust boundaries, and imported descriptions must never trigger local file lookup. Please add Unix and Windows regressions that ensure imported ticket content is always preserved literally.

}
} else {
for (const input of options.issues) {
const id = linearIssueIdentifier(input);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Preserve the workspace selected by an issue URL

Could we retain the workspace from a supplied Linear issue URL and verify it against the fetched issue's canonical URL? Looking up only the team-and-number identifier can silently return a different workspace's issue when the configured credential belongs elsewhere, causing the patch to target something other than the issue the user selected.

Comment thread sdk/typescript/src/cli.ts
options: z.object({
effort: effortOption(),
linear: z
.array(optionValue("--linear"))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noop comment, calling out so we are aware

earlier we did --to linear to make it more generic for publishing. but then I let codex add --linear-... to the prefix of things bc they were very linear specific. IMO we should either go full generic with --to and stuff like --ticket-api-key or more specific with --linear-... prefixed flags.

TL;DR I don't like how I did a mix of the 2.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is similar to the linear client I added for the publish workflow. We might want to put those together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants