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): stay silent on tickets unrelated to ego lite

Zhuowei Wangbf20f3a442f1
diff --git a/tools/linear-autofix/README.md b/tools/linear-autofix/README.md
index 18ffd2b..1811ee3 100644
--- a/tools/linear-autofix/README.md
+++ b/tools/linear-autofix/README.md
@@ -17,7 +17,8 @@ Linear (assignee = me, state ∈ Backlog/Todo/In Progress/Pending Review)
│ tick every 10 min
▼
new ──triage (claude, read-only)──► skipped (browser_side / needs_info / ops_reply /
- │ design_decision / duplicate / already_fixed)
+ │ design_decision / duplicate / already_fixed /
+ │ unrelated: no comment, no label)
└─ verdict fix ──► triaged
│ implement (claude in a worktree; failing test → fix → npm test → commit)
│ real-browser E2E on this machine, then git push (failed cases do not block)
@@ -41,6 +42,10 @@ Every comment the bot writes (Linear, PR, review threads) starts with
`<!-- linear-autofix -->`. Adding the `no-agent` label to a ticket stops the
bot on it; it also writes `agent:fix`, `agent:skipped` and `agent:escalated`.
+A ticket that has nothing to do with ego lite gets the verdict `unrelated`, and
+the bot writes nothing on it. The verdict shows only in `status` and in the tick
+log, which is where to catch a misjudged ticket; `retry` triages it again.
+
## What Claude may and may not do
| Stage | Working dir | Allowed tools |
diff --git a/tools/linear-autofix/src/prompts/triage.md b/tools/linear-autofix/src/prompts/triage.md
index 2aa9c76..5084781 100644
--- a/tools/linear-autofix/src/prompts/triage.md
+++ b/tools/linear-autofix/src/prompts/triage.md
@@ -32,10 +32,20 @@ Pick exactly one:
- `duplicate` — a duplicate of another ticket; name it in `reason`.
- `already_fixed` — the behavior is already correct on `{{baseBranch}}`;
cite the commit or code.
+- `unrelated` — the ticket has nothing to do with ego lite: not the browser
+ app, its installer or its Chromium fork, not `ego-browser`, its Skill or this
+ repository. Examples are backend services and infrastructure of other
+ products, and company operations. The bot stays silent on these tickets: it
+ writes neither a comment nor a label.
When in doubt between `fix` and anything else, choose the other verdict. A
wrong `fix` costs an unattended implementation run and a noisy PR.
+When in doubt between `unrelated` and anything else, choose the other verdict.
+A wrong `unrelated` hides an ego lite ticket from the team without a trace on
+it. A ticket about the ego lite app that this repository cannot fix is
+`browser_side`, not `unrelated`.
+
## Also report
- `needs_windows`: true if verifying the fix requires a Windows machine (the
@@ -47,7 +57,8 @@ wrong `fix` costs an unattended implementation run and a noisy PR.
- `repro_plan`: for `fix`, the concrete failing test or reproduction the
implementer should write first.
- `comment`: a short note for the Linear ticket, written in the ticket's own
- language, explaining the verdict to the team in two to five sentences.
+ language, explaining the verdict to the team in two to five sentences. Leave
+ it empty for `unrelated`.
Return only the JSON object described by the schema.
diff --git a/tools/linear-autofix/src/triage-linear-writes.test.mjs b/tools/linear-autofix/src/triage-linear-writes.test.mjs
new file mode 100644
index 0000000..90cbaa6
--- /dev/null
+++ b/tools/linear-autofix/src/triage-linear-writes.test.mjs
@@ -0,0 +1,87 @@
+import assert from "node:assert/strict";
+import fs from "node:fs";
+import os from "node:os";
+import path from "node:path";
+import { test } from "node:test";
+
+const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "linear-autofix-triage-"));
+const output = path.join(tmp, "claude-output.json");
+const claude = path.join(tmp, "claude");
+fs.writeFileSync(claude, `#!/bin/sh\ncat > /dev/null\ncat '${output}'\n`);
+fs.chmodSync(claude, 0o755);
+
+Object.assign(process.env, {
+ AUTOFIX_CLAUDE_BIN: claude,
+ AUTOFIX_REPO: tmp,
+ AUTOFIX_STATE_DIR: path.join(tmp, "state"),
+ AUTOFIX_LOG_ISSUE: "",
+ LINEAR_API_KEY: "lin_api_test",
+});
+delete process.env.AUTOFIX_DRY_RUN;
+
+const { triage } = await import("./triage.mjs");
+
+/** Triage one ticket with the given verdict; return the record and Linear queries. */
+async function triageWith(verdict) {
+ fs.writeFileSync(
+ output,
+ JSON.stringify({
+ type: "result",
+ structured_output: {
+ verdict,
+ confidence: 0.9,
+ reason: "because",
+ needs_windows: false,
+ size: "S",
+ affected_paths: [],
+ repro_plan: "",
+ comment: "",
+ },
+ }),
+ );
+ const record = {
+ id: "uuid",
+ identifier: "CITRO-1",
+ teamId: "team",
+ stage: "new",
+ history: [],
+ };
+ const queries = [];
+ const realFetch = globalThis.fetch;
+ globalThis.fetch = async (_url, init) => {
+ const { query } = JSON.parse(init.body);
+ queries.push(query);
+ return new Response(
+ JSON.stringify({
+ data: {
+ commentCreate: { success: true },
+ issueAddLabel: { success: true },
+ team: {
+ states: { nodes: [] },
+ labels: { nodes: [{ id: "l", name: "agent:skipped" }] },
+ },
+ },
+ }),
+ );
+ };
+ try {
+ await triage({ identifier: record.identifier, title: "t" }, record);
+ } finally {
+ globalThis.fetch = realFetch;
+ }
+ return { record, queries };
+}
+
+test("an unrelated ticket is skipped without any Linear request", async () => {
+ const { record, queries } = await triageWith("unrelated");
+ assert.equal(record.stage, "skipped");
+ assert.equal(record.triage.verdict, "unrelated");
+ assert.deepEqual(queries, []);
+});
+
+test("any other skip verdict still comments and labels the ticket", async () => {
+ const { record, queries } = await triageWith("browser_side");
+ assert.equal(record.stage, "skipped");
+ assert.ok(queries.some((q) => q.includes("commentCreate")));
+ assert.ok(queries.some((q) => q.includes("issueAddLabel")));
+});
diff --git a/tools/linear-autofix/src/triage.mjs b/tools/linear-autofix/src/triage.mjs
index 124de11..515d458 100644
--- a/tools/linear-autofix/src/triage.mjs
+++ b/tools/linear-autofix/src/triage.mjs
@@ -12,6 +12,7 @@ export const VERDICTS = Object.freeze([
"design_decision",
"duplicate",
"already_fixed",
+ "unrelated",
]);
export const TRIAGE_SCHEMA = {
@@ -123,6 +124,13 @@ export async function triage(issue, record) {
`${triageResult.verdict} (${triageResult.confidence.toFixed(2)}) ${triageResult.reason}`,
);
+ // Not an ego lite ticket: its team gets no comment and no label from the bot.
+ // The verdict stays visible in `status` and in the tick log.
+ if (triageResult.verdict === "unrelated") {
+ transition(record, "skipped", triageResult.verdict);
+ return triageResult;
+ }
+
await linear.comment(record, renderTriageComment(triageResult));
if (triageResult.verdict === "fix") {
await linear.addLabel(record, config.labels.fix);