@@ -73,7 +73,9 @@ readline.createInterface({ input: process.stdin }).on("line", (line) => {
7373 output({ method: "turn/completed", params: { threadId: message.params.threadId, turn: { id: turnId, status: "completed", items: [] } } });
7474 return;
7575 }
76- const item = { type: "agentMessage", text: "fake response " + turn };
76+ const item = { type: "agentMessage", text: message.params.input[0].text === "policy"
77+ ? JSON.stringify(message.params.sandboxPolicy)
78+ : "fake response " + turn };
7779 output({ method: "item/completed", params: { threadId: message.params.threadId, turnId, item } });
7880 output({ method: "turn/completed", params: { threadId: message.params.threadId, turn: { id: turnId, status: "completed", items: [item] } } });
7981 });
@@ -133,6 +135,15 @@ readline.createInterface({ input: process.stdin }).on("line", (line) => {
133135 assert . ok ( protocolFailure . error . cause , "provider protocol cause remains available internally" ) ;
134136 assert . equal ( "cause" in toAgentErrorPayload ( protocolFailure . error ) , false ) ;
135137 }
138+ const policy = await runtime . run ( {
139+ prompt : "policy" ,
140+ workspaceRoot : "/tmp/project" ,
141+ writeMode : "allowed" ,
142+ providerSessionId : first . providerSessionId ?? undefined ,
143+ } ) ;
144+ assert . equal ( policy . isOk ( ) , true ) ;
145+ if ( policy . isErr ( ) ) throw policy . error ;
146+ assert . deepEqual ( JSON . parse ( policy . value . finalResponse ) , { type : "workspaceWrite" , networkAccess : true } ) ;
136147 await runtime . releaseSession ( "thread_new" ) ;
137148 } finally {
138149 await runtime . close ( ) ;
0 commit comments