Skip to content

feat: add metadata-only app/read#31343

Open
stevenlee-oai wants to merge 2 commits into
mainfrom
dev/stevenlee/m3-connector-metadata-store
Open

feat: add metadata-only app/read#31343
stevenlee-oai wants to merge 2 commits into
mainfrom
dev/stevenlee/m3-connector-metadata-store

Conversation

@stevenlee-oai

Copy link
Copy Markdown
Contributor

Codex Thread 019f39de-e02c-79d0-9263-2447105cae69

Why

M3 needs a fast, fresh, consistent way for app-server clients to read metadata for selected connector IDs without rebuilding connector runtime state or reloading MCP tools. This adds that metadata-only seam while preserving existing app/list and app/list/updated behavior.

What changed

  • Adds ConnectorMetadataStore, partitioned by ChatGPT backend base URL, account, ChatGPT user, and workspace classification, using the existing connector-directory TTL.
  • Adds v2 app/read { appIds } -> { apps, missingAppIds }.
  • Enforces a 100-ID input cap, de-duplicates repeated IDs in first-request order, and returns both apps and misses in that order.
  • Reads fresh cache entries first, then makes at most one batch request for missing or expired IDs with include_actions=false and include_model_descriptions=false.
  • Treats unknown or unauthorized IDs as partial misses. Backend or transport failures return an RPC error without replacing cached records.
  • Keeps the metadata shape limited to id, name, description, distributionChannel, branding, appMetadata, labels, and nullable installUrl; it excludes runtime state, MCP tools, actions, model descriptions, and icons.
  • Parses optional backend install_url so mixed-version responses that omit it remain safe.

Public backend dependency

Depends on openai/openai#1097857, commit 9593a5ca75201. That change leaves the existing internal /v2/connectors/batch source, tests, and OpenAPI unchanged and adds only the authenticated public projection at /public/connectors/batch.

Codex calls POST https://chatgpt.com/backend-api/ps/connectors/batch. The ChatGPT gateway validates Identity Edge app_v2, injects the actor biscuit, and rewrites /ps/* to Plugin Service /public/*. Plugin Service requires an authenticated user, forces the trusted ChatGPTAuthorizationSchema, and delegates to the existing resolver visibility logic. Codex continues sending the captured auth headers: Authorization, ChatGPT-Account-ID when applicable, optional X-OpenAI-Fedramp, OAI-Product-Sku: codex, and JSON content type; no extra auth-schema field is added.

The auth snapshot also defines the cache scope before the request is awaited, so late responses can commit only to the backend/account/workspace key under which they were requested.

Scope and non-goals

  • No behavior changes to app/list or app/list/updated.
  • No connector-tool reloads or runtime-state reporting from app/read.
  • No M4/M5 work or unrelated refactors.
  • No new codex.apps.read.duration_ms metric; the current app-server metric seam appears to depend on M1 and is intentionally out of scope.

Validation

  • just fmt
  • just test -p codex-connectors
  • just test -p codex-app-server-protocol
  • just test -p codex-chatgpt
  • just test -p codex-app-server app_read
  • just fix -p codex-connectors -p codex-chatgpt -p codex-app-server-protocol -p codex-app-server
  • git diff --check origin/main...HEAD

@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: 03433b693e

ℹ️ 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".

serialization: global("config"),
response: v2::PluginShareDeleteResponse,
},
AppsRead => "app/read" {

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.

P2 Badge Gate experimental app/read behind capability

Because the new AppsReadParams/response types are documented as EXPERIMENTAL, adding the variant here without #[experimental("app/read")] makes ClientRequest::experimental_reason() return None for app/read. The app-server will therefore accept this experimental surface from clients that did not initialize with experimentalApi, and it will be omitted from the experimental client-method metadata; add the method annotation here (or make the API explicitly stable).

AGENTS.md reference: AGENTS.md:L286-L287

Useful? React with 👍 / 👎.

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