-
Notifications
You must be signed in to change notification settings - Fork 7.2k
chore(event_mapping) handle new ide context format #8796
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
base: main
Are you sure you want to change the base?
Conversation
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: a35500cf5c
ℹ️ 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 content.is_empty() { | ||
| None | ||
| } else { | ||
| Some(UserMessageItem::new(&content)) | ||
| } |
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.
Preserve user turns that only have OutputText
Returning None when content is empty drops any user message that only contains OutputText items. Prior to this change those messages still produced a UserMessageItem, which truncate_before_nth_user_message and collect_user_messages use to count user turns. If older rollout histories or alternate sources encode user text as OutputText (as seen in existing tests and other utilities that treat OutputText as valid text), those turns will now be skipped and forking/compaction can cut at the wrong point or omit user inputs. Consider keeping a user turn when the message has text in OutputText, or otherwise explicitly handling this legacy format.
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.
@aibrahim-oai I believe that dropping OutputText items is expected here, but double-checking this change. We would not expect OutputText to ever appear in a UserMessage, right? conversation_manager.rs appeared to do this, I updated those tests in 8950a17.
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.
supposedly yeah. This abstraction isn't great tbf
8950a17 to
c25b975
Compare
| if is_session_prefix(text) || is_user_shell_command_text(text) { | ||
| return None; | ||
| } | ||
| // user_ide_context is bundled with the user's prompt in its own content item. |
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.
the logic of this file is very brittle and having another behavior is a bit worrying. Why don't attach it to a new message and use the is_session_prefix and is_user_shell_command_text logic?
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.
I think we should migrate to a serialized field that denotes this, rather than relying on the message content itself - planning to follow up on that soon.
06a37a2 to
bdaf072
Compare
Summary
We're migrating the VSCE IDE context to more clearly separate this content in a way that more closely aligns with environment_context and skills. We want to preserve existing split behavior for old threads, at least for now. We might migrate old conversations in the future, but new threads from the VSCE will soon start appearing with a <user_ide_context> tag:
Testing