Skip to content

Commit e11cc2e

Browse files
fix(issue_write): make issue_fields schema OpenAI strict-mode safe
Set additionalProperties: false on the issue_fields items object and give the 'value' property an explicit type union, matching the fix applied to push_files (see #2011). Without these, OpenAI Responses API strict-mode callers reject the tool schema with HTTP 400. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c6ce146 commit e11cc2e

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

pkg/github/__toolsnaps__/issue_write.snap

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"issue_fields": {
3333
"description": "Issue field values to set. Each item requires field_name and either value or field_option_name. field_option_name is for single-select fields and is resolved to the corresponding option ID automatically.",
3434
"items": {
35+
"additionalProperties": false,
3536
"properties": {
3637
"field_name": {
3738
"description": "Issue field name",
@@ -42,7 +43,12 @@
4243
"type": "string"
4344
},
4445
"value": {
45-
"description": "Value for text/number/date/single-select fields. For single-select, you can use field_option_name instead."
46+
"description": "Value for text/number/date/single-select fields. For single-select, you can use field_option_name instead.",
47+
"type": [
48+
"string",
49+
"number",
50+
"boolean"
51+
]
4652
}
4753
},
4854
"required": [

pkg/github/issues.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,13 +1547,15 @@ Options are:
15471547
Type: "array",
15481548
Description: "Issue field values to set. Each item requires field_name and either value or field_option_name. field_option_name is for single-select fields and is resolved to the corresponding option ID automatically.",
15491549
Items: &jsonschema.Schema{
1550-
Type: "object",
1550+
Type: "object",
1551+
AdditionalProperties: &jsonschema.Schema{Not: &jsonschema.Schema{}},
15511552
Properties: map[string]*jsonschema.Schema{
15521553
"field_name": {
15531554
Type: "string",
15541555
Description: "Issue field name",
15551556
},
15561557
"value": {
1558+
Types: []string{"string", "number", "boolean"},
15571559
Description: "Value for text/number/date/single-select fields. For single-select, you can use field_option_name instead.",
15581560
},
15591561
"field_option_name": {

0 commit comments

Comments
 (0)