resetProviderOptionsForNestedCall strips inherited state from opts that does not apply to an ephemeral advisor call. PreviousResponseID is cleared so the nested call is not sent as a chain-mode continuation (BuildAdvisorMessages sends the full history, not an incremental turn). Store is forced off s
(opts fantasy.ProviderOptions)
| 98 | // response on the provider side. Must be called on a cloned map to avoid |
| 99 | // mutating shared parent state. |
| 100 | func resetProviderOptionsForNestedCall(opts fantasy.ProviderOptions) { |
| 101 | for _, value := range opts { |
| 102 | if typed, ok := value.(*fantasyopenai.ResponsesProviderOptions); ok && typed != nil { |
| 103 | storeDisabled := false |
| 104 | typed.PreviousResponseID = nil |
| 105 | typed.Store = &storeDisabled |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | // RemainingUses reports how many advisor calls are still available for the |
| 111 | // current runtime. |