Skip to content

test(conformance): script Claude Code compaction - #6048

Closed
giuliolovisotto wants to merge 4 commits into
glovisotto/kilocode-scripted-compactionfrom
glovisotto/claude-code-scripted-compaction
Closed

giuliolovisotto wants to merge 4 commits into
glovisotto/kilocode-scripted-compactionfrom
glovisotto/claude-code-scripted-compaction

Conversation

@giuliolovisotto

@giuliolovisotto giuliolovisotto commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude Code's compaction scenario uses 14 Bash replies, a summary, then the final answer. The last tool reply supplies 90,000 input tokens to cross the configured threshold. The full pinned-runtime episode now passes conformance.

The adapter exposes optional session_name (--name) and tools (--tools) settings, and accepts an inline settings mapping or the existing JSON path. The fixture names the session to suppress title generation and limits tools to Bash, removing title-request detection and auxiliary-call bookkeeping.

Observation fixes retain the actual sandbox ID across cleanup, normalize the native auto trigger to automatic, and reconcile aggregate usage from uniquely resolved invocation-owned captures, including compaction helpers and cache tokens. Repeated references are counted once; unrelated calls are excluded. Missing or ambiguous capture evidence leaves native usage intact with a reconciliation gap. Without configured capture, native reporting remains the fallback.

The compaction checker requires the complete scripted summary in the saved event and resumed request, allowing runtime continuation text around it. Exact helper identity and ownership checks remain. Usage expectations use the existing shared model-call extractor, including Messages cache reads and writes.

Stacked on #6047. No separate issue is needed for this focused conformance follow-up. Existing configuration defaults remain compatible; capture-backed reported usage can increase because previously omitted helper/cache tokens are included. No benchmark task or scoring changes.

Validation:

  • Full local Linux Gym agent-session episode with pinned Claude Code 2.1.108: all applicable P0/P1 checks passed, 14 executed tools, 16 model requests, summary reuse, and successful verification.
  • Correct aggregate usage: 97,180 input / 131 output / 97,311 total, including 48 cached tokens; a real sandbox ID and automatic compaction trigger are retained.
  • CC adapter, conformance fixture, and compaction checker regressions: 451 passed, 10 skipped on this PR; 453 passed, 10 skipped at the restacked test(conformance): script Pi overflow recovery #6050 tip, where the full CC episode also passed.
  • pre-commit run --all-files: passed on this PR and the restacked tip.

Kept as a draft for review.

CI validation: 706 shared/adapter tests passed (23 skipped); public API and observation checks passed (889 tests). Removed the obsolete auxiliary-call test and used the public model-call record API in the observation test. Repository hooks pass.

@copy-pr-bot

copy-pr-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@giuliolovisotto
giuliolovisotto marked this pull request as ready for review November 12, 2026 16:31
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 12, 2026 16:32
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/claude-code-scripted-compaction branch from 5acc0ab to a414294 Compare November 12, 2026 17:02
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/kilocode-scripted-compaction branch from 6006040 to 3e26323 Compare November 12, 2026 17:02
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/kilocode-scripted-compaction branch from 3e26323 to e7ee039 Compare November 13, 2026 10:15
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/claude-code-scripted-compaction branch from a414294 to ded68e2 Compare November 13, 2026 10:15
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.

1 participant