Skip to content

Evaluate profiles again before native tool continuations - #398

Merged
mattt merged 1 commit into
mainfrom
mattt/native-profile-tool-round
Nov 6, 2026
Merged

mattt merged 1 commit into
mainfrom
mattt/native-profile-tool-round

Conversation

@mattt

@mattt mattt commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

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 of RequestContext.

Each profile request now uses a native profile. Its onToolOutput action resolves the next context with resolvedRequestContext(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.

@mattt
mattt merged commit 0e382b1 into main Nov 6, 2026
12 checks passed
@mattt
mattt deleted the mattt/native-profile-tool-round branch November 6, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant