Skip to content

test: rolling compaction integration — real LLM with free model #169

@emesal

Description

@emesal

context

rolling compaction makes two LLM calls. we need integration tests that exercise the full path with a real model to verify the behaviour end-to-end.

scope

integration tests in crates/chibi-core/tests/ (or inline under a #[cfg(test)] block gated on env var):

  • runtime skip pattern: if RATATOSKR_API_KEY (or equivalent key env var) is not set, print a message and return early — do not fail the test
  • use model preset free/text-generation via ratatoskr
  • build a fake context with 10–15 messages (mix of user, assistant, tool_call, tool_result)
  • run rolling_compact
  • verify:
    • message count decreased
    • summary is non-empty
    • system messages were not removed
    • tool exchange atomicity held (no orphaned tool results)
    • transcript anchor was written (finalize_compaction side effect)

notes

  • free models may return unexpected JSON; test should be lenient about exact message count but strict about invariants (no orphaned tool results, system messages intact)
  • document the skip pattern clearly so future tests can follow the same convention

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions