Refactor turn host and session projections#83
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f09f648c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -56,10 +56,7 @@ export class ConversationTurnPreflightService { | |||
| return ConversationTurnPreflightService.persistPrepared({ | |||
| ...args, | |||
| session: persistedSession ?? ConversationTurnPreflightService.readRequiredFallbackSession(args.sessions, args.sessionId), | |||
There was a problem hiding this comment.
Persist the leased session through preflight save
Pass the leased record into persistPrepared instead of persistedSession; right now preflight acquires a lease (leasedSession) but then saves a session built from the unleased snapshot, so the lease is removed before the agent loop runs. That allows a second submit to pass lease_conflict checks and start concurrently against the same session, which can race and overwrite turn state.
Useful? React with 👍 / 👎.
Summary
Validation