Skip to content

feat(acp): honor Claude auto-compaction window#237

Open
MoozLee wants to merge 1 commit into
xintaofei:mainfrom
MoozLee:feat/cc-agent-custom-compaction
Open

feat(acp): honor Claude auto-compaction window#237
MoozLee wants to merge 1 commit into
xintaofei:mainfrom
MoozLee:feat/cc-agent-custom-compaction

Conversation

@MoozLee
Copy link
Copy Markdown
Contributor

@MoozLee MoozLee commented Jun 2, 2026

Summary

  • Forward CLAUDE_CODE_AUTO_COMPACT_WINDOW into Claude Code ACP session metadata as options.settings.autoCompactWindow.
  • Preserve existing Claude Code user SDK options from ~/.claude/settings.json while merging the configured auto-compaction window.
  • Add the Claude 1M context beta when the configured auto-compaction window exceeds the default 200K window.
  • Update the status bar context-window display to prefer the configured Claude Code auto-compaction limit, so the shown denominator and percentage match the effective compaction threshold.

Test plan

  • cargo test --manifest-path src-tauri/Cargo.toml --lib build_new_session_request
  • cargo test --manifest-path src-tauri/Cargo.toml --lib build_load_session_request
  • cargo check --manifest-path src-tauri/Cargo.toml
  • cargo check --manifest-path src-tauri/Cargo.toml --bin codeg-server --no-default-features
  • pnpm eslint src/components/layout/status-bar-tokens.tsx

摘要

  • CLAUDE_CODE_AUTO_COMPACT_WINDOW 写入 Claude Code ACP 会话 metadata,即 options.settings.autoCompactWindow
  • 合并自定义压缩窗口时,保留 ~/.claude/settings.json 中已有的 Claude Code 用户 SDK options。
  • 当配置的自动压缩窗口超过默认 200K 时,自动追加 Claude 1M context beta。
  • 更新状态栏上下文窗口展示逻辑,优先使用 Claude Code 配置的自动压缩窗口,保证展示的分母和百分比与实际压缩阈值一致。

测试计划

  • cargo test --manifest-path src-tauri/Cargo.toml --lib build_new_session_request
  • cargo test --manifest-path src-tauri/Cargo.toml --lib build_load_session_request
  • cargo check --manifest-path src-tauri/Cargo.toml
  • cargo check --manifest-path src-tauri/Cargo.toml --bin codeg-server --no-default-features
  • pnpm eslint src/components/layout/status-bar-tokens.tsx

Forward the configured Claude Code auto-compaction limit into ACP session metadata and show the effective limit in the status bar.
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