-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Add collaboration developer instructions #9424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
aibrahim-oai
commented
Jan 17, 2026
- Add additional instructions when they are available
- Make sure to update them on change either UserInput or UserTurn
|
@codex review this |
There was a problem hiding this 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: 3cb9a6460f
ℹ️ 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".
|
@codex review this |
There was a problem hiding this 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: a146112312
ℹ️ 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".
| .collaboration_mode | ||
| .clone(); | ||
| let next_collaboration_mode = updates.collaboration_mode.clone(); | ||
| let Ok(current_context) = sess.new_turn_with_sub_id(sub_id, updates).await else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emit collab instructions after override+UserInput
Because next_collaboration_mode is taken only from updates, a client that sets collaboration instructions via Op::OverrideTurnContext and then sends Op::UserInput will never append a developer-instructions message: updates.collaboration_mode is None for UserInput, so build_collaboration_mode_update_item is skipped. The session config is updated, but the conversation history (which drives the prompt) doesn’t include the new instructions, so the model never sees them unless every user turn also includes collaboration_mode.
Useful? React with 👍 / 👎.
There was a problem hiding this 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: a146112312
ℹ️ 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".
|
@codex review |
There was a problem hiding this 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: 7d4a6829f2
ℹ️ 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".
7d4a682 to
a146112
Compare
|
@codex review this |
There was a problem hiding this 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: 4afecce60c
ℹ️ 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".
| fn build_collaboration_mode_update_item( | ||
| &self, | ||
| previous_collaboration_mode: &CollaborationMode, | ||
| next_collaboration_mode: Option<&CollaborationMode>, | ||
| ) -> Option<ResponseItem> { | ||
| if let Some(next_mode) = next_collaboration_mode { | ||
| if previous_collaboration_mode == next_mode { | ||
| return None; | ||
| } | ||
| Some(DeveloperInstructions::from_collaboration_mode(next_mode)?.into()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emit a clearing update when collaboration instructions are removed
If a session previously had non-empty collaboration instructions and then updates the collaboration mode to one with developer_instructions unset or empty, build_collaboration_mode_update_item returns None because from_collaboration_mode filters empty text. Since history is append-only and for_prompt() doesn’t drop older developer messages, the old collaboration instructions remain in the prompt for all future turns even though the user tried to clear them. This makes “remove collaboration instructions” a no-op for the model. Consider emitting an explicit clearing instruction (e.g., empty <collaboration_mode> tag or a remove marker) when the mode changes to empty so the prompt reflects the current settings.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this 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: b5c8390521
ℹ️ 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".
| if let Some(next_mode) = next_collaboration_mode { | ||
| if previous_collaboration_mode == next_mode { | ||
| return None; | ||
| } | ||
| // If the next mode has empty developer instructions, this returns None and we emit no | ||
| // update, so prior collaboration instructions remain in the prompt history. | ||
| Some(DeveloperInstructions::from_collaboration_mode(next_mode)?.into()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emit an explicit clear when collab instructions become empty
When collaboration_mode is updated from a non‑empty developer_instructions to an empty/None value, build_collaboration_mode_update_item returns None and no update is recorded. Because conversation history is append‑only, the previous collaboration instructions remain in the prompt history and will still be seen by the model even though the caller attempted to clear them. This shows up when a client sends Op::OverrideTurnContext (or other settings update) with developer_instructions: Some("") or None to remove instructions; the old instructions persist. Consider emitting an explicit “clear” update (e.g., an empty tagged developer message) or a dedicated removal marker so the history reflects the new empty state.
Useful? React with 👍 / 👎.