Commit c3acc51
fix(bulk): surface resolution warnings at top level, fix E2E MCPAssertions usage
Two CodeRabbit findings on the latest push:
- resolution.summary()'s warnings list was left nested under
response["resolution"]["warnings"] on both the dry-run and dispatch
return paths, contradicting AGENTS.md's "warnings is always a top-level
list[str], never nested" contract -- a consumer reading the top-level
key never saw the hidden-entity degradation. Extracted
_attach_resolution_to_response() (also needed to keep _run_bulk_selector
under the C901 complexity threshold) which pops the nested warnings and
extends (not overwrites) any warnings bulk_device_control's own response
already carries.
- The new E2E dispatch test read the excluded entity's post-dispatch state
via the raw mcp_client + parse_mcp_result outside the MCPAssertions
context, instead of mcp.call_tool_success() inside it -- inconsistent
with this PR's own earlier fix (c62d9e4) and the repo's coding
guideline for success-path tool calls in E2E tests.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 7255db4 commit c3acc51
3 files changed
Lines changed: 112 additions & 13 deletions
File tree
- src/ha_mcp/tools
- tests/src
- e2e/workflows/core
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
214 | 235 | | |
215 | 236 | | |
216 | 237 | | |
| |||
1767 | 1788 | | |
1768 | 1789 | | |
1769 | 1790 | | |
1770 | | - | |
| 1791 | + | |
1771 | 1792 | | |
1772 | 1793 | | |
1773 | 1794 | | |
1774 | | - | |
1775 | 1795 | | |
| 1796 | + | |
| 1797 | + | |
1776 | 1798 | | |
1777 | 1799 | | |
1778 | 1800 | | |
| |||
1799 | 1821 | | |
1800 | 1822 | | |
1801 | 1823 | | |
1802 | | - | |
| 1824 | + | |
1803 | 1825 | | |
1804 | 1826 | | |
1805 | 1827 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
182 | 192 | | |
183 | 193 | | |
184 | 194 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
59 | 136 | | |
60 | 137 | | |
61 | 138 | | |
| |||
0 commit comments