Skip to content

[codex] attribute model catalog HTTP state#26080

Closed
cooper-oai wants to merge 1 commit into
cooper/codex-native-integrity/8from
cooper/codex-native-integrity/9
Closed

[codex] attribute model catalog HTTP state#26080
cooper-oai wants to merge 1 commit into
cooper/codex-native-integrity/8from
cooper/codex-native-integrity/9

Conversation

@cooper-oai

@cooper-oai cooper-oai commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • attribute shared model-catalog refreshes with an explicit native HTTP-state surface
  • pass app-server connection ownership into catalog listing and root thread start, resume, fork, and imported sessions
  • keep ownerless background refreshes unattributed instead of storing mutable process-wide surface state

Stack

PR 9 of 15. Depends on #26067. Followed by #26081.

Validation

  • CARGO_INCREMENTAL=0 cargo check -p codex-models-manager -p codex-model-provider -p codex-core -p codex-app-server
  • CARGO_INCREMENTAL=0 just test -p codex-models-manager
  • CARGO_INCREMENTAL=0 just test -p codex-model-provider
  • targeted app-server model-list and core inherited-surface tests
  • CARGO_INCREMENTAL=0 just fix -p codex-models-manager -p codex-model-provider -p codex-core -p codex-app-server -p codex-memories-write
  • just fmt
  • just bazel-lock-check
  • git diff --check

@cooper-oai cooper-oai marked this pull request as ready for review June 3, 2026 06:59
@cooper-oai cooper-oai requested a review from a team as a code owner June 3, 2026 06:59

@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: ff2571354d

ℹ️ 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/core/src/session/turn_context.rs Outdated
@cooper-oai cooper-oai force-pushed the cooper/codex-native-integrity/9 branch from ff25713 to 0f22670 Compare June 3, 2026 07:30
@cooper-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Hooray!

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

@cooper-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@cooper-oai cooper-oai force-pushed the cooper/codex-native-integrity/8 branch from c6869d5 to 37a29a6 Compare June 3, 2026 09:54
@cooper-oai cooper-oai force-pushed the cooper/codex-native-integrity/9 branch from d41149a to 0301b58 Compare June 3, 2026 09:54
@cooper-oai

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: 0301b5865b

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

chrono = { workspace = true, features = ["serde"] }
codex-app-server-protocol = { workspace = true }
codex-collaboration-mode-templates = { workspace = true }
codex-http-state = { workspace = true }

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 Include the Bazel lockfile update

This adds a new Rust dependency for codex-models-manager, but the commit updates only Cargo.toml/Cargo.lock and leaves MODULE.bazel.lock unchanged, so the Bazel dependency graph can drift and just bazel-lock-check/Bazel CI may fail for this crate. The repository rule requires refreshing and including MODULE.bazel.lock whenever Rust dependencies change (AGENTS.md lines 34-37).

Useful? React with 👍 / 👎.

Comment on lines +1092 to +1094
http_state_surface: Some(HttpStateSurface::from_app_server_client_name(
app_server_client_name.as_deref().unwrap_or_default(),
)),

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 Add an integration test for surface-attributed starts

This path now passes a client-derived HttpStateSurface into app-server thread startup, which changes user-facing agent startup/model-catalog behavior, but I only found unit-level plumbing coverage rather than an app-server/core integration test that starts a thread and verifies the surface is carried into the agent/model refresh path. The repo guidance says agent logic changes MUST add an integration test under core/suite (AGENTS.md lines 103-107).

Useful? React with 👍 / 👎.


let config = Arc::new(config);
let http_state_surface = http_state_surface.unwrap_or_else(|| {
http_state_surface_for_session(&session_source, /*client*/ None)

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.

P3 Badge Use the exact argument comment name

This positional None is commented as /*client*/, but the callee parameter is named app_server_client_name, so it violates the repository's argument_comment_lint convention and can fail the local/CI lint. The applicable rule requires the comment before opaque positional literals to exactly match the callee signature (AGENTS.md lines 15-18).

Useful? React with 👍 / 👎.

refresh_strategy: RefreshStrategy,
http_state_surface: HttpStateSurface,
) -> CoreResult<()> {
self.refresh_available_models_inner(refresh_strategy, Some(http_state_surface))

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 Scope cached model catalogs by surface

When a surface-specific refresh uses OnlineIfUncached, this still delegates to the existing cache path, so a fresh models_cache.json written by another app-server client/surface is returned before any /models request is made with the supplied HttpStateSurface. If Desktop and TUI/CLI share the same CODEX_HOME and the backend returns a surface-specific catalog or integrity-state behavior, the second client can silently use the first client's catalog instead of attributing a refresh to its own surface.

Useful? React with 👍 / 👎.

@cooper-oai

Copy link
Copy Markdown
Contributor Author

Superseded by the collapsed seven-PR stack: #26137 through #26143. Closing this prototype layer to keep review focused.

@cooper-oai cooper-oai closed this Jun 3, 2026
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