diff --git a/pins.json b/pins.json index 6151e17..e84d2a4 100644 --- a/pins.json +++ b/pins.json @@ -23,7 +23,7 @@ }, "t3": { "repo": "pingdotgg/t3code", - "commit": "67eebaca23f8f7bc46e8817434087fc9c5acf8e3", + "commit": "2756da402b5d795baa05762cba1706a2c0e2fac8", "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 150962e..f0affbf 100644 --- a/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts +++ b/t3/contract/apps/server/src/mcp/toolkits/orchestrator/tools.ts @@ -197,7 +197,7 @@ const DeleteScheduledTaskTool = Tool.make("delete_scheduled_task", { const RequestSecretTool = Tool.make("request_secret", { description: - '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.', + 'Ask for one secret per single-line card; never combine values. Open it, don\'t offer it. Returns one-use `secretRef`, or `delivery: "file"` a file read only in its command, e.g. `adb pair "$(cat )"`. Asked how: call now. Pasted secret for child/script: `value`. Never from an old thread.', parameters: OrchestratorMcpRequestSecretInput, success: OrchestratorMcpRequestSecretResult, failure: OrchestratorMcpFailure, diff --git a/t3/contract/apps/server/src/mcp/toolkits/project/tools.ts b/t3/contract/apps/server/src/mcp/toolkits/project/tools.ts index f02042e..5679995 100644 --- a/t3/contract/apps/server/src/mcp/toolkits/project/tools.ts +++ b/t3/contract/apps/server/src/mcp/toolkits/project/tools.ts @@ -141,7 +141,7 @@ const ThreadLaunchTool = Tool.make("t3_thread_launch", { workspaceStrategy: Schema.optional( OrchestrationV2ThreadLaunchWorkspaceStrategy.annotate({ description: - "'worktree': new checkout from `baseRef`. 'existing_worktree': bind `worktreePath`, a project worktree. 'root': project checkout, the default, not your worktree. Stack: parent branch as `baseRef`, `startFromOrigin: false`. Uncommitted edits are not copied.", + "'worktree': new checkout from `baseRef`. Honor a requested base. Otherwise, independent work uses the default branch as `remote/branch` (e.g. `origin/main`) with `startFromOrigin: true`; with no remote, use the local default branch. Required unpublished commits and dependent or stacked work use their local base with `startFromOrigin: false`. 'existing_worktree': bind `worktreePath`, a project worktree. 'root': project checkout, the default, not your worktree. Uncommitted edits are not copied.", }), ), message: Schema.optional( diff --git a/t3/contract/apps/server/src/mcp/toolkits/pullRequests/tools.ts b/t3/contract/apps/server/src/mcp/toolkits/pullRequests/tools.ts index 789e9fe..e86bf30 100644 --- a/t3/contract/apps/server/src/mcp/toolkits/pullRequests/tools.ts +++ b/t3/contract/apps/server/src/mcp/toolkits/pullRequests/tools.ts @@ -104,15 +104,6 @@ export class PullRequestThreadRequiredError extends Schema.TaggedError()( - "PullRequestThreadNotFoundError", - { threadId: Schema.String }, -) { - override get message(): string { - return `Thread ${this.threadId} was not found.`; - } -} - export class PullRequestLinkFailedError extends Schema.TaggedError()( "PullRequestLinkFailedError", { cause: Schema.Defect() }, @@ -193,7 +184,6 @@ export const PullRequestToolError = Schema.Union([ PullRequestHostRequiredError, PullRequestUrlUnavailableError, PullRequestThreadRequiredError, - PullRequestThreadNotFoundError, PullRequestLinkFailedError, PullRequestUnlinkFailedError, PullRequestListFailedError, diff --git a/t3/contract/packages/contracts/src/device.ts b/t3/contract/packages/contracts/src/device.ts index 417d1c8..a36f796 100644 --- a/t3/contract/packages/contracts/src/device.ts +++ b/t3/contract/packages/contracts/src/device.ts @@ -79,8 +79,11 @@ export const SimlockDeviceHostConfig = Schema.Struct({ label: TrimmedNonEmptyString, /** The gateway's origin, such as https://gateway.example.ts.net:4700. */ gatewayUrl: TrimmedNonEmptyString.check(Schema.isPattern(/^https?:\/\/[^\s/]+\/?$/)), - /** Leases, drives, watches, and takes input on its own leases. Kept in the secret store. */ - agentToken: TrimmedString.pipe( + /** + * Leases, drives, watches, and takes input on its own leases. Kept in the secret store, or the + * secret provider to read it from. + */ + agentToken: SettingsSecretValue.pipe( Schema.withDecodingDefaultKey(Effect.succeed("")), Schema.annotateKey({ settingsSecret: true }), ), @@ -133,7 +136,7 @@ export const DeviceSimlockIdentityInput = Schema.Struct({ gatewayUrl: Schema.optional(TrimmedString), /** A saved Simlock host whose stored token is checked when no new token is given. */ hostId: Schema.optional(DeviceHostId), - agentToken: Schema.optional(TrimmedString), + agentToken: Schema.optional(SettingsSecretValue), }); export type DeviceSimlockIdentityInput = typeof DeviceSimlockIdentityInput.Type; diff --git a/t3/contract/packages/contracts/src/orchestratorMcp.ts b/t3/contract/packages/contracts/src/orchestratorMcp.ts index 6756225..c73bbd4 100644 --- a/t3/contract/packages/contracts/src/orchestratorMcp.ts +++ b/t3/contract/packages/contracts/src/orchestratorMcp.ts @@ -503,6 +503,12 @@ export const OrchestratorMcpThreadSendInput = Schema.Struct({ threadId: ThreadId, message: OrchestratorMcpPrompt, mode: Schema.optional(Schema.Literals(["auto", "queue", "steer", "restart"])), + freshContext: Schema.optional( + Schema.Boolean.annotate({ + description: + "Start a new provider session without the thread's earlier context, like /clear. Never steers.", + }), + ), clientRequestId: Schema.optional(OrchestratorMcpClientRequestId), }); export type OrchestratorMcpThreadSendInput = typeof OrchestratorMcpThreadSendInput.Type; @@ -661,6 +667,12 @@ export const OrchestratorMcpScheduleTaskInput = Schema.Struct({ description: "Default true: runs post in this thread. False: new thread per run.", }), ), + freshSession: Schema.optional( + Schema.Boolean.annotate({ + description: + "Runs share one thread but each starts a fresh session without earlier runs' context. Unbound: the first run makes the thread.", + }), + ), clientRequestId: Schema.optional(OrchestratorMcpClientRequestId), }); export type OrchestratorMcpScheduleTaskInput = typeof OrchestratorMcpScheduleTaskInput.Type; @@ -682,6 +694,7 @@ export const OrchestratorMcpScheduledTask = Schema.Struct({ enabled: Schema.Boolean, projectId: ProjectId, boundThreadId: Schema.NullOr(ThreadId), + freshSession: Schema.Boolean, schedule: ScheduledTaskSchedule, nextRunAt: Schema.NullOr(IsoDateTime), lastRunStatus: ScheduledTaskRunStatus, @@ -724,6 +737,7 @@ export const OrchestratorMcpUpdateScheduledTaskInput = Schema.Struct({ schedule: Schema.optional(OrchestratorMcpSchedule), enabled: Schema.optional(Schema.Boolean), bindToCurrentThread: Schema.optional(Schema.Boolean), + freshSession: Schema.optional(Schema.Boolean), }); export type OrchestratorMcpUpdateScheduledTaskInput = typeof OrchestratorMcpUpdateScheduledTaskInput.Type; diff --git a/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts b/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts index efe3fc2..703e186 100644 --- a/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts +++ b/t3/contract/packages/provider-core/src/server/orchestrationInstructions.ts @@ -11,7 +11,7 @@ Ordinary coding tasks need no T3 tools. - Every new delegate review or re-check is a new \`delegate_task\` (brief, findings, objections), never a \`t3_thread_send\`. Fix small review findings yourself; start no delegate for them. When told to proceed without a delegate, or to run fewer, \`task_cancel\` the extras. Start no replacement. - Follow a running delegate's \`next\`. Do not poll it (\`task_status\`, \`sleep\`, watchers, Monitor, ScheduleWakeup). Stop a delegate run you replace or no longer need with \`task_cancel\`, never \`t3_thread_interrupt\` on a \`childThreadId\`. - 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\` 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. No \`workspaceStrategy\`: project root, not your worktree. + `- \`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\`. Honor a requested base. Otherwise, independent work uses the default branch as \`remote/branch\` with \`startFromOrigin:true\`; with no remote, use the local default. Required unpublished commits and dependent work use their local base. Shell worktrees do not bind it, and no checkout setup in its prompt. No \`workspaceStrategy\`: project root, not your worktree. - Given a thread id, \`t3_thread_read\` it before you answer about it. - 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.