Skip to content

Refactor turn host and session projections#83

Merged
roackb2 merged 1 commit into
mainfrom
codex/turn-service-host-projection-cleanup
May 16, 2026
Merged

Refactor turn host and session projections#83
roackb2 merged 1 commit into
mainfrom
codex/turn-service-host-projection-cleanup

Conversation

@roackb2
Copy link
Copy Markdown
Owner

@roackb2 roackb2 commented May 16, 2026

Summary

  • remove the extra ChatTurnHostBridgeBuilder layer and make ConversationEngineHostNormalizer adapt public host callbacks directly into the turn host port
  • move persisted turn summary and compacted-session projection behavior into ChatSessionRecords
  • simplify preflight success output to a single compacted result plus the prepared session

Validation

  • yarn typecheck
  • yarn test src/tests/unit/core/chat-turn-runtime.test.ts src/tests/unit/core/chat-turn-persistence.test.ts src/tests/unit/core/chat-turn-memory-maintenance.test.ts src/tests/unit/core/chat-turn-host-normalizer.test.ts src/tests/unit/core/conversation-engine.test.ts src/tests/integration/chat/chat-runtime.test.ts
  • yarn lint

@roackb2 roackb2 marked this pull request as ready for review May 16, 2026 06:02
@roackb2 roackb2 merged commit 4e710e3 into main May 16, 2026
4 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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