Skip to content

Avoid cloning turn items for app-server active turn lookups - #46305

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/4a030655fbc4d229809cf13f80c3d7f788f19c13
Sep 17, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/4a030655fbc4d229809cf13f80c3d7f788f19c13

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Avoid cloning turn items for app-server active turn lookups

Why

App-server callers that only need the active turn ID or its presence currently create a full turn snapshot, unnecessarily cloning its items.

What changed

Expose ThreadState::active_turn_id() and use it for interrupt validation, elicitation turn ID fallback, and teardown and shutdown logging, preserving the existing turn selection behavior.

Testing

Update the interrupt integration test to wait for turn/started instead of a fixed delay and verify that an incorrect turn ID is rejected before successfully interrupting the active turn.

## Why

App-server callers that only need the active turn ID or its presence currently create a full turn snapshot, unnecessarily cloning its items.

## What changed

Expose `ThreadState::active_turn_id()` and use it for interrupt validation, elicitation turn ID fallback, and teardown and shutdown logging, preserving the existing turn selection behavior.

## Testing

Update the interrupt integration test to wait for `turn/started` instead of a fixed delay and verify that an incorrect turn ID is rejected before successfully interrupting the active turn.

GitOrigin-RevId: 4a030655fbc4d229809cf13f80c3d7f788f19c13
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/4a030655fbc4d229809cf13f80c3d7f788f19c13 branch from a98edfb to 55db7e8 Compare September 17, 2026 21:25
@copyberry
copyberry Bot merged commit 55db7e8 into main Sep 17, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/4a030655fbc4d229809cf13f80c3d7f788f19c13 branch September 17, 2026 21:25
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant