Skip to content

Bridge controlled-session controller and workload I/O - #29

Open
omry wants to merge 1 commit into
pr28from
pr29
Open

Bridge controlled-session controller and workload I/O#29
omry wants to merge 1 commit into
pr28from
pr29

Conversation

@omry

@omry omry commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Add a backend-neutral bridge that dispatches typed controller requests through lifecycle authorization, applies accepted PTY input and resize operations, and forwards exact ordered output with bounded backpressure.

Give validated lifecycle events a separate prioritized write admission path without allowing callers to forge opened or output events. Preserve explicit cancellation, disconnect, and output-finalization diagnostics while leaving lifecycle and resource ownership to the host supervisor.

Cover authorization rejection, binary output, lifecycle priority and cancellation, slow consumers, disconnects, resize, ordinary Ctrl-C, and exact Docker exit behavior with race-enabled unit and live integration tests. Update the controlled-session implementation status.


@omry
omry changed the base branch from main to pr28 August 8, 2026 20:26
@omry
omry marked this pull request as ready for review August 8, 2026 20:27
Copilot AI lite review requested due to automatic review settings August 8, 2026 20:27
@omry

omry commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI 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.

Pull request overview

Introduces a backend-neutral controlled-session “session I/O bridge” that decouples lifecycle supervision from controller/workload I/O wiring, while preserving strict event ordering and bounded output backpressure. This fits into the controlled-session stack by providing the missing typed request dispatch + PTY output forwarding layer between the private controller channel and the workload PTY adapter.

Changes:

  • Add SessionIOBridgeV1 to dispatch typed controller requests through an injected lifecycle handler and apply accepted PTY input/resize effects.
  • Add a prioritized lifecycle-event write gate to interleave lifecycle-owned events ahead of subsequent output frames (without allowing forged opened/output events).
  • Add unit + Docker integration coverage for binary output, backpressure, disconnect diagnostics, resize, and Ctrl-C/exit behavior; update controlled-session design status docs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
internal/dockerdeploy/controlled_session_session_io_integration_test.go Adds Docker integration coverage for the new session I/O bridge behavior (typed requests, resize, backpressure, disconnect/finalization).
internal/controlledsession/session_io.go Implements the session I/O bridge, accepted PTY request applier, and prioritized lifecycle event write gating.
internal/controlledsession/session_io_test.go Adds unit tests covering PTY effect application, output ordering (including binary), lifecycle prioritization, cancellation, and disconnect surfacing.
docs/CONTROLLED_SESSION_DESIGN.md Updates design/status documentation to reflect that the backend-neutral I/O bridge is now implemented.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@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: 1319a9f80a

ℹ️ 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/controlledsession/session_io.go Outdated
@omry

omry commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 80929aa2d5

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

@omry

omry commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 80929aa2d5

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

Add a backend-neutral bridge that dispatches typed controller requests through lifecycle authorization, applies accepted PTY input and resize operations, and forwards exact ordered output with bounded backpressure.

Give validated lifecycle events a separate prioritized write admission path without allowing callers to forge opened or output events. Preserve explicit cancellation, disconnect, and output-finalization diagnostics while leaving lifecycle and resource ownership to the host supervisor.

Cover authorization rejection, binary output, lifecycle priority and cancellation, slow consumers, disconnects, resize, ordinary Ctrl-C, and exact Docker exit behavior with race-enabled unit and live integration tests. Update the controlled-session implementation status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR reviewed and approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants