(t *testing.T)
| 1162 | { |
| 1163 | "role": "user", |
| 1164 | "content": []map[string]any{ |
| 1165 | {"type": "tool_result", "tool_use_id": "visible-1", "content": "ok"}, |
| 1166 | {"type": "text", "text": "ignored"}, |
| 1167 | }, |
| 1168 | }, |
| 1169 | {"role": "user", "content": "not a block list"}, |
| 1170 | { |
| 1171 | "role": "user", |
| 1172 | "content": []map[string]any{ |
| 1173 | {"type": "tool_result", "tool_use_id": "", "content": "empty id"}, |
| 1174 | {"type": "tool_result", "tool_use_id": "visible-2", "content": "ok"}, |
| 1175 | }, |
| 1176 | }, |
| 1177 | } |
| 1178 | ids := agent.VisibleToolResultIDs(messages) |
| 1179 | for _, id := range []string{"visible-1", "visible-2"} { |
| 1180 | if _, ok := ids[id]; !ok { |
| 1181 | t.Fatalf("missing visible tool result id %q in %#v", id, ids) |
| 1182 | } |
| 1183 | } |
| 1184 | if _, ok := ids[""]; ok || len(ids) != 2 { |
| 1185 | t.Fatalf("unexpected visible ids: %#v", ids) |
| 1186 | } |
| 1187 | } |
| 1188 | |
| 1189 | func TestQueryLoopStripsLegacyMemoryIndexContextBeforeRequest(t *testing.T) { |
| 1190 | dir := t.TempDir() |
| 1191 | cfg := config.NewConfigForCWD(dir) |
| 1192 | cfg.LongTermMemoryEnabled = true |
| 1193 | cfg.MemoryBackend = "fabric" |
| 1194 | cfg.MemoryPath = filepath.Join(dir, "memory-fabric") |
nothing calls this directly
no test coverage detected