Merge pull request #3634 from auyua9/fix/ast-grep-pattern-hints
fix(ast-grep): restore pattern hints in tools
This commit is contained in:
+23
-23
@@ -60,14 +60,14 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
const providerModelsSpy = spyOn(connectedProvidersCache, "readProviderModelsCache").mockReturnValue(null)
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(new Set())
|
||||
const overrides = {
|
||||
sisyphus: { model: "github-copilot/gpt-5.4" },
|
||||
sisyphus: { model: "github-copilot/gpt-5.5" },
|
||||
}
|
||||
|
||||
// #when
|
||||
const agents = await createBuiltinAgents([], overrides, undefined, TEST_DEFAULT_MODEL, undefined, undefined, [], undefined, undefined)
|
||||
|
||||
// #then
|
||||
expect(agents.sisyphus.model).toBe("github-copilot/gpt-5.4")
|
||||
expect(agents.sisyphus.model).toBe("github-copilot/gpt-5.5")
|
||||
expect(agents.sisyphus.reasoningEffort).toBe("medium")
|
||||
expect(agents.sisyphus.thinking).toBeUndefined()
|
||||
providerModelsSpy.mockRestore()
|
||||
@@ -77,9 +77,9 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
test("Atlas uses uiSelectedModel", async () => {
|
||||
// #given
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["openai/gpt-5.4", "anthropic/claude-sonnet-4-6"])
|
||||
new Set(["openai/gpt-5.5", "anthropic/claude-sonnet-4-6"])
|
||||
)
|
||||
const uiSelectedModel = "openai/gpt-5.4"
|
||||
const uiSelectedModel = "openai/gpt-5.5"
|
||||
|
||||
try {
|
||||
// #when
|
||||
@@ -98,7 +98,7 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
|
||||
// #then
|
||||
expect(agents.atlas).toBeDefined()
|
||||
expect(agents.atlas.model).toBe("openai/gpt-5.4")
|
||||
expect(agents.atlas.model).toBe("openai/gpt-5.5")
|
||||
} finally {
|
||||
fetchSpy.mockRestore()
|
||||
}
|
||||
@@ -107,9 +107,9 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
test("user config model takes priority over uiSelectedModel for sisyphus", async () => {
|
||||
// #given
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["openai/gpt-5.4", "anthropic/claude-sonnet-4-6"])
|
||||
new Set(["openai/gpt-5.5", "anthropic/claude-sonnet-4-6"])
|
||||
)
|
||||
const uiSelectedModel = "openai/gpt-5.4"
|
||||
const uiSelectedModel = "openai/gpt-5.5"
|
||||
const overrides = {
|
||||
sisyphus: { model: "google/antigravity-claude-opus-4-5-thinking" },
|
||||
}
|
||||
@@ -140,9 +140,9 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
test("user config model takes priority over uiSelectedModel for atlas", async () => {
|
||||
// #given
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["openai/gpt-5.4", "anthropic/claude-sonnet-4-6"])
|
||||
new Set(["openai/gpt-5.5", "anthropic/claude-sonnet-4-6"])
|
||||
)
|
||||
const uiSelectedModel = "openai/gpt-5.4"
|
||||
const uiSelectedModel = "openai/gpt-5.5"
|
||||
const overrides = {
|
||||
atlas: { model: "google/antigravity-claude-opus-4-5-thinking" },
|
||||
}
|
||||
@@ -265,14 +265,14 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
const providerModelsSpy = spyOn(connectedProvidersCache, "readProviderModelsCache").mockReturnValue(null)
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(new Set())
|
||||
const overrides = {
|
||||
sisyphus: { model: "github-copilot/gpt-5.4", temperature: 0.5 },
|
||||
sisyphus: { model: "github-copilot/gpt-5.5", temperature: 0.5 },
|
||||
}
|
||||
|
||||
// #when
|
||||
const agents = await createBuiltinAgents([], overrides, undefined, TEST_DEFAULT_MODEL, undefined, undefined, [], undefined, undefined)
|
||||
|
||||
// #then
|
||||
expect(agents.sisyphus.model).toBe("github-copilot/gpt-5.4")
|
||||
expect(agents.sisyphus.model).toBe("github-copilot/gpt-5.5")
|
||||
expect(agents.sisyphus.temperature).toBe(0.5)
|
||||
providerModelsSpy.mockRestore()
|
||||
fetchSpy.mockRestore()
|
||||
@@ -306,7 +306,7 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
"opencode/kimi-k2.5-free",
|
||||
"zai-coding-plan/glm-5",
|
||||
"opencode/big-pickle",
|
||||
"openai/gpt-5.4",
|
||||
"openai/gpt-5.5",
|
||||
])
|
||||
)
|
||||
|
||||
@@ -343,7 +343,7 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
test("excludes hidden custom agents from orchestrator prompts", async () => {
|
||||
// #given
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.4"])
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.5"])
|
||||
)
|
||||
|
||||
const customAgentSummaries = [
|
||||
@@ -379,7 +379,7 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
test("excludes disabled custom agents from orchestrator prompts", async () => {
|
||||
// #given
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.4"])
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.5"])
|
||||
)
|
||||
|
||||
const customAgentSummaries = [
|
||||
@@ -415,7 +415,7 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
test("excludes custom agents when disabledAgents contains their name (case-insensitive)", async () => {
|
||||
// #given
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.4"])
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.5"])
|
||||
)
|
||||
|
||||
const disabledAgents = ["ReSeArChEr"]
|
||||
@@ -451,7 +451,7 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
test("does not advertise duplicate custom agents case-insensitively", async () => {
|
||||
// #given
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.4"])
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.5"])
|
||||
)
|
||||
|
||||
const customAgentSummaries = [
|
||||
@@ -483,7 +483,7 @@ describe("createBuiltinAgents with model overrides", () => {
|
||||
test("does not surface custom agent strings in orchestrator prompts", async () => {
|
||||
// #given
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.4"])
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.5"])
|
||||
)
|
||||
|
||||
const customAgentSummaries = [
|
||||
@@ -842,7 +842,7 @@ describe("Atlas is unaffected by environment context toggle", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.4"])
|
||||
new Set(["anthropic/claude-opus-4-7", "openai/gpt-5.5"])
|
||||
)
|
||||
})
|
||||
|
||||
@@ -968,7 +968,7 @@ describe("createBuiltinAgents with requiresAnyModel gating (sisyphus)", () => {
|
||||
// #given - user configures a model from a plugin provider (like antigravity)
|
||||
// that is NOT in the availableModels cache and NOT in the fallback chain
|
||||
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
|
||||
new Set(["openai/gpt-5.4"])
|
||||
new Set(["openai/gpt-5.5"])
|
||||
)
|
||||
const cacheSpy = spyOn(connectedProvidersCache, "readConnectedProvidersCache").mockReturnValue(
|
||||
["openai"]
|
||||
@@ -1098,7 +1098,7 @@ describe("buildAgent with category and skills", () => {
|
||||
|
||||
const categories = {
|
||||
"custom-category": {
|
||||
model: "openai/gpt-5.4",
|
||||
model: "openai/gpt-5.5",
|
||||
variant: "xhigh",
|
||||
},
|
||||
}
|
||||
@@ -1107,7 +1107,7 @@ describe("buildAgent with category and skills", () => {
|
||||
const agent = buildAgent(source["test-agent"], TEST_MODEL, categories)
|
||||
|
||||
// #then
|
||||
expect(agent.model).toBe("openai/gpt-5.4")
|
||||
expect(agent.model).toBe("openai/gpt-5.5")
|
||||
expect(agent.variant).toBe("xhigh")
|
||||
})
|
||||
|
||||
@@ -1357,7 +1357,7 @@ describe("override.category expansion in createBuiltinAgents", () => {
|
||||
// #given - custom category has reasoningEffort=xhigh, direct override says "low"
|
||||
const categories = {
|
||||
"test-cat": {
|
||||
model: "openai/gpt-5.4",
|
||||
model: "openai/gpt-5.5",
|
||||
reasoningEffort: "xhigh" as const,
|
||||
},
|
||||
}
|
||||
@@ -1377,7 +1377,7 @@ describe("override.category expansion in createBuiltinAgents", () => {
|
||||
// #given - custom category has reasoningEffort, no direct reasoningEffort in override
|
||||
const categories = {
|
||||
"reasoning-cat": {
|
||||
model: "openai/gpt-5.4",
|
||||
model: "openai/gpt-5.5",
|
||||
reasoningEffort: "high" as const,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user