codex - 💡(How to fix) Fix Plan Mode context should steer Codex to research facts and decisions before proposing a plan [1 participants]

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…
GitHub stats
openai/codex#23481Fetched 2026-05-20 03:49:09
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Plan Mode should be context-engineered as a research-first planning mode, not just a mode that prevents edits and asks the model to write a plan.

For large engineering tasks, a good plan depends on first discovering repo facts, identifying non-discoverable decisions, and asking the user only for the choices that matter. Plan Mode should more consistently steer the agent into that workflow before it emits a final proposal.

Root Cause

Plan Mode is most valuable for work that is too risky to start immediately. In those cases, the plan should be the output of investigation, not a substitute for investigation.

A weak Plan Mode failure looks like:

complex request -> plausible plan -> user rejects -> more plausible plan -> implementation still blocked by unverified assumptions

The desired behavior is:

complex request -> read-only audit -> decision questions -> decision-complete plan -> implementation can start without the next agent making new choices

This would also reduce repeated plan churn and make approved plans more useful as handoff artifacts.

Code Example

1. Explore first: inspect relevant files, configs, docs, tests, and entrypoints without mutating state.
2. Separate facts from preferences: answer discoverable questions from the environment; ask only for non-discoverable decisions.
3. Use structured questions for high-impact tradeoffs when needed.
4. Produce a plan only after the important facts and decisions are stable.
5. Mark assumptions and defaults explicitly when proceeding without an answer.

---

complex request -> plausible plan -> user rejects -> more plausible plan -> implementation still blocked by unverified assumptions

---

complex request -> read-only audit -> decision questions -> decision-complete plan -> implementation can start without the next agent making new choices
RAW_BUFFERClick to expand / collapse

Summary

Plan Mode should be context-engineered as a research-first planning mode, not just a mode that prevents edits and asks the model to write a plan.

For large engineering tasks, a good plan depends on first discovering repo facts, identifying non-discoverable decisions, and asking the user only for the choices that matter. Plan Mode should more consistently steer the agent into that workflow before it emits a final proposal.

Current behavior

In practice, Plan Mode can still produce plans too early. The agent may:

  • propose a plan before enough read-only exploration
  • miss existing interfaces, tests, or constraints that were discoverable from the repo
  • ask broad questions before inspecting likely sources of truth
  • fail to distinguish repo facts from user preferences
  • use request_user_input too late or not at all for high-impact tradeoffs
  • produce a plan that looks structured but is not decision-complete

This is especially visible in large codebases, where an implementation-ready plan must be grounded in actual files, existing architecture, and current test/validation paths.

Expected behavior

Plan Mode should steer the agent toward a stable sequence:

1. Explore first: inspect relevant files, configs, docs, tests, and entrypoints without mutating state.
2. Separate facts from preferences: answer discoverable questions from the environment; ask only for non-discoverable decisions.
3. Use structured questions for high-impact tradeoffs when needed.
4. Produce a plan only after the important facts and decisions are stable.
5. Mark assumptions and defaults explicitly when proceeding without an answer.

This does not require Plan Mode to always use subagents or always ask questions. The main request is stronger mode-specific context engineering so the agent behaves like a careful planner by default.

Why this matters

Plan Mode is most valuable for work that is too risky to start immediately. In those cases, the plan should be the output of investigation, not a substitute for investigation.

A weak Plan Mode failure looks like:

complex request -> plausible plan -> user rejects -> more plausible plan -> implementation still blocked by unverified assumptions

The desired behavior is:

complex request -> read-only audit -> decision questions -> decision-complete plan -> implementation can start without the next agent making new choices

This would also reduce repeated plan churn and make approved plans more useful as handoff artifacts.

Related issues

Related but not identical:

  • #18611: improve Plan Mode decision prompts with richer context
  • #22099: parallel-first subagents and background task management
  • #23164: Plan Mode can fail to call the question asking tool despite needing answers
  • #11321: Plan Mode asks redundant questions
  • #10561: Copy Plan / clear context and start coding workflow

This issue focuses on Plan Mode's prompt/context policy: facts first, decisions second, plan last.

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…

FAQ

Expected behavior

Plan Mode should steer the agent toward a stable sequence:

1. Explore first: inspect relevant files, configs, docs, tests, and entrypoints without mutating state.
2. Separate facts from preferences: answer discoverable questions from the environment; ask only for non-discoverable decisions.
3. Use structured questions for high-impact tradeoffs when needed.
4. Produce a plan only after the important facts and decisions are stable.
5. Mark assumptions and defaults explicitly when proceeding without an answer.

This does not require Plan Mode to always use subagents or always ask questions. The main request is stronger mode-specific context engineering so the agent behaves like a careful planner by default.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING