Skip to content

[faster-connectors] (1/4) Extract apps cache logic into ConnectorRuntimeManager - #31471

Open
mzeng-openai wants to merge 9 commits into
mainfrom
dev/mzeng/apps-runtime-state-manager
Open

[faster-connectors] (1/4) Extract apps cache logic into ConnectorRuntimeManager#31471
mzeng-openai wants to merge 9 commits into
mainfrom
dev/mzeng/apps-runtime-state-manager

Conversation

@mzeng-openai

Copy link
Copy Markdown
Contributor

What

  • Extract the existing Codex Apps tools cache behind ConnectorRuntimeManager, ConnectorRuntimeContext, and an immutable tools-plus-refresh-time snapshot.
  • Scope the active runtime context by account, ChatGPT user, workspace-account mode, and Codex home; discard stale contexts on context changes.
  • Keep the existing schema-v4 tools-only cache wire format, while adding a 32 MiB bounded read, file-mtime cold-load bookkeeping, and atomic replacement.
  • Retain compatibility aliases so existing app/list callers and startup behavior do not change in this slice.
  • Prevent discarded contexts from advertising or executing their old Apps tools, and serialize accepted snapshot persistence so disk cannot regress behind memory.

Why

This is stack PR 1 of 4 for the connector runtime state refactor. It establishes one owner for committed connector runtime state before later PRs add explicit refresh serialization, request-stable consumption, and the v2 app/installed API.

The snapshot intentionally contains runtime facts only: the raw /ps/mcp tools/list ToolInfo set and refreshed_at. Connector directory metadata remains owned by app/read / ConnectorMetadataStore.

Compatibility and impact

  • No public app-server API change.
  • No app/list behavior change.
  • No _meta.installedApps dependency.
  • No connector-directory fetch during runtime load or publication.
  • The persisted schema remains { "schema_version": 4, "tools": [...] }, so existing caches remain readable.

Checks

  • just test -p codex-mcp (112 passed)
  • just fmt

@mzeng-openai
mzeng-openai marked this pull request as ready for review July 7, 2026 22:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f4775b492

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/codex-mcp/src/rmcp_client.rs Outdated
Comment thread codex-rs/codex-mcp/src/connection_manager.rs Outdated
@mzeng-openai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95f76cd3e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/codex-mcp/src/connector_runtime.rs Outdated
Comment thread codex-rs/codex-mcp/src/rmcp_client.rs Outdated
Comment thread codex-rs/codex-mcp/src/rmcp_client.rs Outdated
@mzeng-openai mzeng-openai changed the title codex-mcp: add connector runtime snapshot manager Extract apps cache logic into ConnectorRuntimeManager Jul 8, 2026
@mzeng-openai mzeng-openai changed the title Extract apps cache logic into ConnectorRuntimeManager [faster-connectors][1/4] Extract apps cache logic into ConnectorRuntimeManager Jul 8, 2026
@mzeng-openai mzeng-openai changed the title [faster-connectors][1/4] Extract apps cache logic into ConnectorRuntimeManager [faster-connectors] (1/4) Extract apps cache logic into ConnectorRuntimeManager Jul 8, 2026
@mzeng-openai
mzeng-openai requested a review from a team as a code owner July 10, 2026 04:05
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.

1 participant