-
Notifications
You must be signed in to change notification settings - Fork 16.2k
feat(core): store turn_id on ResponseItem metadata #28360
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2684,6 +2684,10 @@ impl Session { | |
| ) -> Cow<'a, [ResponseItem]> { | ||
| let mut items = Cow::Borrowed(items); | ||
| prepare_response_items(items.to_mut()); | ||
| // Most response items get their passthrough turn ID at the durable history boundary. | ||
| for item in items.to_mut() { | ||
| item.set_turn_id_if_missing(&turn_context.sub_id); | ||
| } | ||
| if turn_context.config.features.enabled(Feature::ItemIds) { | ||
| Self::assign_missing_response_item_ids(items) | ||
| } else { | ||
|
|
@@ -2780,8 +2784,9 @@ impl Session { | |
| pub(crate) async fn record_inter_agent_communication( | ||
| &self, | ||
| turn_context: &TurnContext, | ||
| communication: InterAgentCommunication, | ||
| mut communication: InterAgentCommunication, | ||
| ) { | ||
| communication.set_turn_id_if_missing(&turn_context.sub_id); | ||
| let response_item = communication.to_model_input_item(); | ||
| let items = self.prepare_conversation_items_for_history( | ||
| turn_context, | ||
|
|
@@ -3327,6 +3332,11 @@ impl Session { | |
| { | ||
| items.push(guardian_developer_message); | ||
| } | ||
| // Some callers insert initial context into prompt/replacement history without first | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. who does?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New context windows and compaction; tightened the comment. |
||
| // passing through `record_conversation_items`. | ||
| for item in &mut items { | ||
| item.set_turn_id_if_missing(&turn_context.sub_id); | ||
| } | ||
| items | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.