Skip to content

test(llm): add missing compaction unit tests#1760

Merged
bug-ops merged 2 commits intomainfrom
test-llm-compaction-gaps
Mar 14, 2026
Merged

test(llm): add missing compaction unit tests#1760
bug-ops merged 2 commits intomainfrom
test-llm-compaction-gaps

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 14, 2026

Closes #1697.

Summary

  • GAP-1: parse_tool_response_with_compaction — verifies that a response containing AnthropicContentBlock::Compaction sets compaction_summary to Some(summary) and returns an empty ChatResponse::Text
  • GAP-2: split_messages_structured_compaction_round_trip — verifies that MessagePart::Compaction in an assistant message is emitted verbatim as AnthropicContentBlock::Compaction, while a user-role Compaction part is silently dropped

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes
  • cargo nextest run --workspace --features full --lib --bins — 5505 passed, 12 skipped
  • Both new tests pass in isolation

- parse_tool_response_with_compaction: verifies Compaction block sets
  compaction_summary and returns empty ChatResponse::Text
- split_messages_structured_compaction_round_trip: verifies assistant
  MessagePart::Compaction is emitted verbatim as AnthropicContentBlock::Compaction,
  and user-role Compaction is silently dropped
@github-actions github-actions bot added llm zeph-llm crate (Ollama, Claude) rust Rust code changes tests Test-related changes size/M Medium PR (51-200 lines) labels Mar 14, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 14, 2026 16:27
@github-actions github-actions bot added tests Test-related changes and removed tests Test-related changes labels Mar 14, 2026
@bug-ops bug-ops merged commit f1ed98d into main Mar 14, 2026
15 checks passed
@bug-ops bug-ops deleted the test-llm-compaction-gaps branch March 14, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm zeph-llm crate (Ollama, Claude) rust Rust code changes size/M Medium PR (51-200 lines) tests Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(llm): add missing compaction unit tests (parse_tool_response + split_messages round-trip)

1 participant