From 92672834bce733f964e846eb1d5e34c0e00cd30d Mon Sep 17 00:00:00 2001
From: Julius Marminge
Date: Thu, 12 Nov 2026 07:42:41 +0000
Subject: [PATCH 1/2] fix(contracts): agents keep working after starting an
async delegate
A running delegate's `next` told every agent to end its turn, and agents
are told to follow it. Children with independent work in their brief
sometimes stopped and sat idle until the delegate finished.
`next` now says to continue other work and end the turn when none is
left, still forbidding waiting and polling. Adds an mcp-tool-use case
for a delegated child that has work left after delegate_task.
Fixes pingdotgg/t3code#27126
AI-assisted; verified with the tests and tools listed above.
---
evals/mcp-tool-use/cases/orchestration.ndjson | 1 +
.../cases/threads-vs-tasks.ndjson | 20 +++++++++----------
packages/contracts/src/orchestratorMcp.ts | 2 +-
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/evals/mcp-tool-use/cases/orchestration.ndjson b/evals/mcp-tool-use/cases/orchestration.ndjson
index 520bd2abf10d3..a89ff578d478d 100644
--- a/evals/mcp-tool-use/cases/orchestration.ndjson
+++ b/evals/mcp-tool-use/cases/orchestration.ndjson
@@ -40,3 +40,4 @@
{"id": "settle-after-delayed-merge-waits", "area": "orchestration", "kind": "guard", "pattern": "settle before delayed work finishes", "experience": "Asked to merge a PR once its checks pass and then settle this thread, an agent following the #26749 settle bullet can settle in the first turn; a settled thread refuses watch_pull_request and drops PR-watch wakes, so the merge never happens.", "rule": "Asked to settle ... a thread, including this one: call t3_thread_organize. (the request is to settle after the merge, not now)", "privacy": "commit-safe", "notes": "From the CodeRabbit finding on #26765. Settling this thread applies at turn end, and Orchestrator.ts rejects watch wakes on a settled thread. Good: watch #123 and end the turn without settling. gh pr merge --auto plus a settle would still lose the wake that confirms the merge.", "setup": {"role": "top", "priorTurns": [{"role": "user", "text": "Okay this looks good to me. Any risk merging it?"}, {"role": "assistant", "text": "Low risk. [#123](https://github.com/acme/app/pull/123) only adds an accessible title to the HTML preview frame, and the new test covers it. Two checks are still running: Check and Test Web.", "toolCalls": [{"tool": "Bash", "input": {"command": "gh pr view 123 --json title,files --jq '.title, .files[].path'"}, "result": "fix(web): HTML preview frame gets an accessible title\napps/web/src/HtmlPreview.tsx\napps/web/src/HtmlPreview.test.tsx"}, {"tool": "Bash", "input": {"command": "gh pr checks 123"}, "result": "Lint\tpass\t41s\nTypecheck\tpass\t1m2s\nCheck\tpending\t0\nTest Web\tpending\t0"}, {"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}}]}], "mocks": {"watch_pull_request": "default", "link_pull_request": "default", "t3_thread_organize": {"settlesWhenTurnEnds": true}}, "world": {"branch": "fix/html-preview-title", "commits": [{"sha": "abc1234", "subject": "fix(web): HTML preview frame gets an accessible title"}], "diff": "diff --git a/apps/web/src/HtmlPreview.tsx b/apps/web/src/HtmlPreview.tsx\n--- a/apps/web/src/HtmlPreview.tsx\n+++ b/apps/web/src/HtmlPreview.tsx\n@@ -1,3 +1,3 @@\n export function HtmlPreview({ html }: { html: string }) {\n- return ;\n+ return ;\n }\ndiff --git a/apps/web/src/HtmlPreview.test.tsx b/apps/web/src/HtmlPreview.test.tsx\nnew file mode 100644\n--- /dev/null\n+++ b/apps/web/src/HtmlPreview.test.tsx\n+import { expect, it } from 'vitest';\n+import { render, screen } from '@testing-library/react';\n+import { HtmlPreview } from './HtmlPreview';\n+\n+it('gives the preview frame an accessible name', () => {\n+ render(hi
\" />);\n+ expect(screen.getByTitle('HTML preview')).toBeTruthy();\n+});\n", "prs": [{"number": 123, "title": "fix(web): HTML preview frame gets an accessible title", "headRefName": "fix/html-preview-title", "checks": [{"name": "Lint", "state": "pass"}, {"name": "Typecheck", "state": "pass"}, {"name": "Check", "state": "pending"}, {"name": "Test Web", "state": "pending"}]}], "files": {"apps/web/src/HtmlPreview.tsx": "export function HtmlPreview({ html }: { html: string }) {\n return ;\n}\n", "apps/web/src/HtmlPreview.test.tsx": "import { expect, it } from 'vitest';\nimport { render, screen } from '@testing-library/react';\nimport { HtmlPreview } from './HtmlPreview';\n\nit('gives the preview frame an accessible name', () => {\n render(hi\" />);\n expect(screen.getByTitle('HTML preview')).toBeTruthy();\n});\n"}}, "shellMocks": [{"match": "gh pr merge", "output": "✓ Squashed and merged pull request acme/app#123 (fix(web): HTML preview frame gets an accessible title)"}]}, "prompt": "Merge it once its checks pass, then settle this thread.", "expect": {"calls": [{"tool": "watch_pull_request", "args": {"url": "~/pull/123"}}], "notCalls": ["t3_thread_organize", "Monitor", "ScheduleWakeup"], "shellMustNot": ["\\bsleep \\d", "gh pr checks[^\\n]*--watch", "gh run watch", "\\buntil\\b[^\\n]*\\bgh (pr|run|api)\\b", "pr-wait", "gh pr merge(?![^\\n]*--auto)"]}}
{"id": "settle-after-merge-on-wake", "area": "orchestration", "kind": "bad", "pattern": "settle read as plain English for finish", "experience": "Asked to merge a PR once its checks pass and then settle this thread, the agent merged on the checks-passed wake and ended the turn without calling t3_thread_organize (#26749).", "rule": "Asked to settle ... a thread, including this one: call t3_thread_organize.", "privacy": "commit-safe", "notes": "From #26749's delayed pattern. Wake text is copied from pullRequestWatch.ts. Good: merge #123, then settle this thread on the same turn.", "setup": {"role": "top", "priorTurns": [{"role": "user", "text": "Okay this looks good to me. Any risk merging it?"}, {"role": "assistant", "text": "Low risk. [#123](https://github.com/acme/app/pull/123) only adds an accessible title to the HTML preview frame, and the new test covers it. Two checks are still running: Check and Test Web.", "toolCalls": [{"tool": "Bash", "input": {"command": "gh pr view 123 --json title,files --jq '.title, .files[].path'"}, "result": "fix(web): HTML preview frame gets an accessible title\napps/web/src/HtmlPreview.tsx\napps/web/src/HtmlPreview.test.tsx"}, {"tool": "Bash", "input": {"command": "gh pr checks 123"}, "result": "Lint\tpass\t41s\nTypecheck\tpass\t1m2s\nCheck\tpending\t0\nTest Web\tpending\t0"}, {"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}}]}, {"role": "user", "text": "Merge it once its checks pass, then settle this thread."}, {"role": "assistant", "text": "T3 Code is watching [#123](https://github.com/acme/app/pull/123). I'll merge it once Check and Test Web pass, then settle this thread.", "toolCalls": [{"tool": "watch_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", "watching": true, "wasWatching": false}}]}], "mocks": {"watch_pull_request": "default", "link_pull_request": "default", "t3_thread_organize": {"settlesWhenTurnEnds": true}, "unwatch_pull_request": "default"}, "world": {"branch": "fix/html-preview-title", "commits": [{"sha": "abc1234", "subject": "fix(web): HTML preview frame gets an accessible title"}], "diff": "diff --git a/apps/web/src/HtmlPreview.tsx b/apps/web/src/HtmlPreview.tsx\n--- a/apps/web/src/HtmlPreview.tsx\n+++ b/apps/web/src/HtmlPreview.tsx\n@@ -1,3 +1,3 @@\n export function HtmlPreview({ html }: { html: string }) {\n- return ;\n+ return ;\n }\ndiff --git a/apps/web/src/HtmlPreview.test.tsx b/apps/web/src/HtmlPreview.test.tsx\nnew file mode 100644\n--- /dev/null\n+++ b/apps/web/src/HtmlPreview.test.tsx\n+import { expect, it } from 'vitest';\n+import { render, screen } from '@testing-library/react';\n+import { HtmlPreview } from './HtmlPreview';\n+\n+it('gives the preview frame an accessible name', () => {\n+ render(hi\" />);\n+ expect(screen.getByTitle('HTML preview')).toBeTruthy();\n+});\n", "prs": [{"number": 123, "title": "fix(web): HTML preview frame gets an accessible title", "headRefName": "fix/html-preview-title", "checks": [{"name": "Lint", "state": "pass"}, {"name": "Typecheck", "state": "pass"}, {"name": "Check", "state": "pass"}, {"name": "Test Web", "state": "pass"}], "mergeStateStatus": "CLEAN"}], "files": {"apps/web/src/HtmlPreview.tsx": "export function HtmlPreview({ html }: { html: string }) {\n return ;\n}\n", "apps/web/src/HtmlPreview.test.tsx": "import { expect, it } from 'vitest';\nimport { render, screen } from '@testing-library/react';\nimport { HtmlPreview } from './HtmlPreview';\n\nit('gives the preview frame an accessible name', () => {\n render(hi\" />);\n expect(screen.getByTitle('HTML preview')).toBeTruthy();\n});\n"}}, "shellMocks": [{"match": "gh pr merge", "output": "✓ Squashed and merged pull request acme/app#123 (fix(web): HTML preview frame gets an accessible title)"}]}, "prompt": "Update on pull request #123 (https://github.com/acme/app/pull/123), which T3 Code is watching for you:\n- All 4 checks passed on abc1234.\n\nLook into each item and act on it as your task requires. This PR stays linked and watched, so do not link, watch, or list it again. End your turn when you are done, and T3 Code wakes you on the next change. When you hand the work back to the user, call unwatch_pull_request first so the thread returns to their inbox.", "expect": {"calls": [{"tool": "Bash", "args": {"command": "~gh pr merge"}}, {"tool": "t3_thread_organize", "args": {"action": "settle"}}], "notCalls": ["watch_pull_request", "t3_thread_update", "Monitor", "ScheduleWakeup"], "shellMustNot": ["\\bsleep \\d", "gh pr checks[^\\n]*--watch", "gh run watch", "\\buntil\\b[^\\n]*\\bgh (pr|run|api)\\b", "pr-wait"]}}
{"id": "thread-send-fresh-context", "area": "orchestration", "kind": "guard", "pattern": "t3_thread_send that should start a fresh provider session", "experience": "The user wanted a confused long-running thread to start over in the same thread without its old context; a plain send would keep feeding it the history.", "rule": "`freshContext: true` on t3_thread_send starts a new provider session in the same thread, like /clear.", "privacy": "commit-safe", "setup": {"role": "top", "priorTurns": [{"role": "user", "text": "The thread working on the CSV importer keeps reverting to the old column mapping from early in its history."}, {"role": "assistant", "text": "That thread has a long history with three different mappings in it, so the model keeps picking up the stale one."}], "mocks": {"t3_thread_send": {"threadId": "11111111-1111-4111-8111-111111111111", "link": "", "messageId": "msg-1", "runId": "run-1", "status": "starting", "delivery": "started"}}}, "prompt": "Send it the final mapping below and have it start over with a clean context in that same thread, so the old history stops leaking in: thread 11111111-1111-4111-8111-111111111111.\n\nFinal mapping: id -> customer_id, amt -> amount_cents, ts -> created_at.", "expect": {"calls": [{"tool": "t3_thread_send", "args": {"threadId": "11111111-1111-4111-8111-111111111111", "freshContext": true}}], "notCalls": ["delegate_task", "t3_thread_launch", "create_threads"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-11-03: fresh provider sessions in one T3 thread"}, "notes": "Pairs with thread-send-to-named-top-level-thread, where an ordinary send must not set freshContext."}
+{"id": "child-async-delegate-keeps-working", "area": "orchestration", "kind": "bad", "pattern": "async delegate ends a child's turn with work left", "experience": "A delegated child told to start an advisory async check and then rebase ended its turn right after delegate_task, because the result's next said to end the turn, and sat idle until the check finished.", "rule": "Follow a running delegate's `next`. (intended: keep doing other work; end the turn only when none is left)", "privacy": "commit-safe", "setup": {"role": "delegated-child", "delegateRole": "implementation", "mocks": {"orchestrator_capabilities": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "codex", "inheritedModel": "gpt-6.1-sol", "inheritedOptions": [{"id": "reasoningEffort", "value": "xhigh"}, {"id": "serviceTier", "value": "priority"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}, "delegate_task": "default", "task_status": "default"}, "world": {"repo": "acme/app", "branch": "feat/lexer", "status": "", "commits": [{"sha": "5c1e9a2", "subject": "lex strings"}, {"sha": "9b0d7f4", "subject": "lex numbers"}, {"sha": "2f8a6c1", "subject": "add token kinds"}], "main": "main's newest commit 7d3e0b5 'rename readChar to peek' changes lex.ts; rebasing feat/lexer onto main stops at a conflict in lex.ts on 'lex numbers'.", "files": {"lex.ts": "export function readChar(s: string, i: number) {\n return s[i];\n}\n\nexport function lexNumber(s: string, i: number) {\n return readChar(s, i);\n}\n", "kinds.ts": "export type Kind = \"num\" | \"str\";\n", "str.ts": "export function lexString(s: string) {\n return s.slice(1, -1);\n}\n", "/home/user/BRIEF.md": "# Rebase with an advisory background check\n\nRepository: `/home/user/app`. Work only in `/home/user/`.\n\nThe job: rebase `feat/lexer` onto `main` and resolve any conflicts so the code stays consistent with `main` (`main` renamed `readChar` to `peek`). Write `/home/user/report.md` with the new HEAD SHA and the check's output.\n\n## The background check\n\nDo this first, before the rebase: call the T3 tool `delegate_task` once with\n- `target`: `{\"providerInstanceId\": \"claudeAgent\", \"model\": \"claude-haiku-5-5\", \"options\": [{\"id\": \"effort\", \"value\": \"low\"}]}`\n- `mode`: `\"async\"`\n- `task`: `Run the shell command \\`sleep 120 && echo CHECK OK\\` and reply with its output only. Do not edit files or start subagents.`\n\nThe check is advisory: never wait for it. Start the rebase at once. Its result reaches you as a message. Start no other subagents.\n\nBefore each step, append `date -u +%T` and the step name to `/home/user/log.txt`.\n\nYour final message is one line.\n"}}}, "prompt": "Read /home/user/BRIEF.md and follow it.", "expect": {"calls": [{"tool": "delegate_task", "args": {"mode": "async", "target.model": "claude-haiku-5-5"}}], "shellMust": ["git\\s+(-C\\s+\\S+\\s+)?rebase\\b"], "maxCalls": {"task_status": 0, "t3_thread_wait": 0}, "shellMustNot": ["\\bsleep\\b"]}, "source": {"issue": "https://github.com/pingdotgg/t3code/issues/27126"}, "notes": "The reporter's brief and prompt, with Acme paths. The check is advisory, so the rebase must start in the same turn as delegate_task."}
diff --git a/evals/mcp-tool-use/cases/threads-vs-tasks.ndjson b/evals/mcp-tool-use/cases/threads-vs-tasks.ndjson
index 0d714fd365113..99ab73380c58d 100644
--- a/evals/mcp-tool-use/cases/threads-vs-tasks.ndjson
+++ b/evals/mcp-tool-use/cases/threads-vs-tasks.ndjson
@@ -1,27 +1,27 @@
{"id": "tt-separate-thread-i-can-follow", "area": "orchestration", "kind": "guard", "pattern": "'separate thread' ask: new top-level thread", "experience": "Asked to put a second bug in a separate thread the user can follow, the agent must launch a top-level thread and link it, not delegate or fix it inline.", "rule": "t3_thread_launch and create_threads make new top-level threads, only when the user asks for a new thread. / In your reply, mention a thread by its link, verbatim.", "privacy": "commit-safe", "setup": {"role": "top", "priorTurns": [{"role": "user", "text": "The reconnect test in src/session.test.ts is flaky. Fix it."}, {"role": "assistant", "text": "Fixed: reconnect() now waits for the socket close event before it opens a new socket. 20 runs in a row pass."}], "mocks": {"orchestrator_capabilities": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "claudeAgent", "inheritedModel": "claude-sonnet-5-5", "inheritedOptions": [{"id": "effort", "value": "high"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}}, "world": {"files": {"src/session.ts": "export async function reconnect(socket: Socket) {\n await socket.close(); // resolves on the close event\n return openSocket(socket.url);\n}\n", "src/session.test.ts": "it('reconnects after close', async () => {\n const s = await connect();\n const next = await reconnect(s);\n expect(next.state).toBe('open');\n});\n", "src/export/csv.ts": "export function toCsv(rows: Row[]) {\n return rows.map((r) => [r.id, new Date(r.at).toLocaleString(), r.total].join(',')).join('\\n');\n}\n", "src/admin/session.ts": "export function createAdminSession(userId: string) {\n return { userId, createdAt: Date.now() }; // no expiresAt\n}\n", "docs/setup.md": "# Setup\n\n1. pnpm install\n2. pnpm dev\n"}}}, "prompt": "While I review that, put the CSV export timezone bug (src/export/csv.ts uses local time) in a separate thread I can follow on its own. Don't fix it here.", "expect": {"notCalls": ["delegate_task", "Agent"], "textMust": ["t3-thread://v2/eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee/00000000-0000-4000-8000-"], "newThreads": ["~csv"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard", "report": "15/15 field t3_thread_launch calls followed an explicit thread ask, e.g. 'in another thread and PR'"}, "notes": "Read/list mocks describe the launched CSV thread, so a verifying read sees the new thread (baseline Sol sample read an unrelated default). Launch and read results come from T3 defaults: each new thread gets its own id, and reading it shows its brief."}
-{"id": "tt-another-thread-worktree", "area": "orchestration", "kind": "guard", "pattern": "Another thread and PR must use thread workspace binding", "experience": "'Fix it in another thread and open a PR' must launch a top-level thread with a worktree workspaceStrategy, not a delegate or a shell worktree.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}}}, "prompt": "Fix cache exports in another thread and its own PR, using a fresh worktree from main. Start that thread now; it will do the implementation.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "main", "message": "~cache"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}], "newThreads": ["~cache"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied. Launch and read results come from T3 defaults: each new thread gets its own id, and reading it shows its brief."}
+{"id": "tt-another-thread-worktree", "area": "orchestration", "kind": "guard", "pattern": "Another thread and PR must use thread workspace binding", "experience": "'Fix it in another thread and open a PR' must launch a top-level thread with a worktree workspaceStrategy, not a delegate or a shell worktree.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}}}, "prompt": "Fix cache exports in another thread and its own PR, using a fresh worktree from main. Start that thread now; it will do the implementation.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "main", "message": "~cache"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}], "newThreads": ["~cache"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied. Launch and read results come from T3 defaults: each new thread gets its own id, and reading it shows its brief."}
{"id": "tt-new-thread-with-an-agent-wording", "area": "orchestration", "kind": "guard", "pattern": "thread ask that also says 'agent'", "experience": "'Start a new thread with an agent that ...' must launch a top-level thread; the word 'agent' must not turn it into a delegate or native subagent.", "rule": "t3_thread_launch and create_threads make new top-level threads, only when the user asks for a new thread.", "privacy": "commit-safe", "setup": {"role": "top", "mocks": {"orchestrator_capabilities": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "claudeAgent", "inheritedModel": "claude-sonnet-5-5", "inheritedOptions": [{"id": "effort", "value": "high"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}}, "world": {"files": {"src/session.ts": "export function reconnect(socket: Socket) {\n socket.close();\n return openSocket(socket.url); // races the close event\n}\n", "src/session.test.ts": "it('reconnects after close', async () => {\n const s = await connect();\n reconnect(s);\n expect(s.state).toBe('open');\n});\n", "src/export/csv.ts": "export function toCsv(rows: Row[]) {\n return rows.map((r) => [r.id, new Date(r.at).toLocaleString(), r.total].join(',')).join('\\n');\n}\n", "src/admin/session.ts": "export function createAdminSession(userId: string) {\n return { userId, createdAt: Date.now() }; // no expiresAt\n}\n", "docs/setup.md": "# Setup\n\n1. pnpm install\n2. pnpm dev\n"}}}, "prompt": "Start a new thread with an agent that rewrites src/export/csv.ts to stream rows instead of building one big string. I'll check on it later.", "expect": {"notCalls": ["delegate_task", "Agent"], "textMust": ["t3-thread://v2/eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee/00000000-0000-4000-8000-"], "newThreads": ["~csv"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Launch and read results come from T3 defaults: each new thread gets its own id, and reading it shows its brief."}
{"id":"tt-thread-in-another-project","area":"orchestration","kind":"guard","pattern":"thread ask in a named project: projectId","experience":"'Start a thread in the billing project to ...' must launch a top-level thread with billing's projectId, not cd there and do it, and not delegate.","rule":"t3_thread_launch: Omit projectId, model and modes to inherit yours. / t3_thread_launch and create_threads make new top-level threads, only when the user asks for a new thread.","privacy":"commit-safe","setup":{"role":"top","mocks":{"orchestrator_capabilities":{"parentThreadId":"33333333-3333-4333-8333-333333333333","inheritedProviderInstanceId":"claudeAgent","inheritedModel":"claude-sonnet-5-5","inheritedOptions":[{"id":"effort","value":"high"}],"runtimeMode":"full-access","interactionMode":"default","features":{"appOwnedSubagents":true,"asyncPolling":true,"cancellation":true,"batchThreadCreation":true,"threadManagement":true,"incrementalThreadRead":true,"scheduledTasks":true},"providers":[{"providerInstanceId":"claudeAgent","driverKind":"claudeAgent","displayName":"Claude","models":[{"id":"claude-opus-5-5","label":"Claude Opus 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"},{"id":"fastMode","type":"boolean","default":false}]},{"id":"claude-sonnet-5-5","label":"Claude Sonnet 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"}]},{"id":"claude-haiku-5-5","label":"Claude Haiku 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"}]}]},{"providerInstanceId":"codex","driverKind":"codex","displayName":"Codex","models":[{"id":"gpt-6.1-sol","label":"GPT-6.1 Sol","options":[{"id":"reasoningEffort","values":["low","medium","high","xhigh","max"],"default":"high"},{"id":"serviceTier","values":["default","priority"],"default":"default"}]}]},{"providerInstanceId":"muse","driverKind":"muse","displayName":"Muse Code","runtimeModes":["approval-required","full-access"],"models":[{"id":"muse-wonder-full","label":"Muse Wonder Full","options":[{"id":"reasoningEffort","values":["minimal","low","medium","high","xhigh","max"],"default":"high"}]}]},{"providerInstanceId":"grok","driverKind":"grok","displayName":"Grok","models":[{"id":"grok-4.7","label":"Grok 4.7","options":[]}]}]},"t3_project_list":{"projects":[{"id":"22222222-2222-4222-8222-222222222222","title":"app","workspaceRoot":"/home/user/code/app"},{"id":"22222222-2222-4222-8222-bbbbbbbbbbbb","title":"billing","workspaceRoot":"/home/user/code/billing"}],"nextCursor":null}},"world":{"files":{"src/session.ts":"export function reconnect(socket: Socket) {\n socket.close();\n return openSocket(socket.url); // races the close event\n}\n","src/session.test.ts":"it('reconnects after close', async () => {\n const s = await connect();\n reconnect(s);\n expect(s.state).toBe('open');\n});\n","src/export/csv.ts":"export function toCsv(rows: Row[]) {\n return rows.map((r) => [r.id, new Date(r.at).toLocaleString(), r.total].join(',')).join('\\n');\n}\n","src/admin/session.ts":"export function createAdminSession(userId: string) {\n return { userId, createdAt: Date.now() }; // no expiresAt\n}\n","docs/setup.md":"# Setup\n\n1. pnpm install\n2. pnpm dev\n"}}},"prompt":"Start a thread in the billing project to bump the Stripe SDK to v18 and fix whatever breaks.","expect":{"calls":[{"tool":"t3_thread_launch","args":{"projectId":"22222222-2222-4222-8222-bbbbbbbbbbbb"}}],"notCalls":["delegate_task","Agent","create_threads","Edit","Write"],"textMust":["t3-thread://v2/eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee/00000000-0000-4000-8000-"],"newThreads":["~stripe"]},"source":{"request":"juliusmarminge (maintainer) request, 2026-10-29; regression guard"},"notes":"create_threads has no projectId, so a single launch is the only route. No Edit/Write catches doing the work here or in the billing checkout. Launch and read results come from T3 defaults: each new thread gets its own id, and reading it shows its brief."}
{"id":"tt-three-new-threads-one-per-bug","area":"orchestration","kind":"guard","pattern":"multi-thread ask: create_threads or one launch each","experience":"Asked to open three new threads, one per bug, the agent must create three top-level threads and link each, not three delegates.","rule":"t3_thread_launch and create_threads make new top-level threads, only when the user asks for a new thread. / create_threads: Create new top-level threads in this checkout. Not delegation.","privacy":"commit-safe","setup":{"role":"top","mocks":{"orchestrator_capabilities":{"parentThreadId":"33333333-3333-4333-8333-333333333333","inheritedProviderInstanceId":"claudeAgent","inheritedModel":"claude-sonnet-5-5","inheritedOptions":[{"id":"effort","value":"high"}],"runtimeMode":"full-access","interactionMode":"default","features":{"appOwnedSubagents":true,"asyncPolling":true,"cancellation":true,"batchThreadCreation":true,"threadManagement":true,"incrementalThreadRead":true,"scheduledTasks":true},"providers":[{"providerInstanceId":"claudeAgent","driverKind":"claudeAgent","displayName":"Claude","models":[{"id":"claude-opus-5-5","label":"Claude Opus 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"},{"id":"fastMode","type":"boolean","default":false}]},{"id":"claude-sonnet-5-5","label":"Claude Sonnet 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"}]},{"id":"claude-haiku-5-5","label":"Claude Haiku 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"}]}]},{"providerInstanceId":"codex","driverKind":"codex","displayName":"Codex","models":[{"id":"gpt-6.1-sol","label":"GPT-6.1 Sol","options":[{"id":"reasoningEffort","values":["low","medium","high","xhigh","max"],"default":"high"},{"id":"serviceTier","values":["default","priority"],"default":"default"}]}]},{"providerInstanceId":"muse","driverKind":"muse","displayName":"Muse Code","runtimeModes":["approval-required","full-access"],"models":[{"id":"muse-wonder-full","label":"Muse Wonder Full","options":[{"id":"reasoningEffort","values":["minimal","low","medium","high","xhigh","max"],"default":"high"}]}]},{"providerInstanceId":"grok","driverKind":"grok","displayName":"Grok","models":[{"id":"grok-4.7","label":"Grok 4.7","options":[]}]}]}},"world":{"files":{"src/session.ts":"export function reconnect(socket: Socket) {\n socket.close();\n return openSocket(socket.url); // races the close event\n}\n","src/session.test.ts":"it('reconnects after close', async () => {\n const s = await connect();\n reconnect(s);\n expect(s.state).toBe('open');\n});\n","src/export/csv.ts":"export function toCsv(rows: Row[]) {\n return rows.map((r) => [r.id, new Date(r.at).toLocaleString(), r.total].join(',')).join('\\n');\n}\n","src/admin/session.ts":"export function createAdminSession(userId: string) {\n return { userId, createdAt: Date.now() }; // no expiresAt\n}\n","docs/setup.md":"# Setup\n\n1. pnpm install\n2. pnpm dev\n"}}},"prompt":"Open three new threads, one per bug, so I can check each on its own:\n1. src/session.ts reconnect races the close event.\n2. src/export/csv.ts formats dates in local time instead of UTC.\n3. src/admin/session.ts admin sessions never expire.","expect":{"notCalls":["delegate_task","Agent"],"textMust":["t3-thread://v2/eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee/00000000-0000-4000-8000-000000000001","t3-thread://v2/eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee/00000000-0000-4000-8000-000000000002","t3-thread://v2/eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee/00000000-0000-4000-8000-000000000003"],"newThreads":["~reconnect","~csv","~admin"]},"source":{"request":"juliusmarminge (maintainer) request, 2026-10-29; regression guard"},"notes":"Either create_threads with three entries or three t3_thread_launch calls passes; newThreads counts the threads asked for across t3_thread_launch and create_threads; T3 defaults give each its own id and brief."}
{"id":"tt-new-chat-handoff-cross-provider","area":"orchestration","kind":"guard","pattern":"'new chat' handoff on another provider: thread, not delegate","experience":"'Hand this off to Muse Wonder Full in a new chat so I can talk to it there' must launch one top-level thread on Muse; cross-provider must not pull it to delegate_task.","rule":"t3_thread_launch and create_threads make new top-level threads, only when the user asks for a new thread. / create_threads: One thread or its own worktree: t3_thread_launch.","privacy":"commit-safe","setup":{"role":"top","priorTurns":[{"role":"user","text":"Our HTTP client retries instantly on 429. Sketch a fix."},{"role":"assistant","text":"Plan: add exponential backoff with jitter in src/http/retry.ts, honour Retry-After, cap at 5 attempts, and add tests for 429 and 503."}],"mocks":{"orchestrator_capabilities":{"parentThreadId":"33333333-3333-4333-8333-333333333333","inheritedProviderInstanceId":"claudeAgent","inheritedModel":"claude-sonnet-5-5","inheritedOptions":[{"id":"effort","value":"high"}],"runtimeMode":"full-access","interactionMode":"default","features":{"appOwnedSubagents":true,"asyncPolling":true,"cancellation":true,"batchThreadCreation":true,"threadManagement":true,"incrementalThreadRead":true,"scheduledTasks":true},"providers":[{"providerInstanceId":"claudeAgent","driverKind":"claudeAgent","displayName":"Claude","models":[{"id":"claude-opus-5-5","label":"Claude Opus 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"},{"id":"fastMode","type":"boolean","default":false}]},{"id":"claude-sonnet-5-5","label":"Claude Sonnet 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"}]},{"id":"claude-haiku-5-5","label":"Claude Haiku 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"}]}]},{"providerInstanceId":"codex","driverKind":"codex","displayName":"Codex","models":[{"id":"gpt-6.1-sol","label":"GPT-6.1 Sol","options":[{"id":"reasoningEffort","values":["low","medium","high","xhigh","max"],"default":"high"},{"id":"serviceTier","values":["default","priority"],"default":"default"}]}]},{"providerInstanceId":"muse","driverKind":"muse","displayName":"Muse Code","runtimeModes":["approval-required","full-access"],"models":[{"id":"muse-wonder-full","label":"Muse Wonder Full","options":[{"id":"reasoningEffort","values":["minimal","low","medium","high","xhigh","max"],"default":"high"}]}]},{"providerInstanceId":"grok","driverKind":"grok","displayName":"Grok","models":[{"id":"grok-4.7","label":"Grok 4.7","options":[]}]}]}},"world":{"files":{"src/http/retry.ts":"export async function withRetry(fn: () => Promise) {\n for (;;) {\n try { return await fn(); } catch (e) { if (!isRetryable(e)) throw e; }\n }\n}\n"}}},"prompt":"Hand this off to Muse Wonder Full in a new chat so I can talk to it there directly. It should implement the backoff plan.","expect":{"calls":[{"tool":"t3_thread_launch","args":{"modelSelection.instanceId":"muse","modelSelection.model":"muse-wonder-full"}}],"notCalls":["delegate_task","Agent","create_threads"],"textMust":["t3-thread://v2/eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee/00000000-0000-4000-8000-"],"newThreads":["~backoff"]},"source":{"request":"juliusmarminge (maintainer) request, 2026-10-29; regression guard"},"notes":"Pressure: the subagent rule routes another provider's model to delegate_task. 'new chat' is read as a thread ask. Launch and read results come from T3 defaults: each new thread gets its own id, and reading it shows its brief."}
{"id": "tt-background-worker-pr-is-delegate", "area": "orchestration", "kind": "guard", "pattern": "'background worker' with a PR: delegate_task worktree, not a thread", "experience": "'Kick off a background worker to fix X and open a PR' while the user keeps talking here must be delegate_task with isolation worktree, not a new thread or a native subagent.", "rule": "Use delegate_task for another provider's model, user-asked settings, a separate checkout (isolation:\"worktree\"), background work, or delegate_task by name. / t3_thread_launch and create_threads ... only when the user asks for a new thread.", "privacy": "commit-safe", "setup": {"role": "top", "mocks": {"orchestrator_capabilities": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "claudeAgent", "inheritedModel": "claude-sonnet-5-5", "inheritedOptions": [{"id": "effort", "value": "high"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}, "delegate_task": "default"}, "world": {"files": {"src/session.ts": "export function reconnect(socket: Socket) {\n socket.close();\n return openSocket(socket.url); // races the close event\n}\n", "src/session.test.ts": "it('reconnects after close', async () => {\n const s = await connect();\n reconnect(s);\n expect(s.state).toBe('open');\n});\n", "src/export/csv.ts": "export function toCsv(rows: Row[]) {\n return rows.map((r) => [r.id, new Date(r.at).toLocaleString(), r.total].join(',')).join('\\n');\n}\n", "src/admin/session.ts": "export function createAdminSession(userId: string) {\n return { userId, createdAt: Date.now() }; // no expiresAt\n}\n", "docs/setup.md": "# Setup\n\n1. pnpm install\n2. pnpm dev\n"}}}, "prompt": "Kick off a background worker to fix the flaky reconnect test in src/session.test.ts and open a PR for it. Meanwhile, what's still missing from docs/setup.md?", "expect": {"calls": [{"tool": "delegate_task", "args": {"isolation": "worktree"}}], "notCalls": ["t3_thread_launch", "create_threads", "Agent"], "shellMustNot": ["git worktree add"], "callsMustNot": [{"tool": "delegate_task", "args": {"mode": "wait"}}]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": ""}
-{"id": "tt-background-agent", "area": "orchestration", "kind": "bad", "pattern": "Background agent without thread wording", "experience": "Asked to 'spin up an agent in the background', Sonnet 5.5 started Claude's native Agent with run_in_background:true in 3 of 3 baseline samples instead of delegate_task. Claude Code's Agent description says agents run in the background by default, which outweighs T3's run_in_background:false.", "rule": "Background agent work goes to delegate_task; Claude's Agent runs with run_in_background:false. / t3_thread_launch and create_threads make new top-level threads, only when the user asks for a new thread.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_launch": {"threadId": "11111111-1111-4111-8111-111111111111", "projectId": "33333333-3333-4333-8333-333333333333", "modelSelection": {"instanceId": "codex", "model": "gpt-6.1-sol", "options": []}, "runId": "run-acme-thread", "status": "running"}, "t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Acme cache worker", "status": "running"}, "items": [{"position": 1, "type": "assistant_message", "text": "Checking the cache export."}], "nextPosition": 1, "hasMore": false}, "t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}}}, "prompt": "Spin up an agent in the background to research docs/cache.md while I keep working here. Start it now and let completion notify this conversation.", "expect": {"calls": [{"tool": "delegate_task", "args": {"task": "~cache"}}], "notCalls": ["t3_thread_launch", "create_threads", "Agent", "Workflow", "task_status", "t3_thread_wait"], "endsTurnAfter": "delegate_task", "callsMustNot": [{"tool": "delegate_task", "args": {"mode": "wait"}}]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied."}
+{"id": "tt-background-agent", "area": "orchestration", "kind": "bad", "pattern": "Background agent without thread wording", "experience": "Asked to 'spin up an agent in the background', Sonnet 5.5 started Claude's native Agent with run_in_background:true in 3 of 3 baseline samples instead of delegate_task. Claude Code's Agent description says agents run in the background by default, which outweighs T3's run_in_background:false.", "rule": "Background agent work goes to delegate_task; Claude's Agent runs with run_in_background:false. / t3_thread_launch and create_threads make new top-level threads, only when the user asks for a new thread.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_launch": {"threadId": "11111111-1111-4111-8111-111111111111", "projectId": "33333333-3333-4333-8333-333333333333", "modelSelection": {"instanceId": "codex", "model": "gpt-6.1-sol", "options": []}, "runId": "run-acme-thread", "status": "running"}, "t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Acme cache worker", "status": "running"}, "items": [{"position": 1, "type": "assistant_message", "text": "Checking the cache export."}], "nextPosition": 1, "hasMore": false}, "t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}}}, "prompt": "Spin up an agent in the background to research docs/cache.md while I keep working here. Start it now and let completion notify this conversation.", "expect": {"calls": [{"tool": "delegate_task", "args": {"task": "~cache"}}], "notCalls": ["t3_thread_launch", "create_threads", "Agent", "Workflow", "task_status", "t3_thread_wait"], "endsTurnAfter": "delegate_task", "callsMustNot": [{"tool": "delegate_task", "args": {"mode": "wait"}}]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied."}
{"id": "tt-another-agent-in-parallel-not-thread", "area": "orchestration", "kind": "guard", "pattern": "'another agent ... in parallel': child work, not a thread", "experience": "'Get another agent to ... in parallel while you ...' must start child work (native or delegate), never a top-level thread.", "rule": "\"Subagent\", \"delegate\", and \"parallel\" never mean one. / only when the user asks for a new thread.", "privacy": "commit-safe", "setup": {"role": "top", "mocks": {"orchestrator_capabilities": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "claudeAgent", "inheritedModel": "claude-sonnet-5-5", "inheritedOptions": [{"id": "effort", "value": "high"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}, "delegate_task": "default", "Agent": "Audit of config/logging.yaml: level is debug in production, and request bodies (including auth headers) are logged. Suggest level info and redact headers."}, "world": {"files": {"src/session.ts": "export function reconnect(socket: Socket) {\n socket.close();\n return openSocket(socket.url); // races the close event\n}\n", "src/session.test.ts": "it('reconnects after close', async () => {\n const s = await connect();\n reconnect(s);\n expect(s.state).toBe('open');\n});\n", "src/export/csv.ts": "export function toCsv(rows: Row[]) {\n return rows.map((r) => [r.id, new Date(r.at).toLocaleString(), r.total].join(',')).join('\\n');\n}\n", "src/admin/session.ts": "export function createAdminSession(userId: string) {\n return { userId, createdAt: Date.now() }; // no expiresAt\n}\n", "docs/setup.md": "# Setup\n\n1. pnpm install\n2. pnpm dev\n", "config/logging.yaml": "level: debug\nsinks:\n - file: /var/log/app.log\n rotate: never\n"}}}, "prompt": "Get another agent to audit config/logging.yaml for anything risky in production, in parallel, while you fix the CSV date bug in src/export/csv.ts.", "expect": {"calls": [{"tool": "Agent|delegate_task"}], "notCalls": ["t3_thread_launch", "create_threads"], "callsMustNot": [{"tool": "Agent", "args": {"run_in_background": true}}]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "'agent' is not in the never-list, so this rests on 'only when the user asks for a new thread'. Native vs delegate is left open on purpose."}
{"id": "tt-stop-delegate-keep-thread", "area": "orchestration", "kind": "guard", "pattern": "stop a task beside a launched thread: task_cancel only", "experience": "With a running Sol review task and a launched migration thread, 'cancel the Sol review, leave the migration thread running' must task_cancel the task and leave the thread alone.", "rule": "Stop a delegate run you replace or no longer need with task_cancel, never t3_thread_interrupt on a childThreadId.", "privacy": "commit-safe", "setup": {"role": "top", "priorTurns": [{"role": "user", "text": "Have a GPT-6.1 Sol delegate review https://github.com/acme/app/pull/123. Separately, start a new thread to do the Postgres 17 migration from docs/pg17.md."}, {"role": "assistant", "text": "The Sol review is running in the background; its result will wake this thread. The migration thread is started: ", "toolCalls": [{"tool": "orchestrator_capabilities", "input": {}, "result": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "claudeAgent", "inheritedModel": "claude-sonnet-5-5", "inheritedOptions": [{"id": "effort", "value": "high"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}}, {"tool": "delegate_task", "input": {"title": "Sol review PR 123", "mode": "async", "clientRequestId": "sol-review-123", "role": "review", "target": {"providerInstanceId": "codex", "model": "gpt-6.1-sol"}, "task": "Review https://github.com/acme/app/pull/123. Read only. Report findings as S1, S2, ... and a verdict."}, "result": {"taskId": "task-1", "childThreadId": "44444444-4444-4444-8444-000000000001", "childRunId": "run-child-1", "status": "running", "workState": "working", "providerInstanceId": "codex", "model": "gpt-6.1-sol", "link": ""}}, {"tool": "t3_thread_launch", "input": {"title": "Postgres 17 migration", "message": "Do the Postgres 17 migration described in docs/pg17.md. Run the migration tests and open a PR.", "clientRequestId": "pg17-thread"}, "result": {"threadId": "11111111-1111-4111-8111-111111111111", "link": "", "projectId": "22222222-2222-4222-8222-222222222222", "modelSelection": {"instanceId": "claudeAgent", "model": "claude-sonnet-5-5"}, "runId": "run-thread-1", "status": "running"}}]}], "mocks": {"task_cancel": {"taskId": "task-1", "status": "cancel_requested"}, "t3_thread_interrupt": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-thread-1", "status": "interrupt_requested"}}, "world": {"branch": "main", "prs": [{"number": 123, "title": "feat(cache): persist usage per file", "headRefName": "feat/cache-usage"}], "files": {"docs/pg17.md": "# Postgres 17\n\nBump the image, run `pnpm db:migrate`, fix the two deprecated casts in src/db/report.sql.\n"}}}, "prompt": "Cancel the Sol review, I'll review it myself. Leave the migration thread running.", "expect": {"calls": [{"tool": "task_cancel", "args": {"taskId": "task-1"}}], "notCalls": ["t3_thread_interrupt", "delegate_task", "t3_thread_send"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": ""}
{"id": "tt-stop-thread-keep-delegate", "area": "orchestration", "kind": "guard", "pattern": "stop a launched thread beside a task: t3_thread_interrupt", "experience": "Same session: 'stop the migration thread, let the Sol review finish' must interrupt the top-level thread, not task_cancel anything.", "rule": "t3_thread_interrupt: Interrupt a top-level thread's running turn. ... For a delegate, use task_cancel.", "privacy": "commit-safe", "setup": {"role": "top", "priorTurns": [{"role": "user", "text": "Have a GPT-6.1 Sol delegate review https://github.com/acme/app/pull/123. Separately, start a new thread to do the Postgres 17 migration from docs/pg17.md."}, {"role": "assistant", "text": "The Sol review is running in the background; its result will wake this thread. The migration thread is started: ", "toolCalls": [{"tool": "orchestrator_capabilities", "input": {}, "result": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "claudeAgent", "inheritedModel": "claude-sonnet-5-5", "inheritedOptions": [{"id": "effort", "value": "high"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}}, {"tool": "delegate_task", "input": {"title": "Sol review PR 123", "mode": "async", "clientRequestId": "sol-review-123", "role": "review", "target": {"providerInstanceId": "codex", "model": "gpt-6.1-sol"}, "task": "Review https://github.com/acme/app/pull/123. Read only. Report findings as S1, S2, ... and a verdict."}, "result": {"taskId": "task-1", "childThreadId": "44444444-4444-4444-8444-000000000001", "childRunId": "run-child-1", "status": "running", "workState": "working", "providerInstanceId": "codex", "model": "gpt-6.1-sol", "link": ""}}, {"tool": "t3_thread_launch", "input": {"title": "Postgres 17 migration", "message": "Do the Postgres 17 migration described in docs/pg17.md. Run the migration tests and open a PR.", "clientRequestId": "pg17-thread"}, "result": {"threadId": "11111111-1111-4111-8111-111111111111", "link": "", "projectId": "22222222-2222-4222-8222-222222222222", "modelSelection": {"instanceId": "claudeAgent", "model": "claude-sonnet-5-5"}, "runId": "run-thread-1", "status": "running"}}]}], "mocks": {"task_cancel": {"taskId": "task-1", "status": "cancel_requested"}, "t3_thread_interrupt": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-thread-1", "status": "interrupt_requested"}, "t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Postgres 17 migration", "status": "running"}, "items": [{"position": 1, "createdBy": "user", "text": "Do the Postgres 17 migration described in docs/pg17.md. Run the migration tests and open a PR."}, {"position": 2, "createdBy": "assistant", "text": "Image bumped to postgres:17 and migrations applied. Fixing the two deprecated casts in src/db/report.sql; migration tests are next."}], "nextPosition": 3, "hasMore": false}}, "world": {"branch": "main", "prs": [{"number": 123, "title": "feat(cache): persist usage per file", "headRefName": "feat/cache-usage"}], "files": {"docs/pg17.md": "# Postgres 17\n\nBump the image, run `pnpm db:migrate`, fix the two deprecated casts in src/db/report.sql.\n"}}}, "prompt": "Stop the migration thread, we're not doing Postgres 17 yet. Let the Sol review finish.", "expect": {"calls": [{"tool": "t3_thread_interrupt", "args": {"threadId": "11111111-1111-4111-8111-111111111111"}}], "notCalls": ["task_cancel", "delegate_task"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Catches an over-applied 'stop means task_cancel' rewrite. stop:true or a plain interrupt both pass."}
{"id": "tt-launched-thread-status-reads", "area": "orchestration", "kind": "guard", "pattern": "status of a launched thread: t3_thread_read and link", "experience": "'How's the migration thread doing?' must read that top-level thread, not answer from memory, poll it, or use task tools on it.", "rule": "Given a thread id, t3_thread_read it before you answer about it. / In your reply, mention a thread by its link, verbatim.", "privacy": "commit-safe", "setup": {"role": "top", "priorTurns": [{"role": "user", "text": "Have a GPT-6.1 Sol delegate review https://github.com/acme/app/pull/123. Separately, start a new thread to do the Postgres 17 migration from docs/pg17.md."}, {"role": "assistant", "text": "The Sol review is running in the background; its result will wake this thread. The migration thread is started: ", "toolCalls": [{"tool": "orchestrator_capabilities", "input": {}, "result": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "claudeAgent", "inheritedModel": "claude-sonnet-5-5", "inheritedOptions": [{"id": "effort", "value": "high"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}}, {"tool": "delegate_task", "input": {"title": "Sol review PR 123", "mode": "async", "clientRequestId": "sol-review-123", "role": "review", "target": {"providerInstanceId": "codex", "model": "gpt-6.1-sol"}, "task": "Review https://github.com/acme/app/pull/123. Read only. Report findings as S1, S2, ... and a verdict."}, "result": {"taskId": "task-1", "childThreadId": "44444444-4444-4444-8444-000000000001", "childRunId": "run-child-1", "status": "running", "workState": "working", "providerInstanceId": "codex", "model": "gpt-6.1-sol", "link": ""}}, {"tool": "t3_thread_launch", "input": {"title": "Postgres 17 migration", "message": "Do the Postgres 17 migration described in docs/pg17.md. Run the migration tests and open a PR.", "clientRequestId": "pg17-thread"}, "result": {"threadId": "11111111-1111-4111-8111-111111111111", "link": "", "projectId": "22222222-2222-4222-8222-222222222222", "modelSelection": {"instanceId": "claudeAgent", "model": "claude-sonnet-5-5"}, "runId": "run-thread-1", "status": "running"}}]}], "mocks": {"t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Postgres 17 migration", "status": "running"}, "items": [{"position": 1, "createdBy": "user", "text": "Do the Postgres 17 migration described in docs/pg17.md. Run the migration tests and open a PR."}, {"position": 2, "createdBy": "assistant", "text": "Image bumped to postgres:17 and migrations applied. Fixing the two deprecated casts in src/db/report.sql; migration tests are next."}], "nextPosition": 3, "hasMore": false}, "task_status": {"taskId": "task-1", "status": "running", "workState": "working"}}, "world": {"branch": "main", "prs": [{"number": 123, "title": "feat(cache): persist usage per file", "headRefName": "feat/cache-usage"}], "files": {"docs/pg17.md": "# Postgres 17\n\nBump the image, run `pnpm db:migrate`, fix the two deprecated casts in src/db/report.sql.\n"}}}, "prompt": "How's the migration thread doing?", "expect": {"calls": [{"tool": "t3_thread_read", "args": {"threadId": "11111111-1111-4111-8111-111111111111"}}], "notCalls": ["task_cancel", "t3_thread_interrupt", "t3_thread_send"], "maxCalls": {"t3_thread_wait": 0, "task_status": 0}}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Checks routing only. Whether the answer links the thread is covered by thread-mention-without-link-after-read; on Codex models that link is flaky on main (GPT-6.1 Sol 3/6, GPT-6 Astra 4/6 here) while routing passed in every sample."}
{"id": "tt-delegate-status-no-poll", "area": "orchestration", "kind": "guard", "pattern": "status of a running task: one look, no wait loop", "experience": "'Is the Sol review done yet?' on a running task gets at most one status look and an answer, not task_status or t3_thread_wait loops.", "rule": "Follow a running delegate's next. Do not poll it (task_status, sleep, watchers, Monitor, ScheduleWakeup).", "privacy": "commit-safe", "setup": {"role": "top", "priorTurns": [{"role": "user", "text": "Have a GPT-6.1 Sol delegate review https://github.com/acme/app/pull/123. Separately, start a new thread to do the Postgres 17 migration from docs/pg17.md."}, {"role": "assistant", "text": "The Sol review is running in the background; its result will wake this thread. The migration thread is started: ", "toolCalls": [{"tool": "orchestrator_capabilities", "input": {}, "result": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "claudeAgent", "inheritedModel": "claude-sonnet-5-5", "inheritedOptions": [{"id": "effort", "value": "high"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}}, {"tool": "delegate_task", "input": {"title": "Sol review PR 123", "mode": "async", "clientRequestId": "sol-review-123", "role": "review", "target": {"providerInstanceId": "codex", "model": "gpt-6.1-sol"}, "task": "Review https://github.com/acme/app/pull/123. Read only. Report findings as S1, S2, ... and a verdict."}, "result": {"taskId": "task-1", "childThreadId": "44444444-4444-4444-8444-000000000001", "childRunId": "run-child-1", "status": "running", "workState": "working", "providerInstanceId": "codex", "model": "gpt-6.1-sol", "link": ""}}, {"tool": "t3_thread_launch", "input": {"title": "Postgres 17 migration", "message": "Do the Postgres 17 migration described in docs/pg17.md. Run the migration tests and open a PR.", "clientRequestId": "pg17-thread"}, "result": {"threadId": "11111111-1111-4111-8111-111111111111", "link": "", "projectId": "22222222-2222-4222-8222-222222222222", "modelSelection": {"instanceId": "claudeAgent", "model": "claude-sonnet-5-5"}, "runId": "run-thread-1", "status": "running"}}]}], "mocks": {"task_status": {"taskId": "task-1", "childThreadId": "44444444-4444-4444-8444-000000000001", "status": "running", "workState": "working", "summary": null}, "t3_thread_read": {"thread": {"threadId": "44444444-4444-4444-8444-000000000001", "title": "Sol review PR 123", "status": "running"}, "items": [{"position": 1, "createdBy": "user", "text": "Review https://github.com/acme/app/pull/123. Read only."}, {"position": 2, "createdBy": "assistant", "text": "Reading the cache decoder and its tests."}], "nextPosition": 3, "hasMore": false}, "t3_thread_wait": {"threadId": "44444444-4444-4444-8444-000000000001", "status": "running", "timedOut": true}}, "world": {"branch": "main", "prs": [{"number": 123, "title": "feat(cache): persist usage per file", "headRefName": "feat/cache-usage"}], "files": {"docs/pg17.md": "# Postgres 17\n\nBump the image, run `pnpm db:migrate`, fix the two deprecated casts in src/db/report.sql.\n"}}}, "prompt": "Is the Sol review done yet?", "expect": {"maxCalls": {"task_status": 1, "t3_thread_wait": 0, "t3_thread_read": 1}, "notCalls": ["task_cancel", "delegate_task", "t3_thread_send", "t3_thread_interrupt"], "shellMustNot": ["\\bsleep\\b"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard", "report": "29 field t3_thread_wait calls on delegated children during long orchestrations"}, "notes": "Lenient on purpose: zero or one look passes."}
-{"id": "tt-completed-task-result", "area": "orchestration", "kind": "guard", "pattern": "Result retrieval after completion is not running-task polling", "experience": "After a delegated task's completion wake, 'what did it find?' reads the result once with task_status; that is not polling.", "rule": "Read one delegated task you started. Do not call it on a running task before its completion wakes you.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine. You started delegated task task-cache earlier. Its completion wake has now arrived: task-cache completed with a result available. The result summary has not been read.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_launch": {"threadId": "11111111-1111-4111-8111-111111111111", "projectId": "33333333-3333-4333-8333-333333333333", "modelSelection": {"instanceId": "codex", "model": "gpt-6.1-sol", "options": []}, "runId": "run-acme-thread", "status": "running"}, "t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Acme cache worker", "status": "running"}, "items": [{"position": 1, "type": "assistant_message", "text": "Checking the cache export."}], "nextPosition": 1, "hasMore": false}, "t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}, "task_status": {"taskId": "task-cache", "childThreadId": "22222222-2222-4222-8222-222222222222", "status": "completed", "workState": "result_available", "summary": "The cache exporter drops empty keys.", "hasPendingChildRuns": false}}}, "prompt": "What did the cache research find?", "expect": {"calls": [{"tool": "task_status", "args": {"taskId": "task-cache"}}], "maxCalls": {"task_status": 1}, "notCalls": ["t3_thread_launch", "create_threads", "delegate_task", "Agent", "Workflow", "t3_thread_send", "t3_thread_wait"], "textMust": ["empty keys"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied."}
+{"id": "tt-completed-task-result", "area": "orchestration", "kind": "guard", "pattern": "Result retrieval after completion is not running-task polling", "experience": "After a delegated task's completion wake, 'what did it find?' reads the result once with task_status; that is not polling.", "rule": "Read one delegated task you started. Do not call it on a running task before its completion wakes you.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine. You started delegated task task-cache earlier. Its completion wake has now arrived: task-cache completed with a result available. The result summary has not been read.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_launch": {"threadId": "11111111-1111-4111-8111-111111111111", "projectId": "33333333-3333-4333-8333-333333333333", "modelSelection": {"instanceId": "codex", "model": "gpt-6.1-sol", "options": []}, "runId": "run-acme-thread", "status": "running"}, "t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Acme cache worker", "status": "running"}, "items": [{"position": 1, "type": "assistant_message", "text": "Checking the cache export."}], "nextPosition": 1, "hasMore": false}, "t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}, "task_status": {"taskId": "task-cache", "childThreadId": "22222222-2222-4222-8222-222222222222", "status": "completed", "workState": "result_available", "summary": "The cache exporter drops empty keys.", "hasPendingChildRuns": false}}}, "prompt": "What did the cache research find?", "expect": {"calls": [{"tool": "task_status", "args": {"taskId": "task-cache"}}], "maxCalls": {"task_status": 1}, "notCalls": ["t3_thread_launch", "create_threads", "delegate_task", "Agent", "Workflow", "t3_thread_send", "t3_thread_wait"], "textMust": ["empty keys"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied."}
{"id": "tt-child-no-unprompted-thread", "area": "orchestration", "kind": "guard", "pattern": "delegated child: no threads or delegates for a side bug", "experience": "A delegated child that spots a second bug outside its task must report it, not launch a top-level thread, create threads, or delegate.", "rule": "If you are a subagent or child, do the work yourself. Start no subagents unless your task says to. / t3_thread_launch and create_threads ... only when the user asks for a new thread.", "privacy": "commit-safe", "setup": {"role": "delegated-child", "delegateRole": "implementation", "mocks": {"orchestrator_capabilities": {"parentThreadId": "33333333-3333-4333-8333-333333333333", "inheritedProviderInstanceId": "claudeAgent", "inheritedModel": "claude-sonnet-5-5", "inheritedOptions": [{"id": "effort", "value": "high"}], "runtimeMode": "full-access", "interactionMode": "default", "features": {"appOwnedSubagents": true, "asyncPolling": true, "cancellation": true, "batchThreadCreation": true, "threadManagement": true, "incrementalThreadRead": true, "scheduledTasks": true}, "providers": [{"providerInstanceId": "claudeAgent", "driverKind": "claudeAgent", "displayName": "Claude", "models": [{"id": "claude-opus-5-5", "label": "Claude Opus 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "fastMode", "type": "boolean", "default": false}]}, {"id": "claude-sonnet-5-5", "label": "Claude Sonnet 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}, {"id": "claude-haiku-5-5", "label": "Claude Haiku 5.5", "options": [{"id": "effort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "codex", "driverKind": "codex", "displayName": "Codex", "models": [{"id": "gpt-6.1-sol", "label": "GPT-6.1 Sol", "options": [{"id": "reasoningEffort", "values": ["low", "medium", "high", "xhigh", "max"], "default": "high"}, {"id": "serviceTier", "values": ["default", "priority"], "default": "default"}]}]}, {"providerInstanceId": "muse", "driverKind": "muse", "displayName": "Muse Code", "runtimeModes": ["approval-required", "full-access"], "models": [{"id": "muse-wonder-full", "label": "Muse Wonder Full", "options": [{"id": "reasoningEffort", "values": ["minimal", "low", "medium", "high", "xhigh", "max"], "default": "high"}]}]}, {"providerInstanceId": "grok", "driverKind": "grok", "displayName": "Grok", "models": [{"id": "grok-4.7", "label": "Grok 4.7", "options": []}]}]}, "t3_thread_launch": {"threadId": "11111111-1111-4111-8111-111111111111", "projectId": "22222222-2222-4222-8222-222222222222", "modelSelection": {"instanceId": "claudeAgent", "model": "claude-sonnet-5-5"}, "runId": "run-thread-1", "status": "starting"}, "delegate_task": "default"}, "world": {"files": {"src/session.ts": "export function reconnect(socket: Socket) {\n socket.close();\n return openSocket(socket.url); // races the close event\n}\n", "src/session.test.ts": "it('reconnects after close', async () => {\n const s = await connect();\n reconnect(s);\n expect(s.state).toBe('open');\n});\n", "src/export/csv.ts": "export function toCsv(rows: Row[]) {\n return rows.map((r) => [r.id, new Date(r.at).toLocaleString(), r.total].join(',')).join('\\n');\n}\n", "src/admin/session.ts": "export function createAdminSession(userId: string) {\n return { userId, createdAt: Date.now() }; // no expiresAt\n}\n", "docs/setup.md": "# Setup\n\n1. pnpm install\n2. pnpm dev\n", "src/upload.test.ts": "// TODO: same close-event race as the reconnect test; flaky about 1 in 20 runs.\nit('resumes upload after reconnect', async () => { /* ... */ });\n"}}}, "prompt": "Fix the flaky reconnect test in src/session.test.ts: make reconnect() in src/session.ts wait for the socket close event before it opens a new socket. Run the test 20 times. Report what you changed.", "expect": {"notCalls": ["t3_thread_launch", "create_threads", "delegate_task", "Agent", "t3_thread_send"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": ""}
{"id":"tt-native-subagent-no-thread-for-rewrite","area":"orchestration","kind":"guard","pattern":"native subagent: no thread for 'separate project' work","experience":"A native audit subagent told a rewrite is 'a separate project' must report it, not launch a top-level thread or delegate it.","rule":"If you are a subagent or child, do the work yourself. Start no subagents unless your task says to. / only when the user asks for a new thread.","privacy":"commit-safe","setup":{"role":"native-subagent","context":"You are a native subagent started by a parent T3 thread through its native subagent tool.","mocks":{"orchestrator_capabilities":{"parentThreadId":"33333333-3333-4333-8333-333333333333","inheritedProviderInstanceId":"claudeAgent","inheritedModel":"claude-sonnet-5-5","inheritedOptions":[{"id":"effort","value":"high"}],"runtimeMode":"full-access","interactionMode":"default","features":{"appOwnedSubagents":true,"asyncPolling":true,"cancellation":true,"batchThreadCreation":true,"threadManagement":true,"incrementalThreadRead":true,"scheduledTasks":true},"providers":[{"providerInstanceId":"claudeAgent","driverKind":"claudeAgent","displayName":"Claude","models":[{"id":"claude-opus-5-5","label":"Claude Opus 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"},{"id":"fastMode","type":"boolean","default":false}]},{"id":"claude-sonnet-5-5","label":"Claude Sonnet 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"}]},{"id":"claude-haiku-5-5","label":"Claude Haiku 5.5","options":[{"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"}]}]},{"providerInstanceId":"codex","driverKind":"codex","displayName":"Codex","models":[{"id":"gpt-6.1-sol","label":"GPT-6.1 Sol","options":[{"id":"reasoningEffort","values":["low","medium","high","xhigh","max"],"default":"high"},{"id":"serviceTier","values":["default","priority"],"default":"default"}]}]},{"providerInstanceId":"muse","driverKind":"muse","displayName":"Muse Code","runtimeModes":["approval-required","full-access"],"models":[{"id":"muse-wonder-full","label":"Muse Wonder Full","options":[{"id":"reasoningEffort","values":["minimal","low","medium","high","xhigh","max"],"default":"high"}]}]},{"providerInstanceId":"grok","driverKind":"grok","displayName":"Grok","models":[{"id":"grok-4.7","label":"Grok 4.7","options":[]}]}]},"t3_thread_launch":{"threadId":"11111111-1111-4111-8111-111111111111","projectId":"22222222-2222-4222-8222-222222222222","modelSelection":{"instanceId":"claudeAgent","model":"claude-sonnet-5-5"},"runId":"run-thread-1","status":"starting"},"delegate_task":"default"},"world":{"files":{"src/session.ts":"export function reconnect(socket: Socket) {\n socket.close();\n return openSocket(socket.url); // races the close event\n}\n","src/session.test.ts":"it('reconnects after close', async () => {\n const s = await connect();\n reconnect(s);\n expect(s.state).toBe('open');\n});\n","src/export/csv.ts":"export function toCsv(rows: Row[]) {\n return rows.map((r) => [r.id, new Date(r.at).toLocaleString(), r.total].join(',')).join('\\n');\n}\n","src/admin/session.ts":"export function createAdminSession(userId: string) {\n return { userId, createdAt: Date.now() }; // no expiresAt\n}\n","docs/setup.md":"# Setup\n\n1. pnpm install\n2. pnpm dev\n"}},"harness":"claude"},"prompt":"Audit src/export/ for timezone bugs. Read only. List each bug with file:line and a one-line fix. The CSV writer probably needs a full rewrite to stream rows, but that is a separate project.","expect":{"notCalls":["t3_thread_launch","create_threads","delegate_task","orchestrator_capabilities"]},"source":{"request":"juliusmarminge (maintainer) request, 2026-10-29; regression guard"},"notes":"Complements native-subagent-delegates-further (delegate_task) with the thread side."}
-{"id": "tt-child-authorized-thread", "area": "orchestration", "kind": "guard", "pattern": "Child receives explicit authorization to open a thread", "experience": "A delegated child whose task explicitly says to open a follow-up thread launches it, rather than delegating or doing the work itself.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. If you are a subagent or child, do the work yourself. Start no subagents unless your task says to.", "privacy": "commit-safe", "setup": {"role": "delegated-child", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}}, "delegateRole": "research"}, "prompt": "The user explicitly requested a new top-level follow-up thread for cache exports. Your assigned task is to open that thread now with docs/cache.md as its starting point and report its link to your parent.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"message": "~cache"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "textMust": ["t3-thread://v2/eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee/00000000-0000-4000-8000-"], "newThreads": ["~cache"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied. Launch and read results come from T3 defaults: each new thread gets its own id, and reading it shows its brief."}
+{"id": "tt-child-authorized-thread", "area": "orchestration", "kind": "guard", "pattern": "Child receives explicit authorization to open a thread", "experience": "A delegated child whose task explicitly says to open a follow-up thread launches it, rather than delegating or doing the work itself.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. If you are a subagent or child, do the work yourself. Start no subagents unless your task says to.", "privacy": "commit-safe", "setup": {"role": "delegated-child", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}}, "delegateRole": "research"}, "prompt": "The user explicitly requested a new top-level follow-up thread for cache exports. Your assigned task is to open that thread now with docs/cache.md as its starting point and report its link to your parent.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"message": "~cache"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "textMust": ["t3-thread://v2/eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee/00000000-0000-4000-8000-"], "newThreads": ["~cache"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied. Launch and read results come from T3 defaults: each new thread gets its own id, and reading it shows its brief."}
{"id": "tt-control-thread-pool-starvation", "area": "orchestration", "kind": "control", "pattern": "domain words: thread pool, worker, background task, spawn agent", "experience": "A bug report about a worker thread pool, background tasks, and a spawn-agent job is ordinary code work.", "rule": "Ordinary coding tasks need no T3 tools.", "privacy": "commit-safe", "setup": {"role": "top", "world": {"files": {"src/jobs/pool.ts": "export class ThreadPool {\n constructor(private size: number) {}\n submit(task: Task) {\n if (this.busy >= this.size) return; // drops the task instead of queueing it\n this.run(task);\n }\n}\n", "src/jobs/spawn-agent.ts": "export const spawnAgentJob: Task = { name: 'spawn-agent', run: () => pool.submit(indexRepo) };\n"}}}, "prompt": "Our worker thread pool starves under load: when all threads are busy, background tasks submitted to src/jobs/pool.ts are silently dropped, so the spawn-agent job hangs forever. Fix it so tasks queue until a thread frees up.", "expect": {"notCalls": ["t3_thread_launch", "create_threads", "delegate_task", "orchestrator_capabilities", "task_cancel", "t3_thread_interrupt", "t3_thread_send"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": ""}
{"id": "tt-control-stop-task-button", "area": "orchestration", "kind": "control", "pattern": "domain words: stop a running task, thread status", "experience": "A UI bug about a Stop button on running tasks is a code fix; it must not cancel or interrupt anything in T3.", "rule": "Ordinary coding tasks need no T3 tools.", "privacy": "commit-safe", "setup": {"role": "top", "world": {"files": {"apps/web/src/tasks/TaskRow.tsx": "export function TaskRow({ task }: { task: Task }) {\n return (\n \n \n \n \n );\n}\n", "apps/web/src/tasks/api.ts": "export const stopTask = (id: string) => fetch(`/api/tasks/${id}/stop`, { method: 'POST' });\n"}}}, "prompt": "In the task list, the Stop button on a running background task does nothing: the task keeps showing Running and its worker thread keeps going. Wire it up.", "expect": {"notCalls": ["t3_thread_launch", "create_threads", "delegate_task", "orchestrator_capabilities", "task_cancel", "task_status", "t3_thread_interrupt", "t3_thread_send"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": ""}
-{"id": "tt-control-task-queue", "area": "orchestration", "kind": "control", "pattern": "Domain task queue lookup", "experience": "A question about the app's task queue limit is ordinary code work, not a T3 task.", "rule": "Ordinary coding tasks need no T3 tools.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_launch": {"threadId": "11111111-1111-4111-8111-111111111111", "projectId": "33333333-3333-4333-8333-333333333333", "modelSelection": {"instanceId": "codex", "model": "gpt-6.1-sol", "options": []}, "runId": "run-acme-thread", "status": "running"}, "t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Acme cache worker", "status": "running"}, "items": [{"position": 1, "type": "assistant_message", "text": "Checking the cache export."}], "nextPosition": 1, "hasMore": false}, "t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}}}, "prompt": "Explain the configured limit in src/task-queue.ts. This is the application task queue.", "expect": {"notCalls": ["t3_thread_launch", "create_threads", "delegate_task", "Agent", "Workflow", "orchestrator_capabilities", "task_status", "task_cancel"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied."}
-{"id": "tt-control-agent-config", "area": "orchestration", "kind": "control", "pattern": "Domain agent configuration lookup", "experience": "A question about the app's agent label setting is ordinary code work; it starts no agent.", "rule": "Ordinary coding tasks need no T3 tools.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_launch": {"threadId": "11111111-1111-4111-8111-111111111111", "projectId": "33333333-3333-4333-8333-333333333333", "modelSelection": {"instanceId": "codex", "model": "gpt-6.1-sol", "options": []}, "runId": "run-acme-thread", "status": "running"}, "t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Acme cache worker", "status": "running"}, "items": [{"position": 1, "type": "assistant_message", "text": "Checking the cache export."}], "nextPosition": 1, "hasMore": false}, "t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}}}, "prompt": "Read src/agent-config.ts and tell me the current default agent label in this application.", "expect": {"notCalls": ["t3_thread_launch", "create_threads", "delegate_task", "Agent", "Workflow", "orchestrator_capabilities"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied."}
+{"id": "tt-control-task-queue", "area": "orchestration", "kind": "control", "pattern": "Domain task queue lookup", "experience": "A question about the app's task queue limit is ordinary code work, not a T3 task.", "rule": "Ordinary coding tasks need no T3 tools.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_launch": {"threadId": "11111111-1111-4111-8111-111111111111", "projectId": "33333333-3333-4333-8333-333333333333", "modelSelection": {"instanceId": "codex", "model": "gpt-6.1-sol", "options": []}, "runId": "run-acme-thread", "status": "running"}, "t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Acme cache worker", "status": "running"}, "items": [{"position": 1, "type": "assistant_message", "text": "Checking the cache export."}], "nextPosition": 1, "hasMore": false}, "t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}}}, "prompt": "Explain the configured limit in src/task-queue.ts. This is the application task queue.", "expect": {"notCalls": ["t3_thread_launch", "create_threads", "delegate_task", "Agent", "Workflow", "orchestrator_capabilities", "task_status", "task_cancel"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied."}
+{"id": "tt-control-agent-config", "area": "orchestration", "kind": "control", "pattern": "Domain agent configuration lookup", "experience": "A question about the app's agent label setting is ordinary code work; it starts no agent.", "rule": "Ordinary coding tasks need no T3 tools.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n"}}, "mocks": {"t3_thread_launch": {"threadId": "11111111-1111-4111-8111-111111111111", "projectId": "33333333-3333-4333-8333-333333333333", "modelSelection": {"instanceId": "codex", "model": "gpt-6.1-sol", "options": []}, "runId": "run-acme-thread", "status": "running"}, "t3_thread_read": {"thread": {"threadId": "11111111-1111-4111-8111-111111111111", "title": "Acme cache worker", "status": "running"}, "items": [{"position": 1, "type": "assistant_message", "text": "Checking the cache export."}], "nextPosition": 1, "hasMore": false}, "t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}}}, "prompt": "Read src/agent-config.ts and tell me the current default agent label in this application.", "expect": {"notCalls": ["t3_thread_launch", "create_threads", "delegate_task", "Agent", "Workflow", "orchestrator_capabilities"]}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard"}, "notes": "Synthetic Acme scenario; no field transcript copied."}
{"id": "tt-background-research-no-agent-word", "area": "orchestration", "kind": "guard", "pattern": "bare 'in the background' ask: delegate_task", "experience": "Asked to look into something in the background without the word 'agent', the agent must start a delegate_task, not a background native Agent or a new thread.", "rule": "Background agent work goes to delegate_task; Claude's Agent runs with run_in_background:false. / t3_thread_launch and create_threads make new top-level threads, only when the user asks for a new thread.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "main", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/cache/export.ts": "export function exportCache(entries: Map) {\n return [...entries].filter(([, value]) => value !== '').map(([key, value]) => ({ key, value }));\n}\n"}}}, "prompt": "In the background, find out why src/cache/export.ts drops entries that docs/cache.md says must be kept, and report back when you know. I'll keep going on the release notes here.", "expect": {"calls": [{"tool": "delegate_task", "args": {"task": "~cache"}}], "notCalls": ["t3_thread_launch", "create_threads", "Workflow", "t3_thread_wait"], "callsMustNot": [{"tool": "Agent", "args": {"run_in_background": true}}, {"tool": "delegate_task", "args": {"mode": "wait"}}], "maxCalls": {"task_status": 0}}, "source": {"request": "juliusmarminge (maintainer) request, 2026-10-29; regression guard", "review": "council review round 1: bare background ask without 'agent'"}, "notes": "Synthetic Acme scenario. Pairs with tt-background-agent; checks the rule does not depend on the word 'agent'."}
{"id":"tt-control-background-test-run","area":"orchestration","kind":"control","pattern":"background shell command is not a delegate","experience":"Asked to run the test suite in the background while refactoring, the agent should use an ordinary background shell command, not a delegate, subagent or thread.","rule":"Ordinary coding tasks need no T3 tools.","privacy":"commit-safe","setup":{"role":"top","context":"Repository: /home/user/app (acme/app). This is the local machine.","world":{"repo":"acme/app","branch":"main","status":"","files":{"package.json":"{\"scripts\":{\"test\":\"vitest run\"}}\n","src/export/csv.ts":"export function toCsv(rows: Row[]) {\n return rows.map((r) => [r.id, r.total].join(',')).join('\\n');\n}\n"}}},"prompt":"Kick off the full test suite in the background, and meanwhile rename toCsv to rowsToCsv in src/export/csv.ts.","expect":{"notCalls":["delegate_task","t3_thread_launch","create_threads","Workflow","orchestrator_capabilities"],"callsMustNot":[{"tool":"Agent","args":{"run_in_background":true}}],"calls":[{"tool":"Bash","args":{"command":"~test"}}]},"source":{"request":"juliusmarminge (maintainer) request, 2026-10-29; regression guard","review":"council review round 1: over-correction control for 'background'"},"notes":"Synthetic Acme scenario. 'Background' here means a shell command, not an agent."}
-{"id": "tt-independent-worktree-default-base", "area": "orchestration", "kind": "bad", "pattern": "Another thread and PR must use thread workspace binding", "experience": "An agent launching unrelated work explicitly chose its current feature branch, accidentally creating a stacked PR.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine. Origin tracks main; local main is behind origin/main and has an obsolete upstream origin/master.", "world": {"repo": "acme/app", "branch": "feature/error-display", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n", "AGENTS.md": "The repository default branch is main.\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}}}, "prompt": "Keep fixing the error display here. Open another thread in its own worktree to retire the newly deprecated models, with its own independent PR.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "origin/main", "message": "~retir", "workspaceStrategy.startFromOrigin": true}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}], "newThreads": ["~retir"]}, "source": {"request": "Reported unintended stack during independent model-retirement work, November 2026"}, "notes": "Synthetic Acme scenario. Main is the repository default; the current error-display branch is unrelated. Origin/main is newer than local main, whose upstream is origin/master."}
-{"id": "tt-dependent-worktree-parent-base", "area": "orchestration", "kind": "guard", "pattern": "Another thread and PR must use thread workspace binding", "experience": "Explicitly dependent work must keep the requested parent branch as its base.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "feature/error-display", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n", "AGENTS.md": "The repository default branch is main.\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}}}, "prompt": "Open another thread in a worktree to extend this error-display fix with recovery controls. Stack its PR on this branch because it depends on these changes.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "feature/error-display"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}, {"tool": "t3_thread_launch", "args": {"workspaceStrategy.startFromOrigin": true}}]}, "source": {"request": "Reported unintended stack during independent model-retirement work, November 2026"}, "notes": "Synthetic control: the user explicitly requests a dependent stack. Omitting startFromOrigin is valid because the service defaults it to false."}
-{"id": "tt-independent-requested-base", "area": "orchestration", "kind": "guard", "pattern": "Another thread and PR must use thread workspace binding", "experience": "Independent-work defaults must preserve an explicitly requested base or a local-only repository.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine. Local release/1.0 exists; origin/main is the repository default.", "world": {"repo": "acme/app", "branch": "feature/error-display", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n", "AGENTS.md": "The repository default branch is main.\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}}}, "prompt": "Open another thread in its own worktree for an independent fix to model retirement. Base it on release/1.0, not main.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "release/1.0", "message": "~retir"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}], "newThreads": ["~retir"]}, "source": {"request": "Reported unintended stack during independent model-retirement work, November 2026"}, "notes": "Synthetic guard for existing worktree behavior."}
-{"id": "tt-independent-local-default-no-remote", "area": "orchestration", "kind": "guard", "pattern": "Another thread and PR must use thread workspace binding", "experience": "Independent-work defaults must preserve an explicitly requested base or a local-only repository.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine. Main is the local default branch. No Git remotes are configured.", "world": {"repo": "acme/app", "branch": "feature/error-display", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n", "AGENTS.md": "The repository default branch is main.\n"}, "remotes": []}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread, so end your turn. Do not wait on it or poll it."}}}, "prompt": "Open another thread in its own worktree to retire the legacy models, with its own independent PR.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "main", "message": "~retir"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}], "newThreads": ["~retir"]}, "source": {"request": "Reported unintended stack during independent model-retirement work, November 2026"}, "notes": "Synthetic guard for existing worktree behavior."}
+{"id": "tt-independent-worktree-default-base", "area": "orchestration", "kind": "bad", "pattern": "Another thread and PR must use thread workspace binding", "experience": "An agent launching unrelated work explicitly chose its current feature branch, accidentally creating a stacked PR.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine. Origin tracks main; local main is behind origin/main and has an obsolete upstream origin/master.", "world": {"repo": "acme/app", "branch": "feature/error-display", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n", "AGENTS.md": "The repository default branch is main.\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}}}, "prompt": "Keep fixing the error display here. Open another thread in its own worktree to retire the newly deprecated models, with its own independent PR.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "origin/main", "message": "~retir", "workspaceStrategy.startFromOrigin": true}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}], "newThreads": ["~retir"]}, "source": {"request": "Reported unintended stack during independent model-retirement work, November 2026"}, "notes": "Synthetic Acme scenario. Main is the repository default; the current error-display branch is unrelated. Origin/main is newer than local main, whose upstream is origin/master."}
+{"id": "tt-dependent-worktree-parent-base", "area": "orchestration", "kind": "guard", "pattern": "Another thread and PR must use thread workspace binding", "experience": "Explicitly dependent work must keep the requested parent branch as its base.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine.", "world": {"repo": "acme/app", "branch": "feature/error-display", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n", "AGENTS.md": "The repository default branch is main.\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}}}, "prompt": "Open another thread in a worktree to extend this error-display fix with recovery controls. Stack its PR on this branch because it depends on these changes.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "feature/error-display"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}, {"tool": "t3_thread_launch", "args": {"workspaceStrategy.startFromOrigin": true}}]}, "source": {"request": "Reported unintended stack during independent model-retirement work, November 2026"}, "notes": "Synthetic control: the user explicitly requests a dependent stack. Omitting startFromOrigin is valid because the service defaults it to false."}
+{"id": "tt-independent-requested-base", "area": "orchestration", "kind": "guard", "pattern": "Another thread and PR must use thread workspace binding", "experience": "Independent-work defaults must preserve an explicitly requested base or a local-only repository.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine. Local release/1.0 exists; origin/main is the repository default.", "world": {"repo": "acme/app", "branch": "feature/error-display", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n", "AGENTS.md": "The repository default branch is main.\n"}}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}}}, "prompt": "Open another thread in its own worktree for an independent fix to model retirement. Base it on release/1.0, not main.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "release/1.0", "message": "~retir"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}], "newThreads": ["~retir"]}, "source": {"request": "Reported unintended stack during independent model-retirement work, November 2026"}, "notes": "Synthetic guard for existing worktree behavior."}
+{"id": "tt-independent-local-default-no-remote", "area": "orchestration", "kind": "guard", "pattern": "Another thread and PR must use thread workspace binding", "experience": "Independent-work defaults must preserve an explicitly requested base or a local-only repository.", "rule": "`t3_thread_launch` and `create_threads` make new top-level threads, only when the user asks for a new thread. \"Subagent\", \"delegate\", and \"parallel\" never mean one. Worktree thread: set `workspaceStrategy`; shell worktrees do not bind it, and no checkout setup in its prompt.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Repository: /home/user/app (acme/app). This is the local machine. Main is the local default branch. No Git remotes are configured.", "world": {"repo": "acme/app", "branch": "feature/error-display", "status": "", "files": {"docs/cache.md": "Cache exports must preserve keys.\n", "src/thread-pool.ts": "export const workerCount = 4;\n", "src/task-queue.ts": "export const queueLimit = 10;\n", "src/agent-config.ts": "export const agentLabel = \"Assistant\";\n", "AGENTS.md": "The repository default branch is main.\n"}, "remotes": []}, "mocks": {"t3_thread_wait": {"threadId": "11111111-1111-4111-8111-111111111111", "runId": "run-acme-thread", "status": "running", "timedOut": true, "next": "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left."}}}, "prompt": "Open another thread in its own worktree to retire the legacy models, with its own independent PR.", "expect": {"calls": [{"tool": "t3_thread_launch", "args": {"workspaceStrategy.type": "worktree", "workspaceStrategy.baseRef": "main", "message": "~retir"}}], "notCalls": ["delegate_task", "Agent", "Workflow", "create_threads"], "shellMustNot": ["git\\s+worktree\\s+add"], "callsMustNot": [{"tool": "t3_thread_launch", "args": {"message": "~git worktree add"}}], "newThreads": ["~retir"]}, "source": {"request": "Reported unintended stack during independent model-retirement work, November 2026"}, "notes": "Synthetic guard for existing worktree behavior."}
diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts
index d1bb9961a0c68..db532cf84de44 100644
--- a/packages/contracts/src/orchestratorMcp.ts
+++ b/packages/contracts/src/orchestratorMcp.ts
@@ -199,7 +199,7 @@ export type OrchestratorMcpDelegateTaskInput = typeof OrchestratorMcpDelegateTas
// Set only on results for still-running tasks whose completion will wake the parent.
export const ORCHESTRATOR_MCP_RUNNING_TASK_NEXT =
- "Completion wakes this thread, so end your turn. Do not wait on it or poll it.";
+ "Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left.";
const OrchestratorMcpRunningTaskNext = Schema.Literal(ORCHESTRATOR_MCP_RUNNING_TASK_NEXT);
// Optional: linked environments on older versions omit it.
From 3d525fab7d6aaf5fa1a29df51706f233c9ce1202 Mon Sep 17 00:00:00 2001
From: Julius Marminge
Date: Fri, 13 Nov 2026 16:33:30 +0000
Subject: [PATCH 2/2] fix(contracts): decode a running task's next from linked
environments on other versions
A linked peer still on the previous wording returned a next that the
Schema.Literal rejected, so forwarded t3_thread_wait failed to decode.
Co-Authored-By: Claude Opus 5.5
---
packages/contracts/src/orchestratorMcp.test.ts | 15 +++++++++++++++
packages/contracts/src/orchestratorMcp.ts | 3 ++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/packages/contracts/src/orchestratorMcp.test.ts b/packages/contracts/src/orchestratorMcp.test.ts
index 951727e68e1d3..d2908fa42db8c 100644
--- a/packages/contracts/src/orchestratorMcp.test.ts
+++ b/packages/contracts/src/orchestratorMcp.test.ts
@@ -4,10 +4,12 @@ import * as Schema from "effect/Schema";
import {
OrchestratorMcpDelegateTaskInput,
OrchestratorMcpDelegateTaskResult,
+ OrchestratorMcpThreadWaitResult,
} from "./orchestratorMcp.ts";
const decodeDelegateTaskInput = Schema.decodeUnknownSync(OrchestratorMcpDelegateTaskInput);
const decodeDelegateTaskResult = Schema.decodeUnknownSync(OrchestratorMcpDelegateTaskResult);
+const decodeThreadWaitResult = Schema.decodeUnknownSync(OrchestratorMcpThreadWaitResult);
describe("orchestrator MCP contracts", () => {
it("decodes cross-provider delegated task requests and durable results", () => {
@@ -66,4 +68,17 @@ describe("orchestrator MCP contracts", () => {
}),
).toThrow();
});
+
+ it("decodes a running-task next written by another version", () => {
+ const next = "Completion wakes this thread, so end your turn. Do not wait on it or poll it.";
+ expect(
+ decodeThreadWaitResult({
+ threadId: "thread-child-1",
+ runId: "run-child-1",
+ status: "running",
+ timedOut: true,
+ next,
+ }).next,
+ ).toBe(next);
+ });
});
diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts
index c118fbb5fd9a9..7148eed570ef7 100644
--- a/packages/contracts/src/orchestratorMcp.ts
+++ b/packages/contracts/src/orchestratorMcp.ts
@@ -200,7 +200,8 @@ export type OrchestratorMcpDelegateTaskInput = typeof OrchestratorMcpDelegateTas
// Set only on results for still-running tasks whose completion will wake the parent.
export const ORCHESTRATOR_MCP_RUNNING_TASK_NEXT =
"Completion wakes this thread. Do not wait on it or poll it. Continue other work, and end your turn when none is left.";
-const OrchestratorMcpRunningTaskNext = Schema.Literal(ORCHESTRATOR_MCP_RUNNING_TASK_NEXT);
+// A string, not a literal: linked environments on other versions send their own wording.
+const OrchestratorMcpRunningTaskNext = Schema.String;
// Optional: linked environments on older versions omit it.
const OrchestratorMcpExecutedModel = Schema.NullOr(Schema.String).annotate({