Repository navigation
Evaluate profiles again before native tool continuations - #398
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes the native profile path evaluate a dynamic profile and its history transforms again before the continuation after a tool call, as Foundation Models does.
resolvedRequestContext()returned one prepared context for every evaluation during a request, so a profile session sent its first revision in both requests and ran its transforms once, which contradicted the documentation ofRequestContext.Each profile request now uses a native profile. Its
onToolOutputaction resolves the next context withresolvedRequestContext(including:), so lifecycle actions and history edits work as they do with remote providers, and its history transform sends that context's projection. The projection reads the current prompt from the context's canonical history instead of the live transcript. A transform can now remove or move the current prompt, as in the framework, and a rewritten prompt keeps the options and response format of the native entry. A profile that selects another model for a continuation still continues on the native session's model.