Skip to content

Recover gRPC code-mode sessions after missing-session errors - #52235

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/85b38fdbd6d59268447b6aa6a85ea7c60ec869a7
Oct 8, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/85b38fdbd6d59268447b6aa6a85ea7c60ec869a7

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Recover gRPC code-mode sessions after missing-session errors

Why

A host can reject a request for an unknown session while its lease streams remain open. Keeping that session binding prevents subsequent execution from recovering.

What changed

Invalidate the session when Execute (including its response stream), Wait, or Terminate returns NOT_FOUND, allowing the next execution to open a fresh session. Return the failed call's error without replaying execution.

Document that these RPCs reserve NOT_FOUND for unknown sessions, while CompleteToolCall can use it for a missing invocation.

Testing

Add regression coverage for recovery with lease streams still open, no replay of failed execution, and preservation of session state after INVALID_ARGUMENT. Add a cancellation-race test confirming that a late tool-completion NOT_FOUND leaves the session open.

## Why

A host can reject a request for an unknown session while its lease streams remain open. Keeping that session binding prevents subsequent execution from recovering.

## What changed

Invalidate the session when `Execute` (including its response stream), `Wait`, or `Terminate` returns `NOT_FOUND`, allowing the next execution to open a fresh session. Return the failed call's error without replaying execution.

Document that these RPCs reserve `NOT_FOUND` for unknown sessions, while `CompleteToolCall` can use it for a missing invocation.

## Testing

Add regression coverage for recovery with lease streams still open, no replay of failed execution, and preservation of session state after `INVALID_ARGUMENT`. Add a cancellation-race test confirming that a late tool-completion `NOT_FOUND` leaves the session open.

GitOrigin-RevId: 85b38fdbd6d59268447b6aa6a85ea7c60ec869a7
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Note

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/85b38fdbd6d59268447b6aa6a85ea7c60ec869a7 branch from 78a611d to 137f25f Compare October 8, 2026 19:15
@copyberry
copyberry Bot merged commit 137f25f into main Oct 8, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/85b38fdbd6d59268447b6aa6a85ea7c60ec869a7 branch October 8, 2026 19:15
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 8, 2026
@makki003
makki003 deployed to issue-triage October 8, 2026 19:16 — with Image GitHub Actions Active
@makki003
makki003 deployed to issue-triage October 8, 2026 19:16 — with Image GitHub Actions Active
@makki003
makki003 deployed to issue-triage October 8, 2026 19:16 — with Image GitHub Actions Active
@atrax2k
atrax2k deployed to issue-triage October 8, 2026 19:17 — with Image GitHub Actions Active
@atrax2k
atrax2k deployed to issue-triage October 8, 2026 19:17 — with Image GitHub Actions Active
@atrax2k
atrax2k deployed to issue-triage October 8, 2026 19:17 — with Image GitHub Actions Active
@fcufk
fcufk deployed to issue-triage October 8, 2026 19:18 — with Image GitHub Actions Active
@fcufk
fcufk deployed to issue-triage October 8, 2026 19:18 — with Image GitHub Actions Active
@fcufk
fcufk deployed to issue-triage October 8, 2026 19:18 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 19:18 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 19:18 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 19:18 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 19:20 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 19:21 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 19:21 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 19:21 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 19:22 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — 137f25f6 Deployed Oct 8, 2026 by COOLak via Identify potential duplicates (open issues fallback) #53293
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.

5 participants