[Plan Mode 9/9] (OPTIONAL) GPT-5 prompt foundation#69449
Conversation
Plan Mode Restack OverviewThis stack is a clean rewrite of the oversized plan-mode umbrella PR at The original branch mixed prompt work, plan-state storage, backend plan-mode behavior, advanced approval flows, automation hooks, web UI, text-channel rendering, Telegram delivery, and documentation into one surface. The live diff was This restack deliberately turns that branch into a reviewable sequence:
Global cleanup applied across the whole stack
Draft PR map
Why the child PRs live in the forkGitHub only allows a PR base branch to live in the target repository. Because these are truly stacked follow-on branches, only the root PR can target The child PRs are therefore opened as draft stacked PRs in Review guidance
Validation expectations
Intent of the restackThe goal here is not just smaller diffs. The goal is to make the feature line truthful:
That is why stale rollout artifacts are removed entirely, advanced config is not exposed before its runtime exists, and transport-specific extras are pushed to the edge of the stack instead of living in the middle of the backend review surface. |
|
Closing — GPT-5 prompt foundation will be revisited as a separate focused PR after the main 7-part stack lands. This work needs a deeper review against recent upstream prompt-overlay churn (#65597, #65148, #65069) which is its own audit cycle. The remaining plan-mode work has been restructured into 7 per-part PRs ([Plan Mode 1/7] through [Plan Mode 7/7]) + 1 [Plan Mode FULL] integration bundle. This PR (formerly [Plan Mode 9/9] OPTIONAL) is independent of that rollout and will return on its own. |
Summary
This PR carves the GPT-5 and prompt-layer foundation out of the original plan-mode umbrella PR (#68939, closed; replaced by the 8-PR sequential decomposition).
It exists to land the model-facing groundwork: prompt overlay behavior, agent scope, context-file injection scanning, and system-prompt ordering. Keeping this work separate lets reviewers validate prompt semantics without also reviewing plan persistence, approval gates, UI, or channel behavior.
What This PR Includes
extensions/openai/prompt-overlay.ts) — GPT-5 specific overlay configurationsrc/agents/agent-scope.ts) — reorganized scope semantics for the new prompt foundationsrc/agents/context-file-injection-scan.ts) — security-oriented scan for prompt-injection patterns in context filessrc/agents/system-prompt.ts,src/agents/pi-embedded-runner/system-prompt.ts,src/agents/system-prompt-contribution.ts) — reordered to put GPT-5-specific guidance firstsrc/agents/system-prompt-gpt5-boot-reorder.test.ts)Files In Scope
Primary review targets (11 files):
extensions/openai/prompt-overlay.ts— overlay logicextensions/openai/index.test.ts— overlay testssrc/agents/agent-scope.ts,src/agents/agent-scope.test.tssrc/agents/context-file-injection-scan.ts,src/agents/context-file-injection-scan.test.tssrc/agents/system-prompt.tssrc/agents/system-prompt-contribution.tssrc/agents/system-prompt-gpt5-boot-reorder.test.tssrc/agents/pi-embedded-runner/system-prompt.tssrc/auto-reply/reply/commands-system-prompt.tsReviewer Guide
extensions/openai/prompt-overlay.ts— the core overlay changesrc/agents/system-prompt.ts+src/agents/pi-embedded-runner/system-prompt.ts— reorder logicsrc/agents/context-file-injection-scan.ts— security additionsValidation:
pnpm vitest run extensions/openai/index.test.ts src/agents/system-prompt-gpt5-boot-reorder.test.ts src/agents/context-file-injection-scan.test.tsWhat This PR Does NOT Include
[Plan Mode 1/9] Plan-state foundation(open now)[Plan Mode 2/9] Core backend MVP(next)[Plan Mode 5/9] Web UI + i18n(later)[Plan Mode 6/9] Text channels + Telegram(later)Issue references
Architecture references
docs/plans/PLAN-MODE-ARCHITECTURE.md— see "GPT-5 Prompt Layer" section (added by this PR or earlier)Test Status
1bd92975c2(main from ~534 commits ago). It will need a focused rebase against currentupstream/mainbefore merge — the prompt-overlay area has had significant churn upstream (agents: split GPT-5 prompt and retry behavior #65597 GPT-5 prompt split, OpenAI: reduce repeated heartbeat alerts #65148 / openai: add heartbeat guidance to GPT-5 overlay #65069 heartbeat overlay strengthening, etc.) and the merge requires GPT-5.4 domain judgment about how this PR's overlay coexists with the recent main evolution. This is the "deep dive" planned after the 8-part stack lands.Carry-forward commitments
extensions/openai/prompt-overlay.tsor thesystem-prompt.tsfiles this PR modifies). Hence it can land in any order relative to the main stack.Status
DRAFT — pending the focused rebase + GPT-5 prompt evolution audit.