mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 22:14:52 -07:00
fix(cli): improve command conflict handling for skills
- Prioritize built-in commands in slashCommandProcessor to ensure they retain their intended names. - Add extensionName to SkillDefinition to track source extensions. - Update ExtensionManager to tag loaded skills with their source extension name. - Update SlashCommandResolver and SlashCommandConflictHandler to properly handle and describe conflicts involving skills. - Skill conflicts from extensions now produce clear notifications like "Extension 'google-workspace' skill '/chat' was renamed to '/google-workspace.chat'" instead of generic "Existing command" messages. Fixes built-in command rename issues observed on startup.
This commit is contained in:
@@ -480,6 +480,7 @@ describe('oauth2', () => {
|
||||
expect(fs.existsSync(googleAccountPath)).toBe(true);
|
||||
if (fs.existsSync(googleAccountPath)) {
|
||||
const cachedGoogleAccount = fs.readFileSync(googleAccountPath, 'utf-8');
|
||||
|
||||
expect(JSON.parse(cachedGoogleAccount)).toEqual({
|
||||
active: 'test-user-code-account@gmail.com',
|
||||
old: [],
|
||||
@@ -1349,7 +1350,7 @@ describe('oauth2', () => {
|
||||
let dataHandler: ((data: Buffer) => void) | undefined;
|
||||
await vi.waitFor(() => {
|
||||
const dataCall = stdinOnSpy.mock.calls.find(
|
||||
(call: [string, ...unknown[]]) => call[0] === 'data',
|
||||
(call: [string | symbol, ...unknown[]]) => call[0] === 'data',
|
||||
);
|
||||
dataHandler = dataCall?.[1] as ((data: Buffer) => void) | undefined;
|
||||
if (!dataHandler) throw new Error('stdin handler not registered yet');
|
||||
|
||||
@@ -27,6 +27,8 @@ export interface SkillDefinition {
|
||||
disabled?: boolean;
|
||||
/** Whether the skill is a built-in skill. */
|
||||
isBuiltin?: boolean;
|
||||
/** The name of the extension that provided this skill, if any. */
|
||||
extensionName?: string;
|
||||
}
|
||||
|
||||
export const FRONTMATTER_REGEX =
|
||||
|
||||
@@ -89,6 +89,7 @@ const mockHeapStatistics = {
|
||||
total_global_handles_size: 8192,
|
||||
used_global_handles_size: 4096,
|
||||
external_memory: 2097152,
|
||||
total_allocated_bytes: 31457280,
|
||||
};
|
||||
|
||||
const mockHeapSpaceStatistics = [
|
||||
|
||||
Reference in New Issue
Block a user