@@ -4,12 +4,55 @@ import * as Schema from "effect/Schema";
44import {
55 OrchestratorMcpDelegateTaskInput ,
66 OrchestratorMcpDelegateTaskResult ,
7+ OrchestratorMcpThreadDetail ,
8+ OrchestratorMcpThreadListItem ,
79} from "./orchestratorMcp.ts" ;
810
911const decodeDelegateTaskInput = Schema . decodeUnknownSync ( OrchestratorMcpDelegateTaskInput ) ;
1012const decodeDelegateTaskResult = Schema . decodeUnknownSync ( OrchestratorMcpDelegateTaskResult ) ;
13+ const decodeThreadListItem = Schema . decodeUnknownSync ( OrchestratorMcpThreadListItem ) ;
14+ const decodeThreadDetail = Schema . decodeUnknownSync ( OrchestratorMcpThreadDetail ) ;
1115
1216describe ( "orchestrator MCP contracts" , ( ) => {
17+ it ( "decodes thread results from a linked environment that predates pinned" , ( ) => {
18+ const listItem = {
19+ threadId : "thread-1" ,
20+ projectId : "project-1" ,
21+ title : "Fix the build" ,
22+ createdBy : "user" ,
23+ creationSource : "web" ,
24+ status : "completed" ,
25+ latestRunId : null ,
26+ providerInstanceId : "codex" ,
27+ model : "gpt-5.4" ,
28+ runtimeMode : "full-access" ,
29+ interactionMode : "default" ,
30+ linkedPullRequest : null ,
31+ settled : false ,
32+ settledAt : null ,
33+ snoozed : false ,
34+ snoozedUntil : null ,
35+ parentThreadId : null ,
36+ relationshipToParent : null ,
37+ itemCount : 0 ,
38+ createdAt : "2026-01-01T00:00:00.000Z" ,
39+ updatedAt : "2026-01-01T00:00:00.000Z" ,
40+ } ;
41+ const detail = {
42+ ...listItem ,
43+ activeRunId : null ,
44+ titleRegeneration : null ,
45+ branch : null ,
46+ worktreePath : null ,
47+ runCount : 0 ,
48+ pendingRequestCount : 0 ,
49+ archived : false ,
50+ } ;
51+
52+ expect ( decodeThreadListItem ( listItem ) . pinned ) . toBeUndefined ( ) ;
53+ expect ( decodeThreadDetail ( detail ) . pinned ) . toBeUndefined ( ) ;
54+ } ) ;
55+
1356 it ( "decodes cross-provider delegated task requests and durable results" , ( ) => {
1457 const request = decodeDelegateTaskInput ( {
1558 task : "Inspect the workspace and report the result." ,
0 commit comments