Skip to content

v1.3.121

Choose a tag to compare

@topcheer topcheer released this 04 Jul 01:51
· 3693 commits to main since this release

v1.3.121

Context Engineering — Richer Compaction Payload

Include tool input parameters in summarization payload

When the agent's conversation is compressed (compacted), the summarization LLM
receives a text dump of the conversation to summarize. Previously, tool calls
were shown as just the tool name — e.g. Tool call: read_file — with no
indication of WHICH file was read, WHAT command was run, or WHAT was searched.

This meant the summarizer had to infer tool context from truncated tool
results (capped at 200 chars), losing critical information about what the agent
actually did.

Fix: buildSummaryPayload now extracts key input parameters from each
tool call's JSON input using a priority-ordered field list (path,
file_path, command, pattern, query, url, directory, task,
prompt, message, revision). The output is capped at 300 chars per call
with individual field truncation.

Before:

Tool call: read_file
Tool call: edit_file
Tool call: run_command

After:

Tool call: read_file(path="/internal/context/manager.go")
Tool call: edit_file(file_path="main.go", old_text="old", new_text="new")
Tool call: run_command(command="go test -race ./...")

This follows the context engineering principle from Anthropic's 2025-2026
research: the summarization LLM needs high-signal context about what the agent
did, not just that it called a tool. Better summaries directly improve the
agent's ability to continue work after compaction.

Files changed

  • internal/context/manager.goformatToolInputForSummary() helper +
    integration into buildSummaryPayload()
  • internal/context/manager_test.go — 8 test cases for input formatting +
    integration test verifying tool inputs appear in the summary payload