Skip to content

Reuse MCP tool catalogs across sessions - #33184

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/2ed0f29ba53ace12532730f951b175c588aa3ae7
Jul 14, 2026
Merged

Reuse MCP tool catalogs across sessions#33184
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/2ed0f29ba53ace12532730f951b175c588aa3ae7

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 14, 2026

Copy link
Copy Markdown

Reuse MCP tool catalogs across sessions

Why

Starting a new session should not have to wait for an unchanged stdio MCP
server to initialize before its tools can be presented to the model.

What changed

  • Cache recent tool catalogs for matching stdio MCP server configurations and
    use them while a new live connection starts in the background.
  • Bound the process-wide cache to 32 entries with a 30-minute TTL, and key
    entries by the server configuration, environment, working directory, and
    elicitation capabilities that affect the catalog.
  • Keep connection-specific instructions and tool annotations out of cached
    catalogs. Resolve tool calls against the live connection so tools that are
    unavailable or hidden in the new session cannot be invoked from stale data.
  • Publish only the newest completed catalog fetch and do not cache HTTP servers
    or stdio configurations that depend on remotely sourced environment values.

Testing

  • Add coverage for cache expiration, environment changes, catalog sanitization,
    and out-of-order refreshes.
  • Add an end-to-end test that starts inference from cached definitions while a
    replacement MCP process initializes, then verifies calls and visibility
    against the live process.

## Why

Starting a new session should not have to wait for an unchanged stdio MCP
server to initialize before its tools can be presented to the model.

## What changed

- Cache recent tool catalogs for matching stdio MCP server configurations and
  use them while a new live connection starts in the background.
- Bound the process-wide cache to 32 entries with a 30-minute TTL, and key
  entries by the server configuration, environment, working directory, and
  elicitation capabilities that affect the catalog.
- Keep connection-specific instructions and tool annotations out of cached
  catalogs. Resolve tool calls against the live connection so tools that are
  unavailable or hidden in the new session cannot be invoked from stale data.
- Publish only the newest completed catalog fetch and do not cache HTTP servers
  or stdio configurations that depend on remotely sourced environment values.

## Testing

- Add coverage for cache expiration, environment changes, catalog sanitization,
  and out-of-order refreshes.
- Add an end-to-end test that starts inference from cached definitions while a
  replacement MCP process initializes, then verifies calls and visibility
  against the live process.

GitOrigin-RevId: 2ed0f29ba53ace12532730f951b175c588aa3ae7
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/2ed0f29ba53ace12532730f951b175c588aa3ae7 branch from 4a26007 to 42c5d3c Compare July 14, 2026 22:26
@copyberry
copyberry Bot merged commit 42c5d3c into main Jul 14, 2026
14 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/2ed0f29ba53ace12532730f951b175c588aa3ae7 branch July 14, 2026 22:27
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 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