feat(runtime): Add durable conversation execution profiles#890
Open
dcramer wants to merge 12 commits into
Open
feat(runtime): Add durable conversation execution profiles#890dcramer wants to merge 12 commits into
dcramer wants to merge 12 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3e3f423 to
706b40b
Compare
Materialize immutable model, reasoning, instruction, and tool policies for conversation execution. Preserve handoff epochs and host authority across retries and continuation slices. Fixes #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
Load local CLI runtime dependencies only after selecting the memory state adapter. Keep both explicit and host-configured fixed reasoning authoritative when restoring a resumable session. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
Replace nested conditional expressions with named state and straightforward branches so reasoning and tool-policy precedence are easier to follow. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
Expose catalog dispatchers automatically when the filtered tool set contains allowed deferred tools, without granting access to tools outside the profile. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
046eddd to
9932d6d
Compare
Replace the versioned JSON execution profile with the minimum typed conversation columns. Keep host and adaptive modes encoded through nullability while preserving empty tool allowlists as a distinct restriction. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
9932d6d to
032b8ca
Compare
Define the conversation execution profile as immutable conversation-owned configuration used by each execution slice. Remove baseline and policy wording that obscures the established term. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
Keep the model used when a turn begins separate from the model active at the latest persisted boundary. Conversation detail headers now show the starting model while handoff events retain the transition to the new model. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
3bf94fa to
e78f8b3
Compare
Treat dispatch routing as an internal conversation identity before applying Slack thread parsing. Keep correlation and destination checks intact while allowing agent-dispatch records to use their canonical ids. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
Record each durable turn as an identity plus its starting agent-step boundary. Derive the starting model from the containing context epoch instead of duplicating model state in messages, SQL, or resume records. Require every context epoch to own one exact model. Open an explicit model_change epoch when a fresh turn resolves its profile differently. Preserve the binding across resumes and compaction, and reject commits from a different model. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
When message steps predate explicit context-epoch markers, open a bound replacement epoch with the conversation execution profile. This prevents the projection default from silently selecting the standard model role. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
Use SQL execution.run_id to select the turn whose settings the dashboard reports. Do not borrow a model from an older completed turn when the current run has only sparse operational metadata. Retain a bounded compatibility fallback to session model metadata for conversations created before durable turn rows shipped. Refs #876 Co-Authored-By: OpenAI Codex <noreply@openai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ab984f1. Configure here.
Select the newest turn-session summary as the reporting authority. Mailbox execution run IDs can identify worker attempts rather than user turns, so they are only a fallback for recordless runs. Cover a mailbox run ID that differs from the durable turn ID. Refs #876 Co-Authored-By: OpenAI Codex <noreply@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.

Fixes #876, the first slice of #883.
Every agent entry point now loads one immutable conversation execution profile before entering the shared Pi runtime. The profile is stored as typed columns on
junior_conversations: model profile, reasoning, additional instructions, and an optional tool allowlist. There is no serialized profile document or profile schema version.The durable records have separate ownership:
junior_conversationsjunior_conversation_messagesjunior_agent_stepsjunior_conversation_turns(conversation_id, turn_id, starting_seq), identifying a user request and its starting position in the step log.junior_conversation_turns.starting_seqhas a composite foreign key tojunior_agent_steps. The dashboard derives the turn's starting model from the containing context epoch; model identity is not duplicated on messages, turn rows, or resumability metadata.The epoch invariant is: every execution using an epoch uses that epoch's exact model ID. A handoff opens a new epoch within the same turn. If a model profile resolves differently between fresh turns, the runtime opens a
model_changeepoch before execution. Timeout, auth, and yield resumes keep the existing binding, while compaction and rollback preserve it. The step writer rejects attempts to append output from a different model.Review the typed conversation columns and three-column turn table first, then the projection/runtime changes that enforce the epoch invariant.
0004and0005include generated Drizzle snapshots, which account for most of the line count.