Skip to content

fix(chat): Preserve Pi history across turns#288

Merged
dcramer merged 3 commits intomainfrom
codex/static-system-prompt
May 6, 2026
Merged

fix(chat): Preserve Pi history across turns#288
dcramer merged 3 commits intomainfrom
codex/static-system-prompt

Conversation

@dcramer
Copy link
Copy Markdown
Member

@dcramer dcramer commented May 6, 2026

Keep the Pi agent prompt prefix cacheable by making the system prompt static and moving volatile runtime facts into per-turn user context. Completed turns now persist durable Pi transcript state, and later turns seed Pi from that history instead of flattening prior Slack context into the new prompt.

Durable Pi History

Conversation state now stores piMessages, fresh turns restore those messages before prompting, and completed replies strip per-turn runtime context before persistence. Checkpoint resumes refresh the per-turn context without duplicating the original user turn.

Auth Pause UX

Auth-blocked turns now rely on the private or ephemeral auth-link delivery itself. The runtime parks the turn and clears activeTurnId without posting an extra public thread note that only says a private link was sent.

Contracts

Prompt, harness, OAuth, resumability, Slack delivery, provider catalog, and OAuth eval docs now encode the static-system-prompt and no-extra-auth-note contracts.

Keep the system prompt static and move volatile runtime context into the current user turn. Persist durable Pi messages across completed turns while stripping per-turn context from stored history.

Stop posting an extra public auth-pause note after private auth-link delivery. Park auth-blocked turns in state so callbacks can resume without adding a second thread message.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment May 6, 2026 8:43pm

Request Review

Route durable Pi transcript history through a local PiMessage type so conversation state, turn results, and tests do not expose the Pi SDK message type directly.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Make checkpoint context refresh update the first matching user context message directly instead of mapping the full transcript with mutable replacement state.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
@dcramer dcramer marked this pull request as ready for review May 6, 2026 20:43
@dcramer dcramer merged commit 119d634 into main May 6, 2026
14 checks passed
@dcramer dcramer deleted the codex/static-system-prompt branch May 6, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant