GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — perf(server): plain Claude question answers skip skill discovery · pingdotgg/t3code@6c3a3a1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src
    • orchestration-v2/Adapters
      • ClaudeAdapterV2.ts
    • provider/Drivers
      • ClaudeSkillDispatch.test.ts
      • ClaudeSkillDispatch.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ import { resolveAttachmentPath } from "../../attachmentStore.ts";
160160
import { snapshotMcpApp } from "../../mcpApps/McpAppSnapshot.ts";
161161
import { resolveClaudeSdkExecutablePath } from "../../provider/Drivers/ClaudeExecutable.ts";
162162
import {
163+
answerMayMentionClaudeSkill,
163164
rewriteClaudeSkillMentionsInAnswer,
164165
planClaudeSkillDispatch,
165166
type ClaudeSkillTarget,
@@ -10438,7 +10439,11 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
1043810439
questions: toolInput.questions,
1043910440
answers: claudeSdkUserInputAnswers(
1044010441
resolvedAnswers,
10441-
yield* userInvocableSkills(context.input.runtimePolicy.cwd),
10442+
Object.values(claudeSdkUserInputAnswers(resolvedAnswers, new Map())).some(
10443+
answerMayMentionClaudeSkill,
10444+
)
10445+
? yield* userInvocableSkills(context.input.runtimePolicy.cwd)
10446+
: new Map(),
1044210447
),
1044310448
},
1044410449
toolUseID: callbackOptions.toolUseID,
Collapse file

‎apps/server/src/provider/Drivers/ClaudeSkillDispatch.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/provider/Drivers/ClaudeSkillDispatch.test.ts
+17-1Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { describe, expect, it } from "vite-plus/test";
22

3-
import { planClaudeSkillDispatch, type ClaudeSkillTarget } from "./ClaudeSkillDispatch.ts";
3+
import {
4+
answerMayMentionClaudeSkill,
5+
planClaudeSkillDispatch,
6+
rewriteClaudeSkillMentionsInAnswer,
7+
type ClaudeSkillTarget,
8+
} from "./ClaudeSkillDispatch.ts";
49

510
const skillPath = (name: string) => `/home/me/.claude/skills/${name}/SKILL.md`;
611

@@ -83,4 +88,15 @@ describe("planClaudeSkillDispatch", () => {
8388
commandText: "/implement the fixes",
8489
});
8590
});
91+
92+
it("pre-check passes every answer the rewrite would change", () => {
93+
const userOnly = new Map([["review", { path: skillPath("review"), userInvocationOnly: true }]]);
94+
for (const answer of ["$review", "ok €review now", "/review", "\n /review it"]) {
95+
expect(rewriteClaudeSkillMentionsInAnswer(answer, userOnly)).not.toBe(answer);
96+
expect(answerMayMentionClaudeSkill(answer)).toBe(true);
97+
}
98+
for (const answer of ["Yes", "Simple, Safe", "see docs/review", ""]) {
99+
expect(answerMayMentionClaudeSkill(answer)).toBe(false);
100+
}
101+
});
86102
});
Collapse file

‎apps/server/src/provider/Drivers/ClaudeSkillDispatch.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/provider/Drivers/ClaudeSkillDispatch.ts
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ export function planClaudeSkillDispatch(
6868
};
6969
}
7070

71+
/** Cheap pre-check so an answer with no skill syntax skips skill discovery. */
72+
export function answerMayMentionClaudeSkill(answer: string): boolean {
73+
return /\p{Sc}|^\s*\//u.test(answer);
74+
}
75+
7176
/** Tool results never expand skills, so an answer only names them for the agent to run. */
7277
export function rewriteClaudeSkillMentionsInAnswer(
7378
answer: string,

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.