Skip to content

Preserve parent cache affinity for ephemeral forks - #44862

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/d235e97630068b27f7ebd562dd23ac6266ebc1b9
Sep 11, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Preserve parent cache affinity for ephemeral forks

Why

ChatGPT derives Responses cache affinity from the session-id header. Ephemeral forks need to reuse their parent's cache routing while retaining their own session and thread identities.

What changed

  • Inherit the parent session ID as the prompt_cache_key for ephemeral root forks.
  • Use the prompt cache key for root-agent Responses session-id headers, including WebSocket handshakes. Preserve the actual session identity in turn metadata and leave non-root-agent routing unchanged.
  • Keep enabled goal tool definitions visible on ephemeral threads, but reject execution with Goal tools require a persistent thread. and disable automatic goal continuation without persistent state.

Testing

Add regression coverage for inherited cache routing with distinct fork identities, matching parent and fork tool definitions, WebSocket session headers, and rejection of ephemeral goal tool execution.

## Why

ChatGPT derives Responses cache affinity from the `session-id` header. Ephemeral forks need to reuse their parent's cache routing while retaining their own session and thread identities.

## What changed

- Inherit the parent session ID as the `prompt_cache_key` for ephemeral root forks.
- Use the prompt cache key for root-agent Responses `session-id` headers, including WebSocket handshakes. Preserve the actual session identity in turn metadata and leave non-root-agent routing unchanged.
- Keep enabled goal tool definitions visible on ephemeral threads, but reject execution with `Goal tools require a persistent thread.` and disable automatic goal continuation without persistent state.

## Testing

Add regression coverage for inherited cache routing with distinct fork identities, matching parent and fork tool definitions, WebSocket session headers, and rejection of ephemeral goal tool execution.

GitOrigin-RevId: d235e97630068b27f7ebd562dd23ac6266ebc1b9
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/d235e97630068b27f7ebd562dd23ac6266ebc1b9 branch from 88ad1e1 to bc5957e Compare September 11, 2026 16:42
@copyberry
copyberry Bot merged commit bc5957e into main Sep 11, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/d235e97630068b27f7ebd562dd23ac6266ebc1b9 branch September 11, 2026 16:42
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 11, 2026
@techrote
techrote deployed to issue-triage September 11, 2026 16:56 — with GitHub Actions Active
@techrote
techrote deployed to issue-triage September 11, 2026 16:56 — with GitHub Actions Active
@techrote
techrote deployed to issue-triage September 11, 2026 16:56 — with GitHub Actions Active
@techrote
techrote deployed to issue-triage September 11, 2026 16:57 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — bc5957ea Deployed Sep 11, 2026 by techrote via Identify potential duplicates (open issues fallback) #44751
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.

3 participants