mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
test(opencode): update tool parameter snapshots and assertions for schema changes
Refresh JSON Schema snapshots and adjust unit tests to reflect recent schema modifications in the opencode tool definitions. - Mark bash `description` field as optional and update its prefix text - Add i18n key fields (headerKey, questionKey, labelKey, descriptionKey) to the question tool snapshot - Flip bash parameter test from rejecting to accepting missing description - Remove stale blank line in snapshot file
This commit is contained in:
@@ -26,7 +26,7 @@ exports[`tool parameters JSON Schema (wire shape) bash 1`] = `
|
||||
},
|
||||
"description": {
|
||||
"description":
|
||||
"Clear, concise description of what this command does in 5-10 words. Examples:
|
||||
"Recommended: a clear, concise description of what this command does in 5-10 words. Examples:
|
||||
Input: ls
|
||||
Output: Lists files in current directory
|
||||
|
||||
@@ -52,7 +52,6 @@ Output: Creates directory 'foo'"
|
||||
},
|
||||
"required": [
|
||||
"command",
|
||||
"description",
|
||||
],
|
||||
"type": "object",
|
||||
}
|
||||
@@ -220,7 +219,6 @@ exports[`tool parameters JSON Schema (wire shape) lsp 1`] = `
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
exports[`tool parameters JSON Schema (wire shape) plan 1`] = `
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
@@ -241,6 +239,10 @@ exports[`tool parameters JSON Schema (wire shape) question 1`] = `
|
||||
"description": "Very short label (max 30 chars)",
|
||||
"type": "string",
|
||||
},
|
||||
"headerKey": {
|
||||
"description": "Optional i18n key for the header; clients fall back to \`header\` when missing",
|
||||
"type": "string",
|
||||
},
|
||||
"multiple": {
|
||||
"description": "Allow selecting multiple choices",
|
||||
"type": "boolean",
|
||||
@@ -253,10 +255,18 @@ exports[`tool parameters JSON Schema (wire shape) question 1`] = `
|
||||
"description": "Explanation of choice",
|
||||
"type": "string",
|
||||
},
|
||||
"descriptionKey": {
|
||||
"description": "Optional i18n key for the description",
|
||||
"type": "string",
|
||||
},
|
||||
"label": {
|
||||
"description": "Display text (1-5 words, concise)",
|
||||
"type": "string",
|
||||
},
|
||||
"labelKey": {
|
||||
"description": "Optional i18n key for the label; clients translate and still reply with \`label\`",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
"ref": "QuestionOption",
|
||||
"required": [
|
||||
@@ -271,6 +281,10 @@ exports[`tool parameters JSON Schema (wire shape) question 1`] = `
|
||||
"description": "Complete question",
|
||||
"type": "string",
|
||||
},
|
||||
"questionKey": {
|
||||
"description": "Optional i18n key for the question text; clients fall back to \`question\` when missing",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
"ref": "QuestionPrompt",
|
||||
"required": [
|
||||
|
||||
@@ -77,9 +77,11 @@ describe("tool parameters", () => {
|
||||
expect(parsed.timeout).toBe(5000)
|
||||
expect(parsed.workdir).toBe("/tmp")
|
||||
})
|
||||
test("rejects missing description (required by zod)", () => {
|
||||
expect(accepts(Bash, { command: "ls" })).toBe(false)
|
||||
// kilocode_change start - description is optional in kilo (see bash.ts Parameters)
|
||||
test("accepts missing description (optional in kilo)", () => {
|
||||
expect(accepts(Bash, { command: "ls" })).toBe(true)
|
||||
})
|
||||
// kilocode_change end
|
||||
test("rejects missing command", () => {
|
||||
expect(accepts(Bash, { description: "list" })).toBe(false)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user