claw-code/rust/crates/rusty-claude-cli
YeonGyu-Kim 6e301c8bb3 fix(runtime): prevent orphaned tool-result at compaction boundary; /cost JSON
Two fixes:

1. compact.rs: When the compaction boundary falls at the start of a
   tool-result turn, the preceding assistant turn with ToolUse would be
   removed — leaving an orphaned role:tool message with no preceding
   assistant tool_calls. OpenAI-compat backends reject this with 400.

   Fix: after computing raw_keep_from, walk the boundary back until the
   first preserved message is not a ToolResult (or its preceding assistant
   has been included). Regression test added:
   compaction_does_not_split_tool_use_tool_result_pair.

   Source: gaebal-gajae multi-turn tool-call 400 repro 2026-04-09.

2. /cost resume: add JSON output:
   {kind:cost, input_tokens, output_tokens, cache_creation_input_tokens,
    cache_read_input_tokens, total_tokens}

159 CLI + 431 runtime tests pass. Fmt clean.
2026-04-10 00:13:45 +09:00
..
.claw/sessions feat(runtime): typed task packet format for structured claw dispatch 2026-04-04 00:40:20 +09:00
src fix(runtime): prevent orphaned tool-result at compaction boundary; /cost JSON 2026-04-10 00:13:45 +09:00
tests fix(cli): 6 cascading test regressions hidden behind client_integration gate 2026-04-08 14:54:10 +09:00
Cargo.toml Close the clawability backlog with deterministic CLI output and lane lineage 2026-04-05 18:41:02 +00:00
build.rs feat(cli): populate Git SHA, target triple, and build date at compile time via build.rs 2026-04-08 18:11:46 +09:00