mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
Merge pull request #2822 from qqqys/fix/cli_command
fix(cli): prevent ideCommand failure from breaking all slash commands…
This commit is contained in:
commit
fe4f2567c6
3 changed files with 62 additions and 12 deletions
|
|
@ -333,17 +333,24 @@ export const useSlashCommandProcessor = (
|
|||
useEffect(() => {
|
||||
const controller = new AbortController();
|
||||
const load = async () => {
|
||||
const loaders = [
|
||||
new McpPromptLoader(config),
|
||||
new BuiltinCommandLoader(config),
|
||||
new BundledSkillLoader(config),
|
||||
new FileCommandLoader(config),
|
||||
];
|
||||
const commandService = await CommandService.create(
|
||||
loaders,
|
||||
controller.signal,
|
||||
);
|
||||
setCommands(commandService.getCommands());
|
||||
try {
|
||||
const loaders = [
|
||||
new McpPromptLoader(config),
|
||||
new BuiltinCommandLoader(config),
|
||||
new BundledSkillLoader(config),
|
||||
new FileCommandLoader(config),
|
||||
];
|
||||
const commandService = await CommandService.create(
|
||||
loaders,
|
||||
controller.signal,
|
||||
);
|
||||
// Avoid overwriting newer results from a subsequent effect run
|
||||
if (!controller.signal.aborted) {
|
||||
setCommands(commandService.getCommands());
|
||||
}
|
||||
} catch (error) {
|
||||
debugLogger.error('Failed to load slash commands:', error);
|
||||
}
|
||||
};
|
||||
|
||||
load();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue