codex - 💡(How to fix) Fix Hook additionalContext spilling breaks long-context memory plugins

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

This is especially painful because compaction is exactly when memory restoration matters most.

RAW_BUFFERClick to expand / collapse

What changed

Codex 0.130.0 appears to hard-limit hook-injected additionalContext to about 2,500 tokens per hook output. Larger hook context is written to a temp file and replaced in the model-visible context with a truncated preview plus:

Full hook output saved to: ...

Why this is a problem

This is a major limitation for memory plugins.

A useful long-term memory plugin often needs to inject substantially more than 2,500 tokens of structured context, for example:

  • durable user facts
  • recent cross-thread conversation history
  • project/task history
  • calendar or external state
  • summaries and archive references
  • post-compaction restoration context

The whole point of hook-based memory is that the plugin can rebuild model-visible context at lifecycle boundaries like SessionStart, UserPromptSubmit, and now PostCompact / post-compaction recovery.

If Codex silently replaces most of that context with a file path, the model no longer actually has the memory. It has to notice the path, decide to read it, and spend a tool call doing so. That changes memory from ambient context into an optional retrieval task, which is much weaker and less reliable.

Request

Please revert this hard limit, or make it configurable.

Ideally:

  • allow users/plugins to opt out of spilling for trusted hooks
  • or expose a configurable hook_additional_context_token_limit
  • or apply the spill only to UI/display output, not to model-visible additionalContext

I understand the motivation to prevent unbounded hook output growth, but a fixed ~2,500-token ceiling makes serious memory plugins much less useful.

Concrete use case

I maintain a Codex long-term-memory plugin that injects cross-thread history and user facts through hooks, and reinjects memory after compaction. The new PostCompact hook support is very useful, but the new spilling behavior undermines the same use case by preventing full memory from being placed back into context.

This is especially painful because compaction is exactly when memory restoration matters most.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING