Commit 46faa6d
fix(screenshot): do not recommend a restore the tool will refuse
The report told the agent to call ha_manage_theme(action='set_engine_theme')
even when the observation came from the client-credential fallback -- which
is the same condition under which the engine-theme actions refuse. It named
a command that cannot succeed.
The remedy is now chosen by provenance. With the engine's own token the
report keeps the guarded ha_manage_theme call. With the fallback it says
ha-mcp cannot confirm which account the value belongs to and will not act
on it, and directs restoration to that account's own Profile > General
instead. Both paths keep the dedicated-engine-account recommendation, which
removes the problem rather than working around it.
Tests assert each branch, including that the fallback report does not name
ha_manage_theme and the engine-credential report does not send the reader
to the UI.
Raised by CodeRabbit.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Nm7tyA1nfxNCWFXaR3AxV1 parent e7d6c35 commit 46faa6d
2 files changed
Lines changed: 35 additions & 19 deletions
File tree
- src/ha_mcp/dashboard_screenshot
- tests/src/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
354 | 374 | | |
355 | 375 | | |
356 | 376 | | |
357 | 377 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
373 | 382 | | |
374 | 383 | | |
375 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
780 | | - | |
781 | | - | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
782 | 787 | | |
783 | 788 | | |
784 | 789 | | |
| |||
787 | 792 | | |
788 | 793 | | |
789 | 794 | | |
790 | | - | |
791 | | - | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
0 commit comments