Skip to content

feat: compact tool-call write-back for retain noise - #567

Open
luxus wants to merge 1 commit into
feat/560-git-seed-syncfrom
feat/561-retain-compaction
Open

feat: compact tool-call write-back for retain noise#567
luxus wants to merge 1 commit into
feat/560-git-seed-syncfrom
feat/561-retain-compaction

Conversation

@luxus

@luxus luxus commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

Default retain.compactToolCalls=true so assistant tool calls retain name + primary target only (no full args), matching coding-agents write-back noise discipline.

Linked issue

Scope

  • Compact toolCall projection in messages.ts
  • Config retain.compactToolCalls (default true; false for full args)
  • Docs + retain/recall tests updated

Verification

  • npm run check
  • npm run check:coverage (source, tests, critical paths, or ci:coverage)
  • npm run typecheck:tsc (source/critical paths or full CI)
  • full matrix requested/passed (release PRs/release verification, manual dispatch, platform-sensitive changes, or ci:full)
  • package verification requested/passed (release/package changes or ci:package)
  • npm run pack:verify (release/package changes)
  • npm run smoke:hindsight or configured Hindsight Integration pass (memory-path behavior changes or ci:live-smoke; document unavailable live proof)

Unit tests cover compact default and full-args opt-out. Live smoke not required for pure projection change.

Release impact

  • User-visible change

Automatic retain payloads compact tool-call arguments by default.

Risk and rollback

  • Risk: less tool argument detail in memory (intentional); set compactToolCalls false to restore.
  • Rollback/revert path: revert PR or set compactToolCalls false in config.

Follow-ups

Memory invariants

  • Retain still stores raw rich content, not summaries.
  • Recall Blocks remain ephemeral and are not retained back into Hindsight.
  • Project Bank and User Bank isolation is preserved.
  • Retain Queue behavior remains queue-first and retry-safe.
  • Debug output and sidecars remain opt-in and redacted.
  • Import behavior remains deterministic and idempotent when touched.

Guidance sync

  • If this changes source-of-truth order, contributor workflow, verification expectations, memory policy, or definition of done, AGENTS.md and CONTRIBUTING.md were updated together.

Agent checklist

  • I read and followed AGENTS.md and CONTRIBUTING.md.
  • I linked the issue before implementation.
  • I kept the diff focused on one vertical slice.
  • Final branch contains only focused, reviewable commits.
  • I did not bypass hooks or checks.
  • I documented skipped checks with reasons.

Notes

User/assistant text is still retained raw; only tool-call argument objects are compacted.

Default retain.compactToolCalls=true so assistant tool calls keep only
name + primary target (path/command/query), cutting mechanical noise
while preserving what was touched. Set false for full args (forensic).

Closes #561

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a default “compact tool-call” projection to reduce retain noise by storing tool calls as name + primary target instead of full argument payloads, and updates recall formatting to match the compact representation.

Changes:

  • Add retain.compactToolCalls (default true) and normalize it into the resolved config.
  • Compact assistant tool-call content in both retain projection and recall-query formatting (e.g., [action bash echo hi] and retained { arguments: { target } }).
  • Update tests and documentation to reflect the new compact tool-call behavior and the opt-out mode.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/retain.test.ts Updates expectations for compacted retained tool-call arguments and adds opt-out test coverage.
tests/recall-format.test.ts Updates recall query formatting expectation from [toolCall …] to [action … target].
extensions/utils/messages.ts Implements target extraction and compact tool-call formatting/projection.
extensions/types.ts Adds retain.compactToolCalls to the resolved config type.
extensions/config/config-normalize.ts Normalizes retain.compactToolCalls from user config with a default.
extensions/config/config-defaults.ts Enables compact tool-call retention by default (compactToolCalls: true).
docs/memory-behavior.md Documents the new default compact tool-call behavior and the opt-out setting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

],
},
},
compactToolCalls: true,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: compact tool-call write-back for retain noise

2 participants