[GH-ISSUE #4542] [Engine] Codex CLI 0.165.0 repeatedly compacts context and loses task progress #2051

Closed
opened 2026-11-04 01:56:15 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @desmonsdavid on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4542

Environment

  • OS: Windows 11
  • GPU: NVIDIA RTX 3080 Ti 12 GB
  • CPU: Intel Core i7-13700KF
  • RAM: 64 GB
  • Codex CLI: 0.165.0
  • Strata: Recent upstream checkout, October 28, 2026 (commit 46c152a)
  • Model: Qwen3.8-Flash-Next IQ2_XS
  • Context: 32,768 tokens, int8 KV cache
  • MTP: Enabled (--spec 4)
  • Codex Responses API: Local endpoint /v1/responses
  • Codex: prefer_mxc = true, read-only sandbox

Problem

When Codex CLI performs a multi-step, read-only genealogy-document audit, it repeatedly compacts its context, loses track of completed work, and re-executes similar file discovery and GEDCOM extraction commands without delivering a final report.

The issue has reproduced with two different Codex compaction thresholds:

  • model_auto_compact_token_limit = 24576
  • model_auto_compact_token_limit = 18000

In the second run, I observed 15 consecutive context compactions, repeatedly followed by commands such as Get-ChildItem and rg targeting files and GEDCOM records already examined.

Strata configuration

  • reasoning_budget_tokens = 2048, at the root of the server JSON
  • codex_compaction_cache = true in the second test
  • --max-context 32768
  • --kv int8
  • --pcie-frac 0.20
  • --spec-min-p 0.70

Strata confirms that the reasoning budget is active.

In an earlier run, the server logged:

[strata] reading the prompt: 29,565 of 29,565 tokens
[strata] thinking: ... of budget 2048 (max 3195)
[strata] done: 3195 tokens in 36 s (length, cancel=False)

Codex reported:

Incomplete response returned, reason: max_output_tokens

Expected behavior

Codex should compact its conversation while retaining the mission's progress, avoid repeating completed file-inspection steps, and eventually produce the requested audit report.

Actual behavior

After each compaction, Codex repeatedly starts by checking the directory contents, locating GEDCOM records, and reading documents already examined.

Even when it announces that it will prepare the final summary, it continues collecting evidence and enters another compaction cycle.

Questions

  1. Is this a known limitation of the Strata Responses API integration with Codex CLI?
  2. Is there a recommended Codex context-window or compaction configuration for Qwen3.8-Flash-Next IQ2_XS?
  3. Does codex_compaction_cache affect only prompt reuse/performance, or could it influence the compacted conversation state?
  4. Is there a recommended strategy to prevent repeated tool calls and loss of task progress after compaction?
  5. Are there additional server-side diagnostics that could help determine whether the issue originates in Strata, Codex, or model behavior?

I can provide sanitized server logs, Codex traces, and configuration files if needed.

Originally created by @desmonsdavid on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4542 ## Environment - **OS:** Windows 11 - **GPU:** NVIDIA RTX 3080 Ti 12 GB - **CPU:** Intel Core i7-13700KF - **RAM:** 64 GB - **Codex CLI:** 0.165.0 - **Strata:** Recent upstream checkout, October 28, 2026 (commit `46c152a`) - **Model:** Qwen3.8-Flash-Next IQ2_XS - **Context:** 32,768 tokens, int8 KV cache - **MTP:** Enabled (`--spec 4`) - **Codex Responses API:** Local endpoint `/v1/responses` - **Codex:** `prefer_mxc = true`, read-only sandbox ## Problem When Codex CLI performs a multi-step, read-only genealogy-document audit, it repeatedly compacts its context, loses track of completed work, and re-executes similar file discovery and GEDCOM extraction commands without delivering a final report. The issue has reproduced with two different Codex compaction thresholds: - `model_auto_compact_token_limit = 24576` - `model_auto_compact_token_limit = 18000` In the second run, I observed **15 consecutive context compactions**, repeatedly followed by commands such as `Get-ChildItem` and `rg` targeting files and GEDCOM records already examined. ## Strata configuration - `reasoning_budget_tokens = 2048`, at the root of the server JSON - `codex_compaction_cache = true` in the second test - `--max-context 32768` - `--kv int8` - `--pcie-frac 0.20` - `--spec-min-p 0.70` Strata confirms that the reasoning budget is active. In an earlier run, the server logged: ```text [strata] reading the prompt: 29,565 of 29,565 tokens [strata] thinking: ... of budget 2048 (max 3195) [strata] done: 3195 tokens in 36 s (length, cancel=False) ``` Codex reported: ```text Incomplete response returned, reason: max_output_tokens ``` ## Expected behavior Codex should compact its conversation while retaining the mission's progress, avoid repeating completed file-inspection steps, and eventually produce the requested audit report. ## Actual behavior After each compaction, Codex repeatedly starts by checking the directory contents, locating GEDCOM records, and reading documents already examined. Even when it announces that it will prepare the final summary, it continues collecting evidence and enters another compaction cycle. ## Questions 1. Is this a known limitation of the Strata Responses API integration with Codex CLI? 2. Is there a recommended Codex context-window or compaction configuration for Qwen3.8-Flash-Next IQ2_XS? 3. Does `codex_compaction_cache` affect only prompt reuse/performance, or could it influence the compacted conversation state? 4. Is there a recommended strategy to prevent repeated tool calls and loss of task progress after compaction? 5. Are there additional server-side diagnostics that could help determine whether the issue originates in Strata, Codex, or model behavior? I can provide sanitized server logs, Codex traces, and configuration files if needed.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 28, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6481092077 --> @github-actions[bot] commented on GitHub (Oct 28, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 28, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6481126838 --> @github-actions[bot] commented on GitHub (Oct 28, 2026): Thanks, this follows the format now.
Author
Owner

@desmonsdavid commented on GitHub (Oct 28, 2026):

Reproduction steps

  1. Start Strata with Qwen3.8-Flash-Next IQ2_XS, 32,768-token context and reasoning_budget_tokens = 2048.
  2. Configure Codex CLI 0.165.0 to use the local /v1/responses endpoint with prefer_mxc = true.
  3. Run codex --sandbox read-only from a directory containing a GEDCOM file and existing genealogy audit documents.
  4. Ask Codex to examine three related individuals, reuse existing audit findings, and produce a concise evidence-based report.
  5. Observe successive context compactions followed by repeated directory inventories and GEDCOM lookups.

Reproduction status

Reproduced locally during two separate runs.

  • With a compaction threshold of 24,576 tokens, the run ended with Incomplete response returned, reason: max_output_tokens.
  • With a threshold of 18,000 tokens, 15 successive context compactions were observed without a final report.
  • The Strata server confirmed that the 2,048-token reasoning budget was active.
  • The model repeatedly located previously identified GEDCOM records but did not complete the requested synthesis.

Scope and uncertainty

This is an observed integration failure, not a confirmed Strata engine defect.

The cause may involve Codex compaction behavior, Strata's Responses API implementation, or model behavior after context summarization.

The task was read-only. No genealogy files were modified.

Sanitized execution logs and configurations can be supplied upon request.

<!-- gh-comment-id:6481131618 --> @desmonsdavid commented on GitHub (Oct 28, 2026): ## Reproduction steps 1. Start Strata with Qwen3.8-Flash-Next IQ2_XS, 32,768-token context and `reasoning_budget_tokens = 2048`. 2. Configure Codex CLI 0.165.0 to use the local `/v1/responses` endpoint with `prefer_mxc = true`. 3. Run `codex --sandbox read-only` from a directory containing a GEDCOM file and existing genealogy audit documents. 4. Ask Codex to examine three related individuals, reuse existing audit findings, and produce a concise evidence-based report. 5. Observe successive context compactions followed by repeated directory inventories and GEDCOM lookups. ## Reproduction status **Reproduced locally** during two separate runs. - With a compaction threshold of 24,576 tokens, the run ended with `Incomplete response returned, reason: max_output_tokens`. - With a threshold of 18,000 tokens, 15 successive context compactions were observed without a final report. - The Strata server confirmed that the 2,048-token reasoning budget was active. - The model repeatedly located previously identified GEDCOM records but did not complete the requested synthesis. ## Scope and uncertainty This is an observed integration failure, not a confirmed Strata engine defect. The cause may involve Codex compaction behavior, Strata's Responses API implementation, or model behavior after context summarization. The task was read-only. No genealogy files were modified. Sanitized execution logs and configurations can be supplied upon request.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660652589 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Author
Owner

@desmonsdavid commented on GitHub (Nov 6, 2026):

Hi Niko,

Thanks for the update and for releasing Strata 0.2.11.

I retested issue #4542 on Windows 11 with the following configuration:

  • Strata 0.2.11, engine 0.1.57
  • Codex CLI 0.166.0
  • Qwen3.8-Flash-Next IQ2_XS
  • RTX 3080 Ti 12 GB, 64 GB system RAM
  • 32,768-token context, automatic compaction threshold at 18,000 tokens
  • 2,048-token reasoning budget, int8 KV cache, --spec 4
  • Local Responses API, prefer_mxc=true, codex_compaction_cache=true

Good news: I could not reproduce the original compaction loop.

In a native Codex session running a multi-step genealogy audit:

  • 2 automatic compactions were requested and completed successfully.
  • 34 tool commands completed successfully.
  • Codex retained its progress across both compactions.
  • No repeated discovery loops or unjustified reprocessing were observed.
  • Codex completed the task and delivered its final report.

The session completed in approximately 325 seconds.

This is not a strictly identical reproduction of the original October environment (Codex 0.166.0 instead of 0.165.0, synthetic dataset, bounded tool outputs), so I cannot claim the underlying issue is universally fixed.

However, the original failure mode did not occur, and the new version behaved correctly in this test.

No reopening needed from my side.

Thanks again for your work on Strata!

<!-- gh-comment-id:6694645054 --> @desmonsdavid commented on GitHub (Nov 6, 2026): Hi Niko, Thanks for the update and for releasing Strata 0.2.11. I retested issue #4542 on Windows 11 with the following configuration: - Strata 0.2.11, engine 0.1.57 - Codex CLI 0.166.0 - Qwen3.8-Flash-Next IQ2_XS - RTX 3080 Ti 12 GB, 64 GB system RAM - 32,768-token context, automatic compaction threshold at 18,000 tokens - 2,048-token reasoning budget, int8 KV cache, `--spec 4` - Local Responses API, `prefer_mxc=true`, `codex_compaction_cache=true` **Good news: I could not reproduce the original compaction loop.** In a native Codex session running a multi-step genealogy audit: - 2 automatic compactions were requested and completed successfully. - 34 tool commands completed successfully. - Codex retained its progress across both compactions. - No repeated discovery loops or unjustified reprocessing were observed. - Codex completed the task and delivered its final report. The session completed in approximately 325 seconds. This is not a strictly identical reproduction of the original October environment (Codex 0.166.0 instead of 0.165.0, synthetic dataset, bounded tool outputs), so I cannot claim the underlying issue is universally fixed. However, the original failure mode did not occur, and the new version behaved correctly in this test. **No reopening needed from my side.** Thanks again for your work on Strata!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2051
No description provided.