Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(maker-core): preserve hidden skill invocation

xd-bobo1849b018855c
diff --git a/packages/maker-core/src/agents/codex/index.test.ts b/packages/maker-core/src/agents/codex/index.test.ts
index b223b4e312..9b7b68fe6e 100644
--- a/packages/maker-core/src/agents/codex/index.test.ts
+++ b/packages/maker-core/src/agents/codex/index.test.ts
@@ -6470,6 +6470,51 @@ describe('CodexAgent MCP thread context hooks', () => {
await handle.close();
});
+ it.each(['system', 'admin'] as const)(
+ 'keeps a palette-hidden %s Skill directly invocable',
+ async (scope) => {
+ const skillPath = path.join(os.homedir(), '.codex', 'skills', `.${scope}`, 'slides', 'SKILL.md');
+ const agent = new CodexAgent(createDeps());
+ const host = installFakeHost(agent, (method, params) => {
+ if (method === Method.SkillsList) {
+ const { cwds = ['/repo'] } = params as { cwds?: string[] };
+ return {
+ data: cwds.map((cwd) => ({
+ cwd,
+ skills: [{
+ name: 'slides',
+ description: 'Create slides',
+ path: skillPath,
+ scope,
+ enabled: true,
+ }],
+ errors: [],
+ })),
+ };
+ }
+ if (method === Method.TurnStart) return { turn: { id: `turn-${scope}-slides` } };
+ return undefined;
+ });
+ const handle = await agent.startSession({
+ sessionId: `session-${scope}-slides`,
+ model: 'gpt-5.4',
+ workingDir: '/repo',
+ });
+
+ await handle.send({ type: 'user', content: '/slides Build a quarterly update' });
+
+ const turnStart = host.request.mock.calls.find(
+ ([method]) => method === Method.TurnStart,
+ )?.[1] as { input?: unknown[] };
+ expect(turnStart.input).toEqual([
+ { type: 'skill', name: 'slides', path: skillPath },
+ { type: 'text', text: 'Build a quarterly update' },
+ ]);
+
+ await handle.close();
+ },
+ );
+
it('lists remote skills through the target remote app-server host', async () => {
const remoteWorkingDir = '/srv/project';
MockCodexTransport.onCreate = (transport) => {
diff --git a/packages/maker-core/src/agents/codex/index.ts b/packages/maker-core/src/agents/codex/index.ts
index 7be370de80..43b31df4f0 100644
--- a/packages/maker-core/src/agents/codex/index.ts
+++ b/packages/maker-core/src/agents/codex/index.ts
@@ -1094,7 +1094,7 @@ function paletteVisibleCodexSkills(skills: readonly SkillMetadata[]): SkillMetad
function selectInvocableCodexSkill(skills: readonly SkillMetadata[], name: string): SkillMetadata | undefined {
const matching = skills.filter((skill) => skill.enabled && skill.name.toLowerCase() === name.toLowerCase());
return matching.find((skill) => skill.scope !== 'system' && skill.scope !== 'admin')
- ?? matching.find(isPaletteVisibleCodexSkill);
+ ?? matching[0];
}
function parseLeadingSlashToken(text: string): { name: string; rest: string } | null {