Skip to content

Track executor registrations across connection refresh and recovery - #46555

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/4395bc6c57f137691887e6585f52dcc5b958101c
Sep 19, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/4395bc6c57f137691887e6585f52dcc5b958101c

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Track executor registrations across connection refresh and recovery

Why

An executor can renew its registration while retaining its Noise identity. Connection refresh must distinguish registrations even when their keys match, and a stale registry lookup must not retire a session that recovery has already renewed.

What changed

  • Track the installed session's registration and expose it through Environment::cached_executor_registration_id() without connecting. Publish registration changes only when the new connection is installed.
  • Require both registration and executor key to match before refresh reuses a session. Retry stale lookups and prevent recovery from installing a connection after retirement.
  • Pin session recovery to the original Noise key while allowing registration renewal to preserve the session and running processes.
  • Expose CodexThread::active_turn_environment_selections() so hosts can authorize steering against the active turn's selections, including starting and failed environments, independently of later settings updates.

Testing

Add regression coverage for registration replacement, renewal with a running process, stale refresh lookups, missing sessions, and rejection of changed Noise keys. Extend active-turn tests to check selection snapshots across settings updates, deferred startup, and turn completion.

…46555)

## Why

An executor can renew its registration while retaining its Noise identity. Connection refresh must distinguish registrations even when their keys match, and a stale registry lookup must not retire a session that recovery has already renewed.

## What changed

- Track the installed session's registration and expose it through `Environment::cached_executor_registration_id()` without connecting. Publish registration changes only when the new connection is installed.
- Require both registration and executor key to match before refresh reuses a session. Retry stale lookups and prevent recovery from installing a connection after retirement.
- Pin session recovery to the original Noise key while allowing registration renewal to preserve the session and running processes.
- Expose `CodexThread::active_turn_environment_selections()` so hosts can authorize steering against the active turn's selections, including starting and failed environments, independently of later settings updates.

## Testing

Add regression coverage for registration replacement, renewal with a running process, stale refresh lookups, missing sessions, and rejection of changed Noise keys. Extend active-turn tests to check selection snapshots across settings updates, deferred startup, and turn completion.

GitOrigin-RevId: 4395bc6c57f137691887e6585f52dcc5b958101c
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/4395bc6c57f137691887e6585f52dcc5b958101c branch from 0bd716d to 328feb0 Compare September 19, 2026 01:27
@copyberry
copyberry Bot merged commit 328feb0 into main Sep 19, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/4395bc6c57f137691887e6585f52dcc5b958101c branch September 19, 2026 01:27
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 19, 2026
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.

1 participant