openai / openai/codex

Thread title generation burn tokens unnecessarily by inheriting full Codex agent context and tools

Open
#40,223 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug performance session
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.818.41509

What subscription do you have?

Plus

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

Codex Desktop's automatic thread-title generation appears to inherit almost the full normal Codex agent context, causing several thousand unnecessary input tokens for a task that only needs to generate a short title and description.

I captured the actual Responses API request used for title generation. Even for an initial user prompt of simply:

test

the Luna title-generation request includes:

  • the full additional_tools definitions, including exec, exec_command, apply_patch, MCP resource tools, image generation, etc.
  • the normal Codex agent developer prompt
  • the complete available-skills catalogue
  • global/project AGENTS.md
  • filesystem permissions and environment context

Only after all of that is the actual title-generation prompt appended.

The title-generation request consumed:

  • Input: 4.75K
  • Cache write: 0
  • Cache read: 691
  • Reasoning: 0
  • Output: 175
  • Total: 5.62K

While the main thread itself consumed:

  • Input: 11.1K
  • Cache write: 0
  • Cache read: 896
  • Reasoning: 0
  • Output: 65
  • Total: 12.1K

In other words, for a prompt as simple as "test", 30% of the total input tokens and 27% of the total output tokens consumed are just for the title generation. In absolute numbers it's a small volume, but it's still an avoidable one.

What steps can reproduce the bug?
  1. Setup a local proxy such as @liqngliz/tokenflow.
  2. Start a new conversation in Codex Desktop.
  3. Use a trivial initial prompt such as test.
  4. Locate the captured gpt-5.6-luna request containing the instruction to generate a short UI title.
  5. Inspect its input array.

The title-generation request contains the normal Codex developer instructions, tool definitions, skills, repository instructions, and environment context before the actual title-generation prompt.

The captured request also has tool_choice: "auto" despite the source prompt being only test.

What is the expected behavior?

Thread-title generation should use a narrowly scoped context containing approximately:

  • the title-generation instructions
  • the initial user prompt, or another small bounded transcript slice
  • the structured output schema
  • optionally, a minimal read-only lookup tool surface when the user prompt contains an opaque resource that genuinely needs resolving

It should not inherit unrelated coding tools, skills, repository instructions, filesystem context, or the normal Codex coding-agent developer prompt.

For a prompt such as test, title generation should require hundreds of input tokens at most rather than several thousand.

Additional information

I have a redacted capture of the complete Responses API request and can provide it if useful.

The request clearly shows that this is a separate Luna call used specifically for title generation, with structured title and description output.

Potentially related issues:

  • #24208
    This reports extremely large context being passed to helper-generation tasks and specifically argues that thread-title generation should use a small bounded transcript slice. The observed failure mode there is timeout/reliability rather than the unnecessary baseline context demonstrated here.
  • #32708
    This independently documents that automatic title generation runs as a separate ephemeral root thread. That issue concerns telemetry relationships rather than the context supplied to the helper.

This report is specifically about the context used to initialize that title-generation helper: even for a prompt as simple as test, it receives normal Codex agent instructions, tools, skills, repository instructions, and environment context that appear unnecessary for generating the title.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the separate gpt-5.6-luna title-generation request and the code that constructs its input array, including the title and description output schema. Compare the helper context with the normal agent request; done means title generation receives only bounded transcript content, required instructions, and any justified minimal read-only tools, without unrelated tools or repository context.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
ai, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.