fix(chat): Preserve Pi history across turns#288
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
activeTurnIdwithout 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.