Skip to content

test: full/manual compaction integration — real LLM with free model #170

@emesal

Description

@emesal

context

compact_context_with_llm_manual (manual -c flag compaction) makes three LLM calls and produces a 3-message bootstrap context. it has zero test coverage.

scope

integration tests gated on env var (same skip pattern as rolling compaction issue):

  • use model preset free/text-generation
  • build a fake context with enough messages to pass the ≤2 guard
  • run compact_context_with_llm_manual
  • verify resulting context structure:
    • system message present (if system prompt was set)
    • user message contains the continuation prompt + summary block
    • assistant acknowledgment message present
    • context.summary is non-empty
    • original messages are gone
    • transcript anchor written

edge cases (unit, no LLM):

  • empty summary response → returns error
  • context with ≤2 messages → returns Ok(()) immediately, no changes
  • missing compaction prompt → falls back to default, emits CompactionNoPrompt event
  • missing continuation prompt → falls back to hardcoded default

notes

  • edge cases can be pure unit tests without LLM
  • the LLM integration test just needs to verify the structure is correct, not the content

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