From fa51a6962aef2bf8e14f58e870cd2a3dd52a2637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20M=2E=20Wo=C5=BAniak?= Date: Thu, 5 Nov 2026 09:02:20 +0100 Subject: [PATCH] Update T3 contract to 67eebac --- pins.json | 2 +- .../src/mcp/toolkits/orchestrator/tools.ts | 8 +++++--- .../packages/contracts/src/orchestratorMcp.ts | 19 ++++++++++++++----- .../src/server/orchestrationInstructions.ts | 2 +- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/pins.json b/pins.json index 54be188..6151e17 100644 --- a/pins.json +++ b/pins.json @@ -23,7 +23,7 @@ }, "t3": { "repo": "pingdotgg/t3code", - "commit": "8b44f42b14c8e273156474a924ccf29680dd7857", + "commit": "67eebaca23f8f7bc46e8817434087fc9c5acf8e3", "paths": [ "apps/server/src/mcp/toolkits/attachment/tools.ts", "apps/server/src/mcp/toolkits/device/tools.ts", diff --git a/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts b/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts index 7c05f5c..150962e 100644 --- a/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts +++ b/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts @@ -85,7 +85,7 @@ const OrchestratorCapabilitiesTool = Tool.make("orchestrator_capabilities", { const DelegateTaskTool = Tool.make("delegate_task", { description: - "Start one child agent with only `task`. No parent history. Separate checkout or PR per child: `isolation:'worktree'`. Keep `taskId` for `task_status` and `task_cancel`.", + "Start one child agent with only `task`. No parent history. Separate checkout or PR per child: `isolation:'worktree'`. Keep `taskId` for `task_status` and `task_cancel`. No secrets in `task`.", parameters: OrchestratorMcpDelegateTaskInput, success: OrchestratorMcpDelegateTaskResult, failure: OrchestratorMcpFailure, @@ -197,7 +197,7 @@ const DeleteScheduledTaskTool = Tool.make("delete_scheduled_task", { const RequestSecretTool = Tool.make("request_secret", { description: - 'Ask the user to enter a secret in a private card and wait. You never see the value. Returns a one-use `secretRef` for a tool that accepts it, or with `delivery: "file"` a private file path to read inside a shell command. Asked how to provide a secret: call this now, do not explain instead.', + 'Ask for a secret in a private card and wait; open it, don\'t offer it. Returns a one-use `secretRef`, or with `delivery: "file"` a file to read only in its command, e.g. `adb pair "$(cat )"`. Asked how to give one: call now. Pasted secret for child or script: `value`. Not one from an old thread.', parameters: OrchestratorMcpRequestSecretInput, success: OrchestratorMcpRequestSecretResult, failure: OrchestratorMcpFailure, @@ -205,7 +205,9 @@ const RequestSecretTool = Tool.make("request_secret", { dependencies, }) .annotate(Tool.Title, "Request a secret from the user") - .annotate(Tool.Destructive, false); + .annotate(Tool.Destructive, false) + // Claude Code defers MCP tools behind ToolSearch; agents that never load this one ask in chat. + .annotate(Tool.Meta, { "anthropic/alwaysLoad": true }); const CreateThreadsTool = Tool.make("create_threads", { description: diff --git a/t3/contract/packages/contracts/src/orchestratorMcp.ts b/t3/contract/packages/contracts/src/orchestratorMcp.ts index 1d6d7f3..6756225 100644 --- a/t3/contract/packages/contracts/src/orchestratorMcp.ts +++ b/t3/contract/packages/contracts/src/orchestratorMcp.ts @@ -728,6 +728,11 @@ export const OrchestratorMcpUpdateScheduledTaskInput = Schema.Struct({ export type OrchestratorMcpUpdateScheduledTaskInput = typeof OrchestratorMcpUpdateScheduledTaskInput.Type; +// Not trimmed: whitespace in a password matters. The check stays out of the advertised schema. +const PastedSecretValue = Schema.String.check( + Schema.makeFilter((value: string) => value.length > 0, { expected: "a non-empty string" }), +); + export const OrchestratorMcpRequestSecretInput = Schema.Struct({ label: TrimmedNonEmptyString.annotate({ description: "Card title, such as 'GitHub webhook secret'.", @@ -737,14 +742,17 @@ export const OrchestratorMcpRequestSecretInput = Schema.Struct({ }), placeholder: Schema.optional(TrimmedNonEmptyString), delivery: Schema.optional(Schema.Literals(["secretRef", "file"])).annotate({ - description: - 'secretRef (default) for a T3 tool. file for a shell CLI: read the path in your command, e.g. TOKEN="$(cat )" wrangler whoami.', + description: "secretRef (default) for a T3 tool; file for a command.", }), + value: Schema.optional(PastedSecretValue).annotate({ + description: "Pasted in this thread; no card.", + }), + /** Default 10 minutes. */ timeoutMs: Schema.optional( Schema.Int.check(Schema.isBetween({ minimum: 1_000, maximum: 60 * 60 * 1_000 })), - ).annotate({ description: "Default 10 min." }), + ), clientRequestId: Schema.optional(OrchestratorMcpClientRequestId).annotate({ - description: "Retry key for this ask. New key after a timeout or cancel.", + description: "Retry key.", }), }); export type OrchestratorMcpRequestSecretInput = typeof OrchestratorMcpRequestSecretInput.Type; @@ -766,8 +774,9 @@ export const OrchestratorMcpRequestSecretResult = Schema.Union([ Schema.Struct({ status: Schema.Literals(["declined", "cancelled", "timed_out"]).annotate({ description: - "declined: user chose not to. cancelled: ended with the run. timed_out: no answer in time. Ask again with a new `clientRequestId` if still needed.", + "declined: user chose not to; don't ask again. cancelled: ended with the run. timed_out: no answer in time. After cancelled or timed_out, ask again with a new `clientRequestId` only if still needed.", }), + note: Schema.optional(Schema.String).annotate({ description: "What to do next." }), }), ]); export type OrchestratorMcpRequestSecretResult = typeof OrchestratorMcpRequestSecretResult.Type; diff --git a/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts b/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts index 90ed18e..efe3fc2 100644 --- a/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts +++ b/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts @@ -16,7 +16,7 @@ Ordinary coding tasks need no T3 tools. - Another machine: \`t3_environment_links\` lists linked ones. Pass its \`environmentId\` to a T3 tool to act there. Ids are then that machine's, so pass \`threadId\`. - A machine the user names that is not linked ("delegate this to my vps"): call \`t3_environment_link\` with a \`hint\` from their words. Never ask for a pairing code in chat. - In your reply, mention a thread by its \`link\`, verbatim. Never a plain title or bare id. -- A secret: call \`request_secret\` yourself. Pass its \`secretRef\` to a T3 tool, or use \`delivery: "file"\` for a shell command. Never ask in chat or invent one. When asked only to schedule, \`schedule_task\` without running its prompt. +- A login, token, PIN or pairing code only the user can give: call \`request_secret\`, not a chat ask or a handoff. Not for access you have. When asked only to schedule, \`schedule_task\` without running its prompt. - T3 tools may load late. Try the name once before you call it absent.`, `### Visuals and preview