github / github/copilot-cli

Prefer native Responses API compaction when available

未关闭
#2,558 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:context-memory area:models
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the feature or problem you'd like to solve

I've been trying to understand how long sessions behave in Copilot CLI, especially once `/compact` or auto-compaction kicks in.

Right now, it seems like compaction goes through Copilot CLI's own summary/checkpoint flow even when the active model is OpenAI-backed and already using the Responses stack. I'd love to see the CLI prefer native Responses API compaction in those cases, and only fall back to the current Copilot compaction when native support is not available.

### Proposed solution

If the selected provider/model supports native compaction through the Responses API, use that path by default. If not, keep the current Copilot compaction as the fallback.

That feels like the best of both worlds: the current implementation keeps working everywhere, but OpenAI-backed sessions can preserve more of the provider's native behavior during very long runs.

A small config switch would also be nice, something along the lines of `auto | native | copilot`, but even just making `auto` prefer native compaction would already be a big improvement.

### Example prompts or workflows

- Long debugging sessions with lots of shell commands, edits, and tool calls
- Extended GPT-5 / Codex workflows where `/compact` may run more than once
- Research-heavy sessions that build up a lot of intermediate state over time
- Comparing the same workflow between Copilot CLI and other Responses-based harnesses

### Additional context

This is not a request to remove the current compaction/checkpoint system. That still makes sense as a universal fallback.

The request is mainly about letting OpenAI-backed sessions take advantage of provider-native compaction when it's already available.

贡献指南

打开贡献指南

调研方向

Start by tracing the `/compact` and auto-compaction flows in Copilot CLI and identify how the active provider and model expose Responses API support. Compare the native and current Copilot paths, then define the fallback behavior and verify that long sessions use native compaction when available without breaking unsupported providers.

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
api, cli
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。