Files
leleka/crates/harmony/tests
Pavlo RatushnyiandClaude Sonnet 5.5 2e7c28a11f fix: error tool_result wrapper has sorted keys again; key order of model-visible JSON is explicit, not a feature-unification accident
serde_json/preserve_order was switched on for strata-next on 2026-10-14 by leleka-harmony (c2290e114, which noted the
effect on tool-call arguments and changed one test) and the Messages error wrapper {"content":...,"is_error":true}
became {"is_error":true,"content":...} without a line of it changing; scripts/smoke-messages.py (sort_keys=True) went red.

* control-plane/src/json_order.rs: to_string_sorted (recursive, independent of the feature) and error_result_text;
  messages.rs uses it, and its unit test asserts the exact bytes instead of the parsed value.
* preserve_order is declared by strata-control and strata-desktop-core (and documented in leleka-harmony): the Original is
  Python, so replayed tool-call arguments, tool schemas, text.format schemas and MCP result blocks keep the order the client
  or the model wrote. A build of desktop-core alone (docs/deploy.md section 8) sorted them before.
* guard tests that fail when the feature is off (control-plane, desktop-core, harmony), tests for the order of replayed and
  model-written tool-call arguments in both gateways, and corrected comments in prompt.rs and mcp.rs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 01:42:08 +01:00
..