mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
fix: switch system prompt to avoid malformed tool_calls (#650)
* fix: switch system prompt to avoid malformed tool_calls * fix: circular dependency issue and configurable tool-call style * fix: regExp issue
This commit is contained in:
@@ -521,6 +521,18 @@ export class Config {
|
||||
if (this.contentGeneratorConfig) {
|
||||
this.contentGeneratorConfig.model = newModel;
|
||||
}
|
||||
|
||||
// Reinitialize chat with updated configuration while preserving history
|
||||
const geminiClient = this.getGeminiClient();
|
||||
if (geminiClient && geminiClient.isInitialized()) {
|
||||
// Use async operation but don't await to avoid blocking
|
||||
geminiClient.reinitialize().catch((error) => {
|
||||
console.error(
|
||||
'Failed to reinitialize chat with updated config:',
|
||||
error,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
isInFallbackMode(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user