mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
Fix missing system prompt when switching models in interactive mode
When using /model command to switch models, the system prompt was not being passed to the new provider config. This caused OpenAI Codex to fail with "Instructions are required" error. - Load system prompt using config.LoadSystemPrompt() in SetModel - Pass SystemPrompt to ProviderConfig when building model config - This ensures Codex OAuth gets the instructions field it requires
This commit is contained in:
@@ -536,8 +536,11 @@ func (m *Kit) SetModel(ctx context.Context, modelString string) error {
|
||||
}
|
||||
|
||||
// Build a provider config from current settings, overriding the model.
|
||||
// Load system prompt properly (handles both file paths and inline content).
|
||||
systemPrompt, _ := config.LoadSystemPrompt(viper.GetString("system-prompt"))
|
||||
config := &models.ProviderConfig{
|
||||
ModelString: modelString,
|
||||
SystemPrompt: systemPrompt,
|
||||
ProviderAPIKey: viper.GetString("provider-api-key"),
|
||||
ProviderURL: viper.GetString("provider-url"),
|
||||
MaxTokens: viper.GetInt("max-tokens"),
|
||||
|
||||
Reference in New Issue
Block a user