Skip to content

code-mode: type cells by execution capability#29400

Closed
cconger wants to merge 1 commit into
cconger/code-mode-runtime-compact-03f1-pending-generationsfrom
cconger/code-mode-runtime-compact-03f2-cell-capabilities
Closed

code-mode: type cells by execution capability#29400
cconger wants to merge 1 commit into
cconger/code-mode-runtime-compact-03f1-pending-generationsfrom
cconger/code-mode-runtime-compact-03f2-cell-capabilities

Conversation

@cconger

@cconger cconger commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Why

Continuing execution and pause-at-frontier execution have different lifecycle contracts. Allowing callers to mix wait, wait_to_pending, and resume on one untyped handle makes invalid combinations possible and obscures whether pending states are observable.

What

  • Introduce distinct Cell and PausableCell handles.
  • Pair continuing cells with wait.
  • Pair pausable cells with wait_to_pending and generation-checked resume.
  • Track cell kind in the runtime registry and reject mismatched handles.
  • Make the default runtime test harness continuing, with focused pausable tests for the synchronous responses-api/poliwhirl use case.

Stack boundary

This is a Rust SessionRuntime capability split. The host/core protocol continues to expose only the continuing-cell path in this stack; pausable APIs remain a direct runtime API when the runtime becomes public in #29292.

Validation

  • just test -p codex-code-mode
  • Dedicated continuing and pausable runtime contract tests.

Stack parent: #29399.

@cconger cconger force-pushed the cconger/code-mode-runtime-compact-03f2-cell-capabilities branch from 55dad2b to d9bc7ff Compare June 22, 2026 06:48
@cconger cconger force-pushed the cconger/code-mode-runtime-compact-03f1-pending-generations branch from b140ec7 to 8eac740 Compare June 22, 2026 06:48

@jif-oai jif-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approving because it's nit

/// Selects the next observable frontier for a running cell.
/// A cell that continues whenever external input unblocks its runtime.
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub(crate) struct Cell {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we bind these handles to their originating SessionRuntime, or carry/check a runtime token?

@@ -184,10 +220,14 @@ impl<D: SessionRuntimeDelegate> SessionRuntime<D> {

async fn start_cell(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can CellKind be the single source of truth and derive the actor policy from it? Here the args encode the same capability twice

@cconger cconger closed this Jun 23, 2026
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.

2 participants