Skip to content

Allow sampling in-progress turns with thread/sample - #60620

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/771b979bf677e4ff0686476bfaf21aff92f7e7ac
Nov 10, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/771b979bf677e4ff0686476bfaf21aff92f7e7ac

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Allow sampling in-progress turns with thread/sample

Why

thread/sample previously required the source's latest turn to finish before it could be sampled.

What changed

Add allowInProgressTurn, defaulting to false, to sample a snapshot of the latest turn while the source continues running. The requested turn must still be the latest, but source history changes during sampling no longer invalidate the result when this option is enabled.

For an in-progress snapshot, include a context note explaining that the source was not stopped and pending tool calls may appear as aborted in the copy. Suppress the copy's default interruption message.

Testing

Add coverage for sampling running turns in legacy and paginated history modes, including pending tool calls and mid-turn compaction. Verify that the source continues independently and that finished-turn samples retain their existing context.

## Why

`thread/sample` previously required the source's latest turn to finish before it could be sampled.

## What changed

Add `allowInProgressTurn`, defaulting to `false`, to sample a snapshot of the latest turn while the source continues running. The requested turn must still be the latest, but source history changes during sampling no longer invalidate the result when this option is enabled.

For an in-progress snapshot, include a context note explaining that the source was not stopped and pending tool calls may appear as `aborted` in the copy. Suppress the copy's default interruption message.

## Testing

Add coverage for sampling running turns in legacy and paginated history modes, including pending tool calls and mid-turn compaction. Verify that the source continues independently and that finished-turn samples retain their existing context.

GitOrigin-RevId: 771b979bf677e4ff0686476bfaf21aff92f7e7ac
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/771b979bf677e4ff0686476bfaf21aff92f7e7ac branch from 5d0ec03 to c37fd56 Compare November 10, 2026 16:32
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-10T16:32:22.563088Z 5d0ec03 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit c37fd56 into main Nov 10, 2026
7 of 8 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/771b979bf677e4ff0686476bfaf21aff92f7e7ac branch November 10, 2026 16:32
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026

This branch was previously deployed

1 inactive deployment
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.

2 participants