Commit 02fbfed
fix: return empty success instead of RESOURCE_NOT_FOUND for empty logbook (#710)
* fix: return empty success instead of RESOURCE_NOT_FOUND for empty logbook
Empty logbook results are a valid query outcome, not an error. The HA API
successfully executed the query — there just happen to be no entries for the
requested period/entity. Raising RESOURCE_NOT_FOUND confused AI agents into
unnecessary retries and caused flaky E2E failures on fresh CI containers.
Remove the error-raising block and normalize falsy responses to an empty
list, letting the existing pagination logic handle it naturally. Update E2E
tests to assert success directly instead of using safe_call_tool workarounds.
Closes #696
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address review — remove redundant guard, fix assertion consistency
- Remove `if not response` normalization block since `client.get_logbook`
always returns `list[dict]` per its type signature
- Use `data['entity_filter']` instead of `data.get('entity_filter')` in
assertion message for consistency with the assertion itself
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: kingpanther13 <kingpanther13@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent eec0f1b commit 02fbfed
2 files changed
Lines changed: 24 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | 139 | | |
155 | 140 | | |
156 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 223 | + | |
227 | 224 | | |
228 | 225 | | |
229 | 226 | | |
| 227 | + | |
230 | 228 | | |
231 | 229 | | |
232 | | - | |
233 | | - | |
234 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
235 | 233 | | |
236 | 234 | | |
237 | 235 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
249 | 243 | | |
250 | 244 | | |
251 | 245 | | |
| |||
297 | 291 | | |
298 | 292 | | |
299 | 293 | | |
300 | | - | |
| 294 | + | |
301 | 295 | | |
302 | 296 | | |
303 | | - | |
304 | | - | |
305 | | - | |
| 297 | + | |
306 | 298 | | |
307 | 299 | | |
308 | 300 | | |
| |||
311 | 303 | | |
312 | 304 | | |
313 | 305 | | |
314 | | - | |
| 306 | + | |
315 | 307 | | |
316 | 308 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
325 | 316 | | |
326 | | - | |
| 317 | + | |
0 commit comments