Skip to content

Centralize context update diffing logic#11807

Merged
charley-oai merged 5 commits intomainfrom
cc/centralize-context-update-diffing
Feb 17, 2026
Merged

Centralize context update diffing logic#11807
charley-oai merged 5 commits intomainfrom
cc/centralize-context-update-diffing

Conversation

@charley-oai
Copy link
Collaborator

@charley-oai charley-oai commented Feb 14, 2026

Summary

This PR centralizes model-visible state diffing for turn context updates into one module, while keeping existing behavior and call sites stable.

What changed

  • Added core/src/context_updates.rs with the consolidated diffing logic for:
    • environment context updates
    • permissions/policy updates
    • collaboration mode updates
    • model-instruction switch updates
    • personality updates
  • Added BuildSettingsUpdateItemsParams so required dependencies are passed explicitly.
  • Updated Session::build_settings_update_items in core/src/codex.rs to delegate to the centralized module.
  • Reused the same centralized personality_message_for helper from initial-context assembly to avoid duplicated logic.
  • Registered the new module in core/src/lib.rs.

Why

This is a minimal, shippable step toward the model-visible-state design: all state diff decisions for turn-context update items now live in one place, improving reviewability and reducing drift risk without expanding scope.

Behavior

  • Intended to be behavior-preserving.
  • No protocol/schema changes.
  • No call-site behavior changes beyond routing through the new centralized logic.

Testing

Ran targeted tests in this worktree:

  • cargo test -p codex-core build_settings_update_items_emits_environment_item_for_network_changes
  • cargo test -p codex-core collaboration_instructions --test all

Both passed.

Codex author

codex resume 019c540f-3951-7352-a3fa-6f07b834d4ce

@charley-oai charley-oai force-pushed the cc/centralize-context-update-diffing branch from 9566998 to 42697af Compare February 14, 2026 23:58
@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

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

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

@charley-oai charley-oai force-pushed the cc/centralize-context-update-diffing branch 2 times, most recently from 65b18b9 to 007e72a Compare February 16, 2026 19:10
@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. 👍

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

@charley-oai charley-oai force-pushed the cc/centralize-context-update-diffing branch from ed02fd0 to 37ae399 Compare February 17, 2026 06:27
@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

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

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: 37ae399a74

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

@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Keep it up!

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

@charley-oai charley-oai merged commit cab607b into main Feb 17, 2026
31 of 33 checks passed
@charley-oai charley-oai deleted the cc/centralize-context-update-diffing branch February 17, 2026 17:21
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 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.

2 participants