Commit 8c54f18
fix(mcp): drop broken live-tick SetState; pin behavior with production-shape harness stub (#645)
Copilot review on PR #634 caught that the live-tick design
(SetState("plan_actions", Rx("$result.actions")) in the Confirm
button's on_success chain) was a no-op in production. The browser
harness was passing only because the stub modify_manufacturing_order
returned ToolResult(content="ok", structured_content=response_dict) —
putting the raw ModificationResponse into structured_content, which
is exactly the shape $result.actions needed.
Real modification tools use make_tool_result(response, ui=...) which
puts the response JSON in content and a PrefabApp wire envelope (no
actions field) in structured_content. $result in the on_success Rx
context resolves to that envelope, so $result.actions never resolves.
This commit:
- Drops the broken SetState("plan_actions", RESULT.actions) from the
Confirm-button apply chain. Apply path now morphs the card via the
existing applied=True flag (rows stay PLANNED; footer/badge flip to
applied state). Same UX the codebase had before #634's live-tick
attempt — no functional regression.
- Updates the browser harness stub to use make_tool_result exactly
like real tools, pinning the production wire shape so future live-
tick attempts will verify against an honest stub.
- Renames test_apply_button_pushes_result_actions_into_state to
test_apply_button_does_not_set_state_plan_actions and asserts the
no-op SetState is NOT in the chain — prevents regression.
- Updates the browser click-through test to assert the actual
applied-state morph (Confirm disabled, "Applied" pill visible)
rather than rows transitioning.
- In-code comment in build_modification_preview_ui documents why the
live-tick was dropped and points at the follow-up issue.
Live-tick UX tracked as a separate enhancement in #645 — it requires
identifying the right Rx path (or restructuring the apply path) before
it can ship. The browser harness is now in place to verify any future
attempt.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cc231f9 commit 8c54f18
4 files changed
Lines changed: 70 additions & 58 deletions
File tree
- katana_mcp_server
- src/katana_mcp/tools
- tests
- browser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1444 | 1444 | | |
1445 | 1445 | | |
1446 | 1446 | | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
1457 | 1458 | | |
1458 | 1459 | | |
1459 | 1460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
391 | 396 | | |
392 | 397 | | |
393 | 398 | | |
394 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
395 | 407 | | |
396 | 408 | | |
397 | 409 | | |
| |||
406 | 418 | | |
407 | 419 | | |
408 | 420 | | |
409 | | - | |
| 421 | + | |
410 | 422 | | |
411 | 423 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
415 | 427 | | |
| 428 | + | |
416 | 429 | | |
417 | 430 | | |
418 | 431 | | |
| |||
Lines changed: 25 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
| 94 | + | |
89 | 95 | | |
90 | | - | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
98 | 104 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 105 | + | |
102 | 106 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2002 | 2002 | | |
2003 | 2003 | | |
2004 | 2004 | | |
2005 | | - | |
2006 | | - | |
2007 | | - | |
2008 | | - | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
2009 | 2016 | | |
2010 | 2017 | | |
2011 | 2018 | | |
| |||
2027 | 2034 | | |
2028 | 2035 | | |
2029 | 2036 | | |
2030 | | - | |
2031 | | - | |
2032 | | - | |
2033 | 2037 | | |
2034 | 2038 | | |
2035 | 2039 | | |
| |||
2047 | 2051 | | |
2048 | 2052 | | |
2049 | 2053 | | |
2050 | | - | |
2051 | 2054 | | |
2052 | | - | |
2053 | 2055 | | |
2054 | 2056 | | |
2055 | 2057 | | |
| |||
2060 | 2062 | | |
2061 | 2063 | | |
2062 | 2064 | | |
2063 | | - | |
2064 | | - | |
2065 | | - | |
2066 | | - | |
2067 | | - | |
2068 | | - | |
2069 | | - | |
2070 | | - | |
2071 | | - | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
2072 | 2069 | | |
2073 | 2070 | | |
2074 | 2071 | | |
| |||
0 commit comments