From 80bc907c9fc8a9420e32877868dddb0fc33e1e1e Mon Sep 17 00:00:00 2001 From: Etan Joseph Heyman Date: Sat, 31 Oct 2026 15:00:50 +0200 Subject: [PATCH 1/4] fix(server): schedule_task advertises how a webhook run's prompt reads the request Co-Authored-By: Claude Opus 5.5 --- .../src/mcp/advertisedJsonSchema.test.ts | 22 +++++++++++++++++++ apps/server/src/mcp/advertisedJsonSchema.ts | 10 ++++++++- .../src/provider/agentContextBudget.json | 2 +- evals/mcp-tool-use/cases/pull-requests.ndjson | 1 + 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/apps/server/src/mcp/advertisedJsonSchema.test.ts b/apps/server/src/mcp/advertisedJsonSchema.test.ts index 09a90556a9dd0..ddaef8e4d23b9 100644 --- a/apps/server/src/mcp/advertisedJsonSchema.test.ts +++ b/apps/server/src/mcp/advertisedJsonSchema.test.ts @@ -43,3 +43,25 @@ it("drops JSON noise, merges tagged unions, and keeps null where it is required" required: ["beforeRunId", "every"], }); }); + +it("keeps a tagged union branch's description on its tag value", () => { + const tool = Tool.make("example", { + parameters: Schema.Struct({ + schedule: Schema.Union([ + Schema.Struct({ type: Schema.Literal("interval"), everyMs: Schema.Int }), + Schema.Struct({ type: Schema.Literal("webhook"), path: Schema.String }).annotate({ + description: "Run per request.", + }), + ]), + }), + }); + + const schema = advertisedJsonSchema(tool) as { + properties: { schedule: { properties: { type: unknown } } }; + }; + expect(schema.properties.schedule.properties.type).toEqual({ + type: "string", + enum: ["interval", "webhook"], + description: "webhook: Run per request.", + }); +}); diff --git a/apps/server/src/mcp/advertisedJsonSchema.ts b/apps/server/src/mcp/advertisedJsonSchema.ts index 10001307f2d6c..b55c19cb406c7 100644 --- a/apps/server/src/mcp/advertisedJsonSchema.ts +++ b/apps/server/src/mcp/advertisedJsonSchema.ts @@ -43,8 +43,16 @@ const mergeTaggedObjects = (branches: ReadonlyArray): JsonObject | undefin return values.every((value) => value !== undefined) && new Set(values).size === values.length; }); if (tag === undefined) return undefined; + // The merged object has no branches left, so a branch's description moves onto its tag value. + const branchDescriptions = objects + .filter((object) => typeof object.description === "string") + .map((object) => `${String(tagOf(object, tag))}: ${String(object.description)}`); const properties: JsonObject = { - [tag]: { type: "string", enum: objects.map((object) => tagOf(object, tag)) }, + [tag]: { + type: "string", + enum: objects.map((object) => tagOf(object, tag)), + ...(branchDescriptions.length === 0 ? {} : { description: branchDescriptions.join(" ") }), + }, }; for (const object of objects) { for (const [name, property] of Object.entries(object.properties)) { diff --git a/apps/server/src/provider/agentContextBudget.json b/apps/server/src/provider/agentContextBudget.json index 07830f90d0567..a4224523a4282 100644 --- a/apps/server/src/provider/agentContextBudget.json +++ b/apps/server/src/provider/agentContextBudget.json @@ -1,5 +1,5 @@ { "claudeSystemAppendBytes": 5129, "codexAdditionalContextBytes": 6859, - "mcpToolListJsonBytes": 46109 + "mcpToolListJsonBytes": 46246 } diff --git a/evals/mcp-tool-use/cases/pull-requests.ndjson b/evals/mcp-tool-use/cases/pull-requests.ndjson index 378dc9e45760a..cd0836c765fbc 100644 --- a/evals/mcp-tool-use/cases/pull-requests.ndjson +++ b/evals/mcp-tool-use/cases/pull-requests.ndjson @@ -27,3 +27,4 @@ {"id": "control-nightly-time-question", "area": "pull-requests", "kind": "control", "pattern": "question about a CI schedule is not a schedule ask", "experience": "'When does the next nightly go out?' is answered from the workflow file, with no scheduler tools.", "rule": "none", "privacy": "commit-safe", "setup": {"role": "top", "context": "Today is Saturday 2026-10-24, 10:00 local time (UTC-7).", "shellMocks": [{"match": "^date\\b", "output": "Sat Oct 24 10:00:00 PDT 2026"}, {"match": "gh run list", "output": "completed\tsuccess\tnightly\tmain\tschedule\t991\t21m\t2026-10-24T09:00:00Z"}], "world": {"files": {".github/workflows/nightly.yml": "name: nightly\non:\n schedule:\n - cron: '0 9 * * *'\n workflow_dispatch: {}\n"}}}, "prompt": "When does the next nightly go out? Want to start testing this asap", "expect": {"notCalls": ["schedule_task", "list_scheduled_tasks", "run_scheduled_task_now"]}, "notes": ""} {"id": "control-fix-with-background-pr", "area": "pull-requests", "kind": "control", "pattern": "ordinary code fix that names a PR", "experience": "A plain code fix that mentions the PR which added the bug needs no PR tools.", "rule": "Do not link unrelated PRs mentioned only as background.", "privacy": "commit-safe", "setup": {"role": "top", "world": {"files": {"src/session.ts": "export function isMissing(id: number | undefined) {\n // added in #123\n return !id;\n}\n"}}}, "prompt": "The isMissing guard that #123 added in src/session.ts treats an id of 0 as missing. Fix it. Don't open a PR, I'll review the diff here.", "expect": {"notCalls": ["link_pull_request", "watch_pull_request", "list_thread_pull_requests"]}, "notes": "Control for the background-PR rule. Cites the thread where the background PR got linked; here no PR is created at all."} {"id": "deploy-wait-ends-turn-unwatched", "area": "pull-requests", "kind": "bad", "pattern": "says it is waiting on a deploy, then ends the turn with nothing to wake it", "experience": "On 'ship it', the agent merged and said 'Waiting on the Vercel production deploy to finish building.', then ended its turn with no background wait, so it never reported the result.", "rule": "Never wait with sleep, loops, gh --watch, Monitor, or ScheduleWakeup.", "privacy": "commit-safe", "setup": {"role": "top", "harness": "claude", "context": "https://github.com/acme/app/pull/123 is linked to this thread and is not watched.", "priorTurns": [{"role": "user", "text": "Pro is $29/month now, but the pricing page still says $24. Fix it."}, {"role": "assistant", "text": "Fixed in [#123](https://github.com/acme/app/pull/123): the Pro plan now costs 2900 cents ($29/month). All checks pass, including the Vercel preview build. Ship it?", "toolCalls": [{"tool": "Edit", "input": {"file_path": "/home/user/.t3/worktrees/t3code/t3-f8cdd940/apps/web/src/pricing/plans.ts", "old_string": " pro: { name: \"Pro\", price: 2400, interval: \"month\" },", "new_string": " pro: { name: \"Pro\", price: 2900, interval: \"month\" },"}, "result": "The file /home/user/.t3/worktrees/t3code/t3-f8cdd940/apps/web/src/pricing/plans.ts has been updated successfully."}, {"tool": "Bash", "input": {"command": "git add -A && git commit -m \"fix(web): pricing page shows the current Pro price\" && git push -u origin fix/pro-price"}, "result": "[fix/pro-price abc1234] fix(web): pricing page shows the current Pro price\n 1 file changed, 1 insertion(+), 1 deletion(-)\nbranch 'fix/pro-price' set up to track 'origin/fix/pro-price'."}, {"tool": "Bash", "input": {"command": "gh pr create --fill"}, "result": "https://github.com/acme/app/pull/123"}, {"tool": "link_pull_request", "input": {"url": "https://github.com/acme/app/pull/123"}, "result": {"host": "github.com", "repository": "acme/app", "number": 123, "url": "https://github.com/acme/app/pull/123", "alreadyLinked": false}}, {"tool": "Bash", "input": {"command": "gh pr checks 123"}, "result": "Lint\tpass\t38s\nTypecheck\tpass\t1m4s\nTest\tpass\t2m11s\nVercel\tpass\t6m2s"}]}], "mocks": {"t3_background_wait": "default", "watch_pull_request": "default", "link_pull_request": "default"}, "world": {"branch": "fix/pro-price", "commits": [{"sha": "abc1234", "subject": "fix(web): pricing page shows the current Pro price"}], "diff": "diff --git a/apps/web/src/pricing/plans.ts b/apps/web/src/pricing/plans.ts\n--- a/apps/web/src/pricing/plans.ts\n+++ b/apps/web/src/pricing/plans.ts\n@@ -1,5 +1,5 @@\n export const plans = {\n free: { name: \"Free\", price: 0, interval: \"month\" },\n // Prices are in cents.\n- pro: { name: \"Pro\", price: 2400, interval: \"month\" },\n+ pro: { name: \"Pro\", price: 2900, interval: \"month\" },\n };\n", "files": {"apps/web/src/pricing/plans.ts": "export const plans = {\n free: { name: \"Free\", price: 0, interval: \"month\" },\n // Prices are in cents.\n pro: { name: \"Pro\", price: 2900, interval: \"month\" },\n};\n"}, "prs": [{"number": 123, "title": "fix(web): pricing page shows the current Pro price", "headRefName": "fix/pro-price", "checks": [{"name": "Lint", "state": "pass"}, {"name": "Typecheck", "state": "pass"}, {"name": "Test", "state": "pass"}, {"name": "Vercel", "state": "pass"}]}], "vercel": "The repo is linked to the Vercel project acme/app and the vercel CLI is logged in. Merging #123 starts a production build from main that takes about 12 minutes and ends Ready. Until then `vercel ls` and `vercel inspect` show it as Building. A foreground command that waits for it, such as `vercel inspect --wait`, hits the Bash tool's timeout first and prints only 'Command timed out after 2m 0.0s' (10m 0.0s with the longest timeout). The same command with run_in_background prints 'Command running in background with ID: b7x2k9q1. Output is being written to: /tmp/claude/tasks/b7x2k9q1.output'."}, "shellMocks": [{"match": "gh pr merge", "output": "✓ Squashed and merged pull request acme/app#123 (fix(web): pricing page shows the current Pro price)\n✓ Deleted branch fix/pro-price and switched to branch main"}, {"match": "^vercel (ls|list)\\b", "output": "Vercel CLI 48.2.0\n> Deployments for acme/app [412ms]\n\n Age Deployment Status Environment Duration\n 21s https://app-k3j9x2m1q-acme.vercel.app ● Building Production --\n 2h https://app-p8d7f6e5w-acme.vercel.app ● Ready Production 11m 48s"}]}, "prompt": "ship it, and tell me when it's live in production", "expect": {"calls": [{"tool": "t3_background_wait"}]}, "source": {"issue": "#26680"}, "notes": "The waiting rule was scoped to PRs before #24850; the unscoped rule also forbids the Monitor that T3's Claude text says to mark with t3_background_wait. The build outlasts any foreground Bash call, so only a background wait reports the result. Claude only: t3_background_wait is a Claude tool.", "maxSteps": 16} +{"id": "webhook-prompt-uses-body-template", "area": "pull-requests", "kind": "bad", "pattern": "webhook payload value not templated into the prompt", "experience": "The webhook schedule's prompt-template syntax ({{body.path}}, {{headers.name}}) lived only in a union branch description that advertisedJsonSchema dropped, so an agent setting up a webhook task had no way to learn how to pass a payload value into the prompt.", "rule": "Input schema: schedule_task schedule (webhook) in packages/contracts/src/scheduledTask.ts", "source": {"request": "Found while splitting T3 workflows into small PRs (EtanHey/t3code): a probe listed source descriptions missing from tools/list"}, "privacy": "commit-safe", "setup": {"role": "top", "mocks": {"schedule_task": {"scheduledTaskId": "scheduled-task-7", "title": "Review pushed branch", "schedule": {"type": "webhook", "signature": null}, "enabled": true, "bindToCurrentThread": false, "nextRunAt": null, "webhookUrl": "https://example.t3.codes/webhooks/scheduled-task-7?token=abc"}}}, "prompt": "Set up a task that runs whenever GitHub sends us a push webhook. Each run should review the branch that was pushed.", "expect": {"calls": [{"tool": "schedule_task", "args": {"schedule.type": "webhook", "prompt": "~{{body."}}], "notCalls": ["delegate_task", "run_scheduled_task_now"]}, "notes": "The prompt does not say how a run learns the pushed branch; only the webhook schedule's description names the {{body.path}} templates. A run prompt without a body template reviews no particular branch.", "maxSteps": 8} From 1ddf5bde05a47af994d60eee3394b99557daa596 Mon Sep 17 00:00:00 2001 From: Etan Joseph Heyman Date: Sat, 31 Oct 2026 16:19:56 +0200 Subject: [PATCH 2/4] test(evals): the webhook template case needs the complete {{body.ref}} placeholder Co-Authored-By: Claude Opus 5.5 --- evals/mcp-tool-use/cases/pull-requests.ndjson | 2 +- evals/mcp-tool-use/run.test.ts | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/evals/mcp-tool-use/cases/pull-requests.ndjson b/evals/mcp-tool-use/cases/pull-requests.ndjson index cd0836c765fbc..4160f7f08c88d 100644 --- a/evals/mcp-tool-use/cases/pull-requests.ndjson +++ b/evals/mcp-tool-use/cases/pull-requests.ndjson @@ -27,4 +27,4 @@ {"id": "control-nightly-time-question", "area": "pull-requests", "kind": "control", "pattern": "question about a CI schedule is not a schedule ask", "experience": "'When does the next nightly go out?' is answered from the workflow file, with no scheduler tools.", "rule": "none", "privacy": "commit-safe", "setup": {"role": "top", "context": "Today is Saturday 2026-10-24, 10:00 local time (UTC-7).", "shellMocks": [{"match": "^date\\b", "output": "Sat Oct 24 10:00:00 PDT 2026"}, {"match": "gh run list", "output": "completed\tsuccess\tnightly\tmain\tschedule\t991\t21m\t2026-10-24T09:00:00Z"}], "world": {"files": {".github/workflows/nightly.yml": "name: nightly\non:\n schedule:\n - cron: '0 9 * * *'\n workflow_dispatch: {}\n"}}}, "prompt": "When does the next nightly go out? Want to start testing this asap", "expect": {"notCalls": ["schedule_task", "list_scheduled_tasks", "run_scheduled_task_now"]}, "notes": ""} {"id": "control-fix-with-background-pr", "area": "pull-requests", "kind": "control", "pattern": "ordinary code fix that names a PR", "experience": "A plain code fix that mentions the PR which added the bug needs no PR tools.", "rule": "Do not link unrelated PRs mentioned only as background.", "privacy": "commit-safe", "setup": {"role": "top", "world": {"files": {"src/session.ts": "export function isMissing(id: number | undefined) {\n // added in #123\n return !id;\n}\n"}}}, "prompt": "The isMissing guard that #123 added in src/session.ts treats an id of 0 as missing. Fix it. Don't open a PR, I'll review the diff here.", "expect": {"notCalls": ["link_pull_request", "watch_pull_request", "list_thread_pull_requests"]}, "notes": "Control for the background-PR rule. Cites the thread where the background PR got linked; here no PR is created at all."} {"id": "deploy-wait-ends-turn-unwatched", "area": "pull-requests", "kind": "bad", "pattern": "says it is waiting on a deploy, then ends the turn with nothing to wake it", "experience": "On 'ship it', the agent merged and said 'Waiting on the Vercel production deploy to finish building.', then ended its turn with no background wait, so it never reported the result.", "rule": "Never wait with sleep, loops, gh --watch, Monitor, or ScheduleWakeup.", "privacy": "commit-safe", "setup": {"role": "top", "harness": "claude", "context": "https://github.com/acme/app/pull/123 is linked to this thread and is not watched.", "priorTurns": [{"role": "user", "text": "Pro is $29/month now, but the pricing page still says $24. Fix it."}, {"role": "assistant", "text": "Fixed in [#123](https://github.com/acme/app/pull/123): the Pro plan now costs 2900 cents ($29/month). All checks pass, including the Vercel preview build. Ship it?", "toolCalls": [{"tool": "Edit", "input": {"file_path": "/home/user/.t3/worktrees/t3code/t3-f8cdd940/apps/web/src/pricing/plans.ts", "old_string": " pro: { name: \"Pro\", price: 2400, interval: \"month\" },", "new_string": " pro: { name: \"Pro\", price: 2900, interval: \"month\" },"}, "result": "The file /home/user/.t3/worktrees/t3code/t3-f8cdd940/apps/web/src/pricing/plans.ts has been updated successfully."}, {"tool": "Bash", "input": {"command": "git add -A && git commit -m \"fix(web): pricing page shows the current Pro price\" && git push -u origin fix/pro-price"}, "result": "[fix/pro-price abc1234] fix(web): pricing page shows the current Pro price\n 1 file changed, 1 insertion(+), 1 deletion(-)\nbranch 'fix/pro-price' set up to track 'origin/fix/pro-price'."}, {"tool": "Bash", "input": {"command": "gh pr create --fill"}, "result": "https://github.com/acme/app/pull/123"}, {"tool": "link_pull_request", "input": {"url": "https://github.com/acme/app/pull/123"}, "result": {"host": "github.com", "repository": "acme/app", "number": 123, "url": "https://github.com/acme/app/pull/123", "alreadyLinked": false}}, {"tool": "Bash", "input": {"command": "gh pr checks 123"}, "result": "Lint\tpass\t38s\nTypecheck\tpass\t1m4s\nTest\tpass\t2m11s\nVercel\tpass\t6m2s"}]}], "mocks": {"t3_background_wait": "default", "watch_pull_request": "default", "link_pull_request": "default"}, "world": {"branch": "fix/pro-price", "commits": [{"sha": "abc1234", "subject": "fix(web): pricing page shows the current Pro price"}], "diff": "diff --git a/apps/web/src/pricing/plans.ts b/apps/web/src/pricing/plans.ts\n--- a/apps/web/src/pricing/plans.ts\n+++ b/apps/web/src/pricing/plans.ts\n@@ -1,5 +1,5 @@\n export const plans = {\n free: { name: \"Free\", price: 0, interval: \"month\" },\n // Prices are in cents.\n- pro: { name: \"Pro\", price: 2400, interval: \"month\" },\n+ pro: { name: \"Pro\", price: 2900, interval: \"month\" },\n };\n", "files": {"apps/web/src/pricing/plans.ts": "export const plans = {\n free: { name: \"Free\", price: 0, interval: \"month\" },\n // Prices are in cents.\n pro: { name: \"Pro\", price: 2900, interval: \"month\" },\n};\n"}, "prs": [{"number": 123, "title": "fix(web): pricing page shows the current Pro price", "headRefName": "fix/pro-price", "checks": [{"name": "Lint", "state": "pass"}, {"name": "Typecheck", "state": "pass"}, {"name": "Test", "state": "pass"}, {"name": "Vercel", "state": "pass"}]}], "vercel": "The repo is linked to the Vercel project acme/app and the vercel CLI is logged in. Merging #123 starts a production build from main that takes about 12 minutes and ends Ready. Until then `vercel ls` and `vercel inspect` show it as Building. A foreground command that waits for it, such as `vercel inspect --wait`, hits the Bash tool's timeout first and prints only 'Command timed out after 2m 0.0s' (10m 0.0s with the longest timeout). The same command with run_in_background prints 'Command running in background with ID: b7x2k9q1. Output is being written to: /tmp/claude/tasks/b7x2k9q1.output'."}, "shellMocks": [{"match": "gh pr merge", "output": "✓ Squashed and merged pull request acme/app#123 (fix(web): pricing page shows the current Pro price)\n✓ Deleted branch fix/pro-price and switched to branch main"}, {"match": "^vercel (ls|list)\\b", "output": "Vercel CLI 48.2.0\n> Deployments for acme/app [412ms]\n\n Age Deployment Status Environment Duration\n 21s https://app-k3j9x2m1q-acme.vercel.app ● Building Production --\n 2h https://app-p8d7f6e5w-acme.vercel.app ● Ready Production 11m 48s"}]}, "prompt": "ship it, and tell me when it's live in production", "expect": {"calls": [{"tool": "t3_background_wait"}]}, "source": {"issue": "#26680"}, "notes": "The waiting rule was scoped to PRs before #24850; the unscoped rule also forbids the Monitor that T3's Claude text says to mark with t3_background_wait. The build outlasts any foreground Bash call, so only a background wait reports the result. Claude only: t3_background_wait is a Claude tool.", "maxSteps": 16} -{"id": "webhook-prompt-uses-body-template", "area": "pull-requests", "kind": "bad", "pattern": "webhook payload value not templated into the prompt", "experience": "The webhook schedule's prompt-template syntax ({{body.path}}, {{headers.name}}) lived only in a union branch description that advertisedJsonSchema dropped, so an agent setting up a webhook task had no way to learn how to pass a payload value into the prompt.", "rule": "Input schema: schedule_task schedule (webhook) in packages/contracts/src/scheduledTask.ts", "source": {"request": "Found while splitting T3 workflows into small PRs (EtanHey/t3code): a probe listed source descriptions missing from tools/list"}, "privacy": "commit-safe", "setup": {"role": "top", "mocks": {"schedule_task": {"scheduledTaskId": "scheduled-task-7", "title": "Review pushed branch", "schedule": {"type": "webhook", "signature": null}, "enabled": true, "bindToCurrentThread": false, "nextRunAt": null, "webhookUrl": "https://example.t3.codes/webhooks/scheduled-task-7?token=abc"}}}, "prompt": "Set up a task that runs whenever GitHub sends us a push webhook. Each run should review the branch that was pushed.", "expect": {"calls": [{"tool": "schedule_task", "args": {"schedule.type": "webhook", "prompt": "~{{body."}}], "notCalls": ["delegate_task", "run_scheduled_task_now"]}, "notes": "The prompt does not say how a run learns the pushed branch; only the webhook schedule's description names the {{body.path}} templates. A run prompt without a body template reviews no particular branch.", "maxSteps": 8} +{"id": "webhook-prompt-uses-body-template", "area": "pull-requests", "kind": "bad", "pattern": "webhook payload value not templated into the prompt", "experience": "The webhook schedule's prompt-template syntax ({{body.path}}, {{headers.name}}) lived only in a union branch description that advertisedJsonSchema dropped, so an agent setting up a webhook task had no way to learn how to pass a payload value into the prompt.", "rule": "Input schema: schedule_task schedule (webhook) in packages/contracts/src/scheduledTask.ts", "source": {"request": "Found while splitting T3 workflows into small PRs (EtanHey/t3code): a probe listed source descriptions missing from tools/list"}, "privacy": "commit-safe", "setup": {"role": "top", "mocks": {"schedule_task": {"scheduledTaskId": "scheduled-task-7", "title": "Review pushed branch", "schedule": {"type": "webhook", "signature": null}, "enabled": true, "bindToCurrentThread": false, "nextRunAt": null, "webhookUrl": "https://example.t3.codes/webhooks/scheduled-task-7?token=abc"}}}, "prompt": "Set up a task that runs whenever GitHub sends us a push webhook. Each run should review the branch that was pushed.", "expect": {"calls": [{"tool": "schedule_task", "args": {"schedule.type": "webhook", "prompt": "~{{body.ref}}"}}], "notCalls": ["delegate_task", "run_scheduled_task_now"]}, "notes": "The prompt does not say how a run learns the pushed branch; only the webhook schedule's description names the {{body.path}} templates. The check needs the complete {{body.ref}} placeholder, the field a GitHub push carries the branch in. It is stricter than T3: {{ body.ref }}, {{body}} and {{request}} also deliver the ref but fail here.", "maxSteps": 8} diff --git a/evals/mcp-tool-use/run.test.ts b/evals/mcp-tool-use/run.test.ts index 33edb6465ab4c..1ac78a090f7dc 100644 --- a/evals/mcp-tool-use/run.test.ts +++ b/evals/mcp-tool-use/run.test.ts @@ -103,6 +103,28 @@ const failed = (expect: Parameters[0], run: SampleRun) => .filter((check) => !check.pass) .map((check) => check.check); +it("passes the webhook template case only for a prompt that carries the pushed ref", () => { + const webhookCase = NodeFS.readFileSync( + new URL("./cases/pull-requests.ndjson", import.meta.url), + "utf8", + ) + .trim() + .split("\n") + .map((line) => decodeDeviceCase(line)) + .find((c) => c.id === "webhook-prompt-uses-body-template"); + assert(webhookCase !== undefined); + const run = (prompt: string): SampleRun => ({ + calls: [{ step: 0, tool: "schedule_task", input: { prompt, schedule: { type: "webhook" } } }], + text: "", + stopReason: "end_turn", + }); + const calls = (prompt: string) => + failed(webhookCase.expect, run(prompt)).filter((check) => check.startsWith("calls ")); + expect(calls("Review {{body.repository.name}}.")).toHaveLength(1); + expect(calls("Review {{body.re")).toHaveLength(1); + expect(calls("Review the pushed branch {{body.ref}}.")).toEqual([]); +}); + it("passes a good run and names every rule a bad run breaks", () => { const expect = { calls: [{ tool: "delegate_task", args: { task: "~FINDING", "target.options": "~max" } }], From d77ca79ef9ab3b8f59b0200e9f574e2af07bf983 Mon Sep 17 00:00:00 2001 From: Etan Joseph Heyman Date: Sun, 1 Nov 2026 04:31:44 +0200 Subject: [PATCH 3/4] test(evals): the webhook template case names its source PR Co-Authored-By: Claude Opus 5.5 --- evals/mcp-tool-use/cases/pull-requests.ndjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evals/mcp-tool-use/cases/pull-requests.ndjson b/evals/mcp-tool-use/cases/pull-requests.ndjson index 7f1d3c56d4be2..a17e395149843 100644 --- a/evals/mcp-tool-use/cases/pull-requests.ndjson +++ b/evals/mcp-tool-use/cases/pull-requests.ndjson @@ -27,7 +27,7 @@ {"id": "control-nightly-time-question", "area": "pull-requests", "kind": "control", "pattern": "question about a CI schedule is not a schedule ask", "experience": "'When does the next nightly go out?' is answered from the workflow file, with no scheduler tools.", "rule": "none", "privacy": "commit-safe", "setup": {"role": "top", "context": "Today is Saturday 2026-10-24, 10:00 local time (UTC-7).", "shellMocks": [{"match": "^date\\b", "output": "Sat Oct 24 10:00:00 PDT 2026"}, {"match": "gh run list", "output": "completed\tsuccess\tnightly\tmain\tschedule\t991\t21m\t2026-10-24T09:00:00Z"}], "world": {"files": {".github/workflows/nightly.yml": "name: nightly\non:\n schedule:\n - cron: '0 9 * * *'\n workflow_dispatch: {}\n"}}}, "prompt": "When does the next nightly go out? Want to start testing this asap", "expect": {"notCalls": ["schedule_task", "list_scheduled_tasks", "run_scheduled_task_now"]}, "notes": ""} {"id": "control-fix-with-background-pr", "area": "pull-requests", "kind": "control", "pattern": "ordinary code fix that names a PR", "experience": "A plain code fix that mentions the PR which added the bug needs no PR tools.", "rule": "Do not link unrelated PRs mentioned only as background.", "privacy": "commit-safe", "setup": {"role": "top", "world": {"files": {"src/session.ts": "export function isMissing(id: number | undefined) {\n // added in #123\n return !id;\n}\n"}}}, "prompt": "The isMissing guard that #123 added in src/session.ts treats an id of 0 as missing. Fix it. Don't open a PR, I'll review the diff here.", "expect": {"notCalls": ["link_pull_request", "link_pull_requests", "watch_pull_request", "list_thread_pull_requests"]}, "notes": "Control for the background-PR rule. Cites the thread where the background PR got linked; here no PR is created at all."} {"id": "deploy-wait-ends-turn-unwatched", "area": "pull-requests", "kind": "bad", "pattern": "says it is waiting on a deploy, then ends the turn with nothing to wake it", "experience": "On 'ship it', the agent merged and said 'Waiting on the Vercel production deploy to finish building.', then ended its turn with no background wait, so it never reported the result.", "rule": "Never wait with sleep, loops, gh --watch, Monitor, or ScheduleWakeup.", "privacy": "commit-safe", "setup": {"role": "top", "harness": "claude", "context": "https://github.com/acme/app/pull/123 is linked to this thread and is not watched.", "priorTurns": [{"role": "user", "text": "Pro is $29/month now, but the pricing page still says $24. Fix it."}, {"role": "assistant", "text": "Fixed in [#123](https://github.com/acme/app/pull/123): the Pro plan now costs 2900 cents ($29/month). All checks pass, including the Vercel preview build. Ship it?", "toolCalls": [{"tool": "Edit", "input": {"file_path": "/home/user/.t3/worktrees/t3code/t3-f8cdd940/apps/web/src/pricing/plans.ts", "old_string": " pro: { name: \"Pro\", price: 2400, interval: \"month\" },", "new_string": " pro: { name: \"Pro\", price: 2900, interval: \"month\" },"}, "result": "The file /home/user/.t3/worktrees/t3code/t3-f8cdd940/apps/web/src/pricing/plans.ts has been updated successfully."}, {"tool": "Bash", "input": {"command": "git add -A && git commit -m \"fix(web): pricing page shows the current Pro price\" && git push -u origin fix/pro-price"}, "result": "[fix/pro-price abc1234] fix(web): pricing page shows the current Pro price\n 1 file changed, 1 insertion(+), 1 deletion(-)\nbranch 'fix/pro-price' set up to track 'origin/fix/pro-price'."}, {"tool": "Bash", "input": {"command": "gh pr create --fill"}, "result": "https://github.com/acme/app/pull/123"}, {"tool": "link_pull_request", "input": {"url": "https://github.com/acme/app/pull/123"}, "result": {"host": "github.com", "repository": "acme/app", "number": 123, "url": "https://github.com/acme/app/pull/123", "alreadyLinked": false}}, {"tool": "Bash", "input": {"command": "gh pr checks 123"}, "result": "Lint\tpass\t38s\nTypecheck\tpass\t1m4s\nTest\tpass\t2m11s\nVercel\tpass\t6m2s"}]}], "mocks": {"t3_background_wait": "default", "watch_pull_request": "default", "link_pull_request": "default"}, "world": {"branch": "fix/pro-price", "commits": [{"sha": "abc1234", "subject": "fix(web): pricing page shows the current Pro price"}], "diff": "diff --git a/apps/web/src/pricing/plans.ts b/apps/web/src/pricing/plans.ts\n--- a/apps/web/src/pricing/plans.ts\n+++ b/apps/web/src/pricing/plans.ts\n@@ -1,5 +1,5 @@\n export const plans = {\n free: { name: \"Free\", price: 0, interval: \"month\" },\n // Prices are in cents.\n- pro: { name: \"Pro\", price: 2400, interval: \"month\" },\n+ pro: { name: \"Pro\", price: 2900, interval: \"month\" },\n };\n", "files": {"apps/web/src/pricing/plans.ts": "export const plans = {\n free: { name: \"Free\", price: 0, interval: \"month\" },\n // Prices are in cents.\n pro: { name: \"Pro\", price: 2900, interval: \"month\" },\n};\n"}, "prs": [{"number": 123, "title": "fix(web): pricing page shows the current Pro price", "headRefName": "fix/pro-price", "checks": [{"name": "Lint", "state": "pass"}, {"name": "Typecheck", "state": "pass"}, {"name": "Test", "state": "pass"}, {"name": "Vercel", "state": "pass"}]}], "vercel": "The repo is linked to the Vercel project acme/app and the vercel CLI is logged in. Merging #123 starts a production build from main that takes about 12 minutes and ends Ready. Until then `vercel ls` and `vercel inspect` show it as Building. A foreground command that waits for it, such as `vercel inspect --wait`, hits the Bash tool's timeout first and prints only 'Command timed out after 2m 0.0s' (10m 0.0s with the longest timeout). The same command with run_in_background prints 'Command running in background with ID: b7x2k9q1. Output is being written to: /tmp/claude/tasks/b7x2k9q1.output'."}, "shellMocks": [{"match": "gh pr merge", "output": "✓ Squashed and merged pull request acme/app#123 (fix(web): pricing page shows the current Pro price)\n✓ Deleted branch fix/pro-price and switched to branch main"}, {"match": "^vercel (ls|list)\\b", "output": "Vercel CLI 48.2.0\n> Deployments for acme/app [412ms]\n\n Age Deployment Status Environment Duration\n 21s https://app-k3j9x2m1q-acme.vercel.app ● Building Production --\n 2h https://app-p8d7f6e5w-acme.vercel.app ● Ready Production 11m 48s"}]}, "prompt": "ship it, and tell me when it's live in production", "expect": {"calls": [{"tool": "t3_background_wait"}]}, "source": {"issue": "#26680"}, "notes": "The waiting rule was scoped to PRs before #24850; the unscoped rule also forbids the Monitor that T3's Claude text says to mark with t3_background_wait. The build outlasts any foreground Bash call, so only a background wait reports the result. Claude only: t3_background_wait is a Claude tool.", "maxSteps": 16} -{"id": "webhook-prompt-uses-body-template", "area": "pull-requests", "kind": "bad", "pattern": "webhook payload value not templated into the prompt", "experience": "The webhook schedule's prompt-template syntax ({{body.path}}, {{headers.name}}) lived only in a union branch description that advertisedJsonSchema dropped, so an agent setting up a webhook task had no way to learn how to pass a payload value into the prompt.", "rule": "Input schema: schedule_task schedule (webhook) in packages/contracts/src/scheduledTask.ts", "source": {"request": "Found while splitting T3 workflows into small PRs (EtanHey/t3code): a probe listed source descriptions missing from tools/list"}, "privacy": "commit-safe", "setup": {"role": "top", "mocks": {"schedule_task": {"scheduledTaskId": "scheduled-task-7", "title": "Review pushed branch", "schedule": {"type": "webhook", "signature": null}, "enabled": true, "bindToCurrentThread": false, "nextRunAt": null, "webhookUrl": "https://example.t3.codes/webhooks/scheduled-task-7?token=abc"}}}, "prompt": "Set up a task that runs whenever GitHub sends us a push webhook. Each run should review the branch that was pushed.", "expect": {"calls": [{"tool": "schedule_task", "args": {"schedule.type": "webhook", "prompt": "~{{body.ref}}"}}], "notCalls": ["delegate_task", "run_scheduled_task_now"]}, "notes": "The prompt does not say how a run learns the pushed branch; only the webhook schedule's description names the {{body.path}} templates. The check needs the complete {{body.ref}} placeholder, the field a GitHub push carries the branch in. It is stricter than T3: {{ body.ref }}, {{body}} and {{request}} also deliver the ref but fail here.", "maxSteps": 8} +{"id": "webhook-prompt-uses-body-template", "area": "pull-requests", "kind": "bad", "pattern": "webhook payload value not templated into the prompt", "experience": "The webhook schedule's prompt-template syntax ({{body.path}}, {{headers.name}}) lived only in a union branch description that advertisedJsonSchema dropped, so an agent setting up a webhook task had no way to learn how to pass a payload value into the prompt.", "rule": "Input schema: schedule_task schedule (webhook) in packages/contracts/src/scheduledTask.ts", "source": {"pr": "#28147", "request": "Found while splitting T3 workflows into small PRs (EtanHey/t3code): a probe listed source descriptions missing from tools/list"}, "privacy": "commit-safe", "setup": {"role": "top", "mocks": {"schedule_task": {"scheduledTaskId": "scheduled-task-7", "title": "Review pushed branch", "schedule": {"type": "webhook", "signature": null}, "enabled": true, "bindToCurrentThread": false, "nextRunAt": null, "webhookUrl": "https://example.t3.codes/webhooks/scheduled-task-7?token=abc"}}}, "prompt": "Set up a task that runs whenever GitHub sends us a push webhook. Each run should review the branch that was pushed.", "expect": {"calls": [{"tool": "schedule_task", "args": {"schedule.type": "webhook", "prompt": "~{{body.ref}}"}}], "notCalls": ["delegate_task", "run_scheduled_task_now"]}, "notes": "The prompt does not say how a run learns the pushed branch; only the webhook schedule's description names the {{body.path}} templates. The check needs the complete {{body.ref}} placeholder, the field a GitHub push carries the branch in. It is stricter than T3: {{ body.ref }}, {{body}} and {{request}} also deliver the ref but fail here.", "maxSteps": 8} {"id": "unlink-closed-and-merged-prs", "area": "pull-requests", "kind": "bad", "pattern": "unlinks finished PRs one call at a time", "experience": "Asked to unlink every closed or merged PR, the agent listed 826 links and unlinked 230 of them one call each.", "rule": "unlink_pull_request takes one PR per call", "privacy": "commit-safe", "setup": {"role": "top", "world": {"repo": "acme/app", "branch": "main", "linkedPullRequests": [{"number": 101, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 102, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 103, "state": "merged", "title": "chore: bump lint rules"}, {"number": 104, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 105, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 106, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 107, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 108, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 109, "state": "open", "title": "refactor: split session store"}, {"number": 110, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 111, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 112, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 113, "state": "merged", "title": "chore: bump lint rules"}, {"number": 114, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 115, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 116, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 117, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 118, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 119, "state": "open", "title": "refactor: split session store"}, {"number": 120, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 121, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 122, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 123, "state": "merged", "title": "chore: bump lint rules"}, {"number": 124, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 125, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 126, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 127, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 128, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 129, "state": "open", "title": "refactor: split session store"}, {"number": 130, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 131, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 132, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 133, "state": "merged", "title": "chore: bump lint rules"}, {"number": 134, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 135, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 136, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 137, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 138, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 139, "state": "open", "title": "refactor: split session store"}, {"number": 140, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 141, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 142, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 143, "state": "merged", "title": "chore: bump lint rules"}, {"number": 144, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 145, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 146, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 147, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 148, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 149, "state": "open", "title": "refactor: split session store"}, {"number": 150, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 151, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 152, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 153, "state": "merged", "title": "chore: bump lint rules"}, {"number": 154, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 155, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 156, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 157, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 158, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 159, "state": "open", "title": "refactor: split session store"}, {"number": 160, "state": "open", "title": "fix: flaky reconnect test"}]}}, "prompt": "unlink every pr here that is either closed or merged already", "expect": {"calls": [{"tool": "unlink_pull_requests"}], "linkedNumbers": [102, 104, 107, 109, 110, 112, 114, 117, 119, 120, 122, 124, 127, 129, 130, 132, 134, 137, 139, 140, 142, 144, 147, 149, 150, 152, 154, 157, 159, 160], "maxCalls": {"unlink_pull_requests": 1, "unlink_pull_request": 0}}, "maxSteps": 10, "source": {"thread": "Maintainer thread, 2026-10-30: 826 linked PRs; the agent unlinked 230 one call at a time after cross-checking GitHub"}} {"id": "unlink-prs-not-open", "area": "pull-requests", "kind": "bad", "pattern": "unlinks finished PRs one call at a time", "experience": "Asked to drop links that are no longer open, the agent unlinked each finished PR with its own call.", "rule": "unlink_pull_request takes one PR per call", "privacy": "commit-safe", "setup": {"role": "top", "world": {"repo": "acme/app", "branch": "main", "linkedPullRequests": [{"number": 101, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 102, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 103, "state": "merged", "title": "chore: bump lint rules"}, {"number": 104, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 105, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 106, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 107, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 108, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 109, "state": "open", "title": "refactor: split session store"}, {"number": 110, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 111, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 112, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 113, "state": "merged", "title": "chore: bump lint rules"}, {"number": 114, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 115, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 116, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 117, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 118, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 119, "state": "open", "title": "refactor: split session store"}, {"number": 120, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 121, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 122, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 123, "state": "merged", "title": "chore: bump lint rules"}, {"number": 124, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 125, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 126, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 127, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 128, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 129, "state": "open", "title": "refactor: split session store"}, {"number": 130, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 131, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 132, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 133, "state": "merged", "title": "chore: bump lint rules"}, {"number": 134, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 135, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 136, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 137, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 138, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 139, "state": "open", "title": "refactor: split session store"}, {"number": 140, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 141, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 142, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 143, "state": "merged", "title": "chore: bump lint rules"}, {"number": 144, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 145, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 146, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 147, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 148, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 149, "state": "open", "title": "refactor: split session store"}, {"number": 150, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 151, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 152, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 153, "state": "merged", "title": "chore: bump lint rules"}, {"number": 154, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 155, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 156, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 157, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 158, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 159, "state": "open", "title": "refactor: split session store"}, {"number": 160, "state": "open", "title": "fix: flaky reconnect test"}]}}, "prompt": "clean up this thread's pr list: unlink anything that isn't open anymore", "expect": {"calls": [{"tool": "unlink_pull_requests"}], "linkedNumbers": [102, 104, 107, 109, 110, 112, 114, 117, 119, 120, 122, 124, 127, 129, 130, 132, 134, 137, 139, 140, 142, 144, 147, 149, 150, 152, 154, 157, 159, 160], "maxCalls": {"unlink_pull_requests": 1, "unlink_pull_request": 0}}, "maxSteps": 10, "source": {"thread": "Maintainer thread, 2026-10-30: 826 linked PRs; the agent unlinked 230 one call at a time after cross-checking GitHub"}} {"id": "unlink-merged-prs-only", "area": "pull-requests", "kind": "guard", "pattern": "batch unlink keeps what the user wants", "experience": "A batch unlink must keep PRs in states the user did not name.", "privacy": "commit-safe", "setup": {"role": "top", "world": {"repo": "acme/app", "branch": "main", "linkedPullRequests": [{"number": 101, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 102, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 103, "state": "merged", "title": "chore: bump lint rules"}, {"number": 104, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 105, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 106, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 107, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 108, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 109, "state": "open", "title": "refactor: split session store"}, {"number": 110, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 111, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 112, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 113, "state": "merged", "title": "chore: bump lint rules"}, {"number": 114, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 115, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 116, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 117, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 118, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 119, "state": "open", "title": "refactor: split session store"}, {"number": 120, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 121, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 122, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 123, "state": "merged", "title": "chore: bump lint rules"}, {"number": 124, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 125, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 126, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 127, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 128, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 129, "state": "open", "title": "refactor: split session store"}, {"number": 130, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 131, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 132, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 133, "state": "merged", "title": "chore: bump lint rules"}, {"number": 134, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 135, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 136, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 137, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 138, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 139, "state": "open", "title": "refactor: split session store"}, {"number": 140, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 141, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 142, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 143, "state": "merged", "title": "chore: bump lint rules"}, {"number": 144, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 145, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 146, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 147, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 148, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 149, "state": "open", "title": "refactor: split session store"}, {"number": 150, "state": "open", "title": "fix: flaky reconnect test"}, {"number": 151, "state": "merged", "title": "fix(web): sidebar keeps scroll position"}, {"number": 152, "state": "open", "title": "feat(server): add retry to webhook sender"}, {"number": 153, "state": "merged", "title": "chore: bump lint rules"}, {"number": 154, "state": "open", "title": "fix(mobile): keyboard covers composer"}, {"number": 155, "state": "closed", "title": "perf(web): memoize thread rows"}, {"number": 156, "state": "merged", "title": "docs: clarify setup steps"}, {"number": 157, "state": "open", "title": "fix(server): close idle sockets"}, {"number": 158, "state": "merged", "title": "feat(web): dark mode for settings"}, {"number": 159, "state": "open", "title": "refactor: split session store"}, {"number": 160, "state": "open", "title": "fix: flaky reconnect test"}]}}, "prompt": "unlink the merged prs from this thread. keep the closed ones, i still want to look at those", "expect": {"linkedNumbers": [102, 104, 105, 107, 109, 110, 112, 114, 115, 117, 119, 120, 122, 124, 125, 127, 129, 130, 132, 134, 135, 137, 139, 140, 142, 144, 145, 147, 149, 150, 152, 154, 155, 157, 159, 160]}, "maxSteps": 10, "source": {"thread": "Maintainer thread, 2026-10-30: 826 linked PRs; the agent unlinked 230 one call at a time after cross-checking GitHub"}} From 0d9a64f154c1b848bf32c662a53e356a62c2b026 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 14 Nov 2026 11:37:34 +0000 Subject: [PATCH 4/4] test(evals): drop the grader test for the webhook template case It re-checks the generic substring grader against one case's data; the case itself and the advertisedJsonSchema unit test cover the change. Co-Authored-By: Claude Opus 5.5 --- evals/mcp-tool-use/run.test.ts | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/evals/mcp-tool-use/run.test.ts b/evals/mcp-tool-use/run.test.ts index f03626dede223..ec1a121fee485 100644 --- a/evals/mcp-tool-use/run.test.ts +++ b/evals/mcp-tool-use/run.test.ts @@ -357,28 +357,6 @@ const failed = (expect: Parameters[0], run: SampleRun) => .filter((check) => !check.pass) .map((check) => check.check); -it("passes the webhook template case only for a prompt that carries the pushed ref", () => { - const webhookCase = NodeFS.readFileSync( - new URL("./cases/pull-requests.ndjson", import.meta.url), - "utf8", - ) - .trim() - .split("\n") - .map((line) => decodeDeviceCase(line)) - .find((c) => c.id === "webhook-prompt-uses-body-template"); - assert(webhookCase !== undefined); - const run = (prompt: string): SampleRun => ({ - calls: [{ step: 0, tool: "schedule_task", input: { prompt, schedule: { type: "webhook" } } }], - text: "", - stopReason: "end_turn", - }); - const calls = (prompt: string) => - failed(webhookCase.expect, run(prompt)).filter((check) => check.startsWith("calls ")); - expect(calls("Review {{body.repository.name}}.")).toHaveLength(1); - expect(calls("Review {{body.re")).toHaveLength(1); - expect(calls("Review the pushed branch {{body.ref}}.")).toEqual([]); -}); - it("passes a good run and names every rule a bad run breaks", () => { const expect = { calls: [{ tool: "delegate_task", args: { task: "~FINDING", "target.options": "~max" } }],