Skip to content

The fastest browser for AI agents to run browser automation, built for sharing your logged-in browser state with your AI agents, like Codex or Claude Code, without disturbing you. Zero cost, zero config.

fix(tools): ignore "label not on issue" when removing bot labels

Zhuowei Wang9058de94c919
diff --git a/tools/linear-autofix/src/linear.mjs b/tools/linear-autofix/src/linear.mjs
index 524a9bc..ca7c96d 100644
--- a/tools/linear-autofix/src/linear.mjs
+++ b/tools/linear-autofix/src/linear.mjs
@@ -128,10 +128,15 @@ export async function removeLabel(issue, name) {
if (!found) return;
if (config.dryRun)
return dry(`remove label ${name} from ${issue.identifier}`);
- await gql(
- `mutation($id: String!, $labelId: String!) { issueRemoveLabel(id: $id, labelId: $labelId) { success } }`,
- { id: issue.id, labelId: found.id },
- );
+ try {
+ await gql(
+ `mutation($id: String!, $labelId: String!) { issueRemoveLabel(id: $id, labelId: $labelId) { success } }`,
+ { id: issue.id, labelId: found.id },
+ );
+ } catch (err) {
+ // Removing a label the issue does not carry is not an error for callers.
+ if (!/not on issue/i.test(err.message)) throw err;
+ }
}
export async function setState(issue, stateName) {