| 2018 | } |
| 2019 | |
| 2020 | func TestResumeSessionRequest_RequestMCPApps(t *testing.T) { |
| 2021 | t.Run("sends requestMcpApps flag when EnableMCPApps is set", func(t *testing.T) { |
| 2022 | req := resumeSessionRequest{ |
| 2023 | SessionID: "s1", |
| 2024 | RequestMCPApps: Bool(true), |
| 2025 | } |
| 2026 | data, err := json.Marshal(req) |
| 2027 | if err != nil { |
| 2028 | t.Fatalf("Failed to marshal: %v", err) |
| 2029 | } |
| 2030 | var m map[string]any |
| 2031 | if err := json.Unmarshal(data, &m); err != nil { |
| 2032 | t.Fatalf("Failed to unmarshal: %v", err) |
| 2033 | } |
| 2034 | if m["requestMcpApps"] != true { |
| 2035 | t.Errorf("Expected requestMcpApps to be true, got %v", m["requestMcpApps"]) |
| 2036 | } |
| 2037 | }) |
| 2038 | |
| 2039 | t.Run("does not send requestMcpApps when RequestMCPApps is unset", func(t *testing.T) { |
| 2040 | req := resumeSessionRequest{SessionID: "s1"} |
| 2041 | data, _ := json.Marshal(req) |
| 2042 | var m map[string]any |
| 2043 | json.Unmarshal(data, &m) |
| 2044 | if _, ok := m["requestMcpApps"]; ok { |
| 2045 | t.Error("Expected requestMcpApps to be omitted when not set") |
| 2046 | } |
| 2047 | }) |
| 2048 | } |
| 2049 | |
| 2050 | func TestResumeSessionRequest_ModeCallbackFlags(t *testing.T) { |
| 2051 | req := resumeSessionRequest{ |