MCPcopy Index your code
hub / github.com/coder/coder / resetProviderOptionsForNestedCall

Function resetProviderOptionsForNestedCall

coderd/x/chatd/chatadvisor/runtime.go:100–108  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

98// response on the provider side. Must be called on a cloned map to avoid
99// mutating shared parent state.
100func 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.

Callers 1

RunAdvisorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected