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 — fix(opencode): select Kimi prompt by provider (#42161) · plazoleta-dev/FlupCode@a2e2471

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode
    • src/session
      • system.ts
    • test/session
      • system.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/src/session/system.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/session/system.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ export function provider(model: Provider.Model) {
4040
if (model.api.id.includes("gemini-")) return [PROMPT_GEMINI]
4141
if (model.api.id.includes("claude")) return [PROMPT_ANTHROPIC]
4242
if (model.api.id.toLowerCase().includes("trinity")) return [PROMPT_TRINITY]
43-
if (model.api.id.toLowerCase().includes("kimi")) return [PROMPT_KIMI]
43+
if (
44+
model.api.id.toLowerCase().includes("kimi") ||
45+
["kimi-for-coding", "moonshotai", "moonshotai-cn"].includes(model.providerID)
46+
)
47+
return [PROMPT_KIMI]
4448
return [PROMPT_DEFAULT]
4549
}
4650

Collapse file

‎packages/opencode/test/session/system.test.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/session/system.test.ts
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ describe("session.system", () => {
102102
}
103103
})
104104

105+
test("selects the Kimi prompt for official provider model IDs", () => {
106+
for (const providerID of ["kimi-for-coding", "moonshotai", "moonshotai-cn"]) {
107+
const prompt = SystemPrompt.provider({ providerID, api: { id: "k3" } } as Provider.Model)[0]
108+
expect(prompt).toContain("# Prompt and Tool Use")
109+
}
110+
})
111+
105112
it.effect("skills output is sorted by name and stable across calls", () =>
106113
Effect.gen(function* () {
107114
const prompt = yield* SystemPrompt.Service

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.