mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 07:10:55 +00:00
fix(cli): add model guard and explicit tools:[] for /btw command
Explicitly pass tools:[] to generateContent to prevent tool invocation in side questions. Add model undefined guard for defensive safety. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d285c4409a
commit
ed9a4edc40
2 changed files with 32 additions and 2 deletions
|
|
@ -45,7 +45,7 @@ async function askBtw(
|
|||
],
|
||||
},
|
||||
],
|
||||
{},
|
||||
{ tools: [] },
|
||||
abortSignal,
|
||||
model,
|
||||
);
|
||||
|
|
@ -97,6 +97,14 @@ export const btwCommand: SlashCommand = {
|
|||
const geminiClient = config.getGeminiClient();
|
||||
const model = config.getModel();
|
||||
|
||||
if (!model) {
|
||||
return {
|
||||
type: 'message',
|
||||
messageType: 'error',
|
||||
content: t('No model configured.'),
|
||||
};
|
||||
}
|
||||
|
||||
// ACP mode: return a stream_messages async generator
|
||||
if (executionMode === 'acp') {
|
||||
const messages = async function* () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue