MoonshotAI / MoonshotAI/kimi-code

[agent-core-v2] Question: computeCompactCount / reduceCompactOnOverflow have no production callers in v2

Open
#2,112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Two CompactionStrategy methods — computeCompactCount and reduceCompactOnOverflow — have no production callers in v2: they appear only inside src/agent/fullCompaction/strategy.ts (interface, delegate, implementation) and in tests that instantiate DefaultCompactionStrategy directly. The other interface members (shouldCompact, shouldBlock, …) are all called from fullCompactionService.ts.

Since v2's keep-policy lives in src/agent/contextMemory/compactionHandoff.ts, these look like v1 window-compaction remnants.

Are these kept intentionally, or can the interface be narrowed? Happy to send a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading src/agent/fullCompaction/strategy.ts and checking the production call sites in fullCompactionService.ts. Compare those methods with the keep-policy in src/agent/contextMemory/compactionHandoff.ts and the direct-instantiation tests; done means determining whether the interface members are still needed and updating the affected interface, implementation, and tests accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.