Skip to content

Apply backpressure to live exec output subscribers - #464

Merged
yzhuang-oai merged 3 commits into
openai:mainfrom
frantic-openai:codex/orchard-exec-backpressure
Aug 25, 2026
Merged

Apply backpressure to live exec output subscribers#464
yzhuang-oai merged 3 commits into
openai:mainfrom
frantic-openai:codex/orchard-exec-backpressure

Conversation

@frantic-openai

Copy link
Copy Markdown
Contributor

Summary

Live exec subscribers currently use a non-blocking send. When their 128-frame queue fills, Orchard disconnects the subscriber and loses subsequent output and the exit frame.

Reuse sendLocked, the blocking send path already used for history replay. This preserves frame order, applies backpressure, and still stops when the subscriber closes.

Add a regression test that sends 256 stdout frames and verifies the final exit frame.

Reproduction

The regression fails on current main with subscriber closed before output frame 128.

Verification

  • go test ./internal/controller -run '^TestExecSessionLiveOutputAppliesBackpressure$' -count=1
  • go test ./internal/controller -count=1
  • go test -race ./internal/controller -run '^TestExecSessionLiveOutputAppliesBackpressure$' -count=1
  • go vet ./internal/controller
  • git diff --check

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

Copy link
Copy Markdown

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: 2818b340a4

ℹ️ 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".

Comment thread internal/controller/exec_sessions.go Outdated
fkorotkov-oai
fkorotkov-oai previously approved these changes Aug 25, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-25T22:00:25.439470Z 7ac2673 New commits
🔒 Security Review Completed 2026-08-25T22:01:32.573626Z 7ac2673 New commits
ℹ️ 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.

@yzhuang-oai
yzhuang-oai force-pushed the codex/orchard-exec-backpressure branch from abb1a42 to 7ac2673 Compare August 25, 2026 21:59
@yzhuang-oai
yzhuang-oai merged commit 2ce494a into openai:main Aug 25, 2026
3 checks passed
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.

3 participants