@@ -46,15 +46,19 @@ import { ProviderDriverKind, ProviderInstanceId } from "./providerInstance.ts";
4646
4747const OrchestratorMcpPrompt = TrimmedNonEmptyString . check ( Schema . isMaxLength ( 120_000 ) ) ;
4848const OrchestratorMcpTitle = TrimmedNonEmptyString . check ( Schema . isMaxLength ( 512 ) ) ;
49- export const OrchestratorMcpClientRequestId = TrimmedNonEmptyString . check ( Schema . isMaxLength ( 256 ) )
50- . check (
51- Schema . makeFilter ( ( value ) =>
52- hasOnlyPairedSurrogates ( value )
53- ? true
54- : "clientRequestId must contain valid paired Unicode surrogates." ,
55- ) ,
56- )
57- . annotate ( { description : "Reuse it to retry the same call. A new call gets a new key." } ) ;
49+ export const OrchestratorMcpClientRequestId = TrimmedNonEmptyString . check (
50+ Schema . isMaxLength ( 256 ) ,
51+ ) . check (
52+ Schema . makeFilter ( ( value ) =>
53+ hasOnlyPairedSurrogates ( value )
54+ ? true
55+ : "clientRequestId must contain valid paired Unicode surrogates." ,
56+ ) ,
57+ ) ;
58+ // Described on the optional field: a description on a trimmed string misses its encoded JSON schema.
59+ export const OrchestratorMcpOptionalClientRequestId = Schema . optional (
60+ OrchestratorMcpClientRequestId ,
61+ ) . annotate ( { description : "Reuse it to retry the same call. A new call gets a new key." } ) ;
5862
5963// OpenCode 1.15 serializes nested MCP union objects as JSON strings; decode that form at the boundary.
6064const OrchestratorMcpScheduleFromJsonString = Schema . fromJsonString (
@@ -186,7 +190,7 @@ export const OrchestratorMcpDelegateTaskInput = Schema.Struct({
186190 timeoutMs : Schema . optional ( Schema . Finite ) . annotate ( {
187191 description : "Mode 'wait' only. Default 10 min. A timeout does not cancel the child." ,
188192 } ) ,
189- clientRequestId : Schema . optional ( OrchestratorMcpClientRequestId ) ,
193+ clientRequestId : OrchestratorMcpOptionalClientRequestId ,
190194 runtimeMode : Schema . optional (
191195 OrchestratorMcpRuntimeMode . annotate ( {
192196 description :
@@ -256,7 +260,7 @@ export type OrchestratorMcpTaskStatusInput = typeof OrchestratorMcpTaskStatusInp
256260export const OrchestratorMcpTaskCancelInput = Schema . Struct ( {
257261 taskId : NodeId ,
258262 reason : Schema . optional ( Schema . String . check ( Schema . isMaxLength ( 2_000 ) ) ) ,
259- clientRequestId : Schema . optional ( OrchestratorMcpClientRequestId ) ,
263+ clientRequestId : OrchestratorMcpOptionalClientRequestId ,
260264} ) ;
261265export type OrchestratorMcpTaskCancelInput = typeof OrchestratorMcpTaskCancelInput . Type ;
262266
@@ -280,7 +284,7 @@ export const OrchestratorMcpCreateThreadsInput = Schema.Struct({
280284 Schema . isMinLength ( 1 ) ,
281285 Schema . isMaxLength ( 20 ) ,
282286 ) ,
283- clientRequestId : Schema . optional ( OrchestratorMcpClientRequestId ) ,
287+ clientRequestId : OrchestratorMcpOptionalClientRequestId ,
284288} ) ;
285289export type OrchestratorMcpCreateThreadsInput = typeof OrchestratorMcpCreateThreadsInput . Type ;
286290
@@ -524,7 +528,7 @@ export const OrchestratorMcpThreadSendInput = Schema.Struct({
524528 "Start a new provider session without the thread's earlier context, like /clear. Never steers." ,
525529 } ) ,
526530 ) ,
527- clientRequestId : Schema . optional ( OrchestratorMcpClientRequestId ) ,
531+ clientRequestId : OrchestratorMcpOptionalClientRequestId ,
528532} ) ;
529533export type OrchestratorMcpThreadSendInput = typeof OrchestratorMcpThreadSendInput . Type ;
530534
@@ -575,7 +579,7 @@ export const OrchestratorMcpThreadInterruptInput = Schema.Struct({
575579 * watches and stop every task it delegated. `runId` is then not used.
576580 */
577581 stop : Schema . optional ( Schema . Boolean ) ,
578- clientRequestId : Schema . optional ( OrchestratorMcpClientRequestId ) ,
582+ clientRequestId : OrchestratorMcpOptionalClientRequestId ,
579583} ) ;
580584export type OrchestratorMcpThreadInterruptInput = typeof OrchestratorMcpThreadInterruptInput . Type ;
581585
@@ -688,7 +692,7 @@ export const OrchestratorMcpScheduleTaskInput = Schema.Struct({
688692 "Runs share one thread but each starts a fresh session without earlier runs' context. Unbound: the first run makes the thread." ,
689693 } ) ,
690694 ) ,
691- clientRequestId : Schema . optional ( OrchestratorMcpClientRequestId ) ,
695+ clientRequestId : OrchestratorMcpOptionalClientRequestId ,
692696} ) ;
693697export type OrchestratorMcpScheduleTaskInput = typeof OrchestratorMcpScheduleTaskInput . Type ;
694698
@@ -837,7 +841,7 @@ export const OrchestratorMcpEnvironmentLinkInput = Schema.Struct({
837841 requestedAccess : Schema . optional ( AuthMcpClientAccess ) . annotate ( {
838842 description : "Suggested access. The user picks; default approval-required." ,
839843 } ) ,
840- clientRequestId : Schema . optional ( OrchestratorMcpClientRequestId ) ,
844+ clientRequestId : OrchestratorMcpOptionalClientRequestId ,
841845} ) ;
842846export type OrchestratorMcpEnvironmentLinkInput = typeof OrchestratorMcpEnvironmentLinkInput . Type ;
843847
0 commit comments