Hook additionalContext spilling breaks long-context memory plugins
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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗