@@ -896,6 +896,49 @@ func TestWebSocketForwardsHistorySettingsAndFsRPCs(t *testing.T) {
896896 t .Fatalf ("history conversation share field = %#v" , historyConversation )
897897 }
898898
899+ sendEnvelope (t , conn , "history-shared-1" , "history.shared_list" , map [string ]any {
900+ "page" : 1 ,
901+ "page_size" : 50 ,
902+ })
903+ sharedHistoryOutbound := readOutboundEnvelope (t , agentSession )
904+ sharedHistoryReq := sharedHistoryOutbound .GetMemoryManage ()
905+ if sharedHistoryReq == nil {
906+ t .Fatalf ("shared history outbound payload = %T, want MemoryManageRequest" , sharedHistoryOutbound .GetPayload ())
907+ }
908+ if sharedHistoryReq .GetCommand () != "history_shared_list" {
909+ t .Fatalf ("shared history list request = %#v" , sharedHistoryReq )
910+ }
911+ var sharedHistoryArgs map [string ]any
912+ if err := json .Unmarshal ([]byte (sharedHistoryReq .GetArgsJson ()), & sharedHistoryArgs ); err != nil {
913+ t .Fatalf ("decode shared history args: %v" , err )
914+ }
915+ if sharedHistoryArgs ["page" ] != float64 (1 ) || sharedHistoryArgs ["page_size" ] != float64 (50 ) {
916+ t .Fatalf ("shared history args = %#v" , sharedHistoryArgs )
917+ }
918+ sm .DispatchFromAgent (& gatewayv1.AgentEnvelope {
919+ RequestId : sharedHistoryOutbound .GetRequestId (),
920+ Timestamp : time .Now ().Unix (),
921+ Payload : & gatewayv1.AgentEnvelope_MemoryManageResp {
922+ MemoryManageResp : & gatewayv1.MemoryManageResponse {
923+ ResultJson : `{"total_count":1,"conversations":[{"id":"conversation-1","title":"Gateway test","created_at":10,"updated_at":11,"message_count":3,"provider_id":"codex-provider","model":"gpt-test","session_id":"session-1","cwd":"/workspace","is_shared":true}]}` ,
924+ },
925+ },
926+ })
927+ sharedHistoryResponse := receiveEnvelope (t , conn )
928+ if sharedHistoryResponse .ID != "history-shared-1" || sharedHistoryResponse .Type != "response" {
929+ t .Fatalf ("shared history response = %#v" , sharedHistoryResponse )
930+ }
931+ var sharedHistoryPayload map [string ]any
932+ if err := json .Unmarshal (sharedHistoryResponse .Payload , & sharedHistoryPayload ); err != nil {
933+ t .Fatalf ("decode shared history response: %v" , err )
934+ }
935+ if sharedHistoryPayload ["total_count" ] != float64 (1 ) {
936+ t .Fatalf ("shared history payload = %#v" , sharedHistoryPayload )
937+ }
938+ if _ , ok := sharedHistoryPayload ["running_conversation_ids" ]; ok {
939+ t .Fatalf ("shared history response should not include running ids: %#v" , sharedHistoryPayload )
940+ }
941+
899942 sendEnvelope (t , conn , "history-get-1" , "history.get" , map [string ]any {
900943 "conversation_id" : "conversation-1" ,
901944 "max_messages" : 360 ,
0 commit comments