Skip to content

Supervise controlled-session lifecycle - #30

Open
omry wants to merge 1 commit into
pr29from
pr30
Open

Supervise controlled-session lifecycle#30
omry wants to merge 1 commit into
pr29from
pr30

Conversation

@omry
omry changed the base branch from main to pr29 August 8, 2026 21:46
@omry
omry marked this pull request as ready for review August 8, 2026 21:47
Copilot AI lite review requested due to automatic review settings August 8, 2026 21:47
@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

Implements a host-owned controlled-session supervisor that orchestrates controller/workload startup, request handling, termination, output finalization, result delivery/ack, and cleanup, aligning the Docker runtime adapter with supervised lifecycle ownership.

Changes:

  • Add RunControlledSessionV1 and supporting supervisor implementation to drive the controlled-session lifecycle machine end-to-end.
  • Harden Docker workload PTY handling by switching lifecycle operations to container-ID targeting and adding explicit Started()/Cleanup() semantics.
  • Extend the lifecycle machine to represent startup failures where workload output finalization is still pending, plus add unit + Docker integration evidence and update design docs.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/dockerdeploy/testdata/session_channel_helper/main.go Adds a “supervise” mode to exercise the supervisor lifecycle over the session channel.
internal/dockerdeploy/controlled_session_workload_pty.go Tracks container ID and adds Started()/Cleanup() for supervised teardown correctness.
internal/dockerdeploy/controlled_session_workload_pty_test.go Updates PTY adapter tests for container-ID operations and cleanup idempotence.
internal/dockerdeploy/controlled_session_supervisor.go New supervisor that owns the controlled-session lifecycle from prepare through delivery-tail cleanup.
internal/dockerdeploy/controlled_session_supervisor_test.go New unit tests covering normal lifecycle, cancellation, runtime-loss, and deadlines.
internal/dockerdeploy/controlled_session_supervisor_integration_test.go New Docker integration test validating end-to-end supervised behavior and cleanup.
internal/dockerdeploy/controlled_session_controller.go Reuses shared Docker container-ID parsing helper.
internal/dockerdeploy/controlled_session_controller_test.go Updates container-ID parsing test to the renamed shared helper.
internal/controlledsession/lifecycle.go Adds startup-failure modeling for “pending workload output finalization” cases.
internal/controlledsession/lifecycle_test.go Adds coverage for startup failure waiting on partially-started workload output finalization.
docs/CONTROLLED_SESSION_DESIGN.md Updates design documentation to reflect the implemented host supervisor.

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

Comment on lines +489 to +492
func (process *fakeControlledSessionProcessV1) ForceStop(context.Context) error {
process.forceStopped = true
return nil
}
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: c8b257055e

ℹ️ 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 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: 88709615e2

ℹ️ 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/dockerdeploy/controlled_session_supervisor.go
@omry

omry commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: d41e0f3203

ℹ️ 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/dockerdeploy/controlled_session_supervisor.go
@omry

omry commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: e6416ae1db

ℹ️ 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/dockerdeploy/controlled_session_supervisor.go
@omry

omry commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 215c80816e

ℹ️ 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/dockerdeploy/controlled_session_supervisor.go
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 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: 01b3781416

ℹ️ 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/dockerdeploy/controlled_session_supervisor.go
@omry

omry commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: f9a9982870

ℹ️ 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/dockerdeploy/testdata/session_channel_helper/main.go Outdated
@omry

omry commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: d05ab95d56

ℹ️ 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 added the approved PR reviewed and approved label Aug 9, 2026
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