bug: Codex 使用 Grok 时上下文压缩不收敛,满载任务被中断
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 401
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
**提交人**: zhaohan
**客户端版本**: 0.1.57
---
## 问题描述 / What happened
在 Cindy Desktop 的 Codex Agent 中使用 Grok 时,任务上下文使用率接近满载(约 85% 以上)并进入自动压缩后,压缩经常无法收敛。一次实际出现的脱敏错误摘要如下:
```
Codex kept compacting the context without making progress — 3 compactions over 443s, each leaving about 128910 input tokens behind, so compaction cannot recover this turn. It was interrupted automatically to stop the loop. The bulk of the context is the system prompt and tool definitions, which compaction cannot shrink. Start a new task to continue.
```
期望行为:压缩应有效缩小上下文并继续当前任务;如果系统提示词和工具定义已经占满可用窗口,应尽早给出明确、可恢复的处理方式,而不是让任务长时间反复压缩后才中断。
实际行为:同一任务在约 443 秒内重复压缩 3 次,每次仍留下约 128,910 个输入 token,最终自动中断,只能新建任务继续。
## 环境 / Environment
- Agent:Codex
- 模型/供应商:Grok(具体 model ID 未知)
- 触发条件:上下文接近满载,自动压缩开始时
## 复现步骤 / Steps to reproduce
1. 在 Cindy Desktop 中创建 Codex Agent 任务。
2. 选择 Grok 模型并持续执行任务。
3. 让上下文使用率升至约 85% 或更高,等待自动压缩。
4. 观察压缩是否反复执行,以及任务是否出现上述终态错误。
## 日志与截图 / Logs & screenshots
- 复现频率:上下文用满并触发压缩时很常见。
- 已尝试:新建任务和重启 Cindy 后可以继续工作,但原任务无法在当前上下文中恢复。
- 未附带截图;上述错误摘要已脱敏,不含账号、凭证、个人路径或业务内容。
---
**版本区域**: CN
**OS**: darwin arm64 (25.5.0)
**界面语言**: zh-CN
Contributor guide
Research direction
No source files or tests are named in the report. Start by reproducing the issue with a Codex Agent using Grok near 85% context usage, then trace the context-compaction entry point and its progress checks. Done means compaction either reduces the context and continues the task, or quickly reports a clear recovery path when system prompts and tool definitions cannot be reduced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100