Summary
The update_project safe-output handler cannot update an existing GitHub Projects v2 NUMBER field through the fields object. A JSON number is inferred as SINGLE_SELECT, so the handler reports a type mismatch and skips the update even though it has code to write number values.
Reproduction
Given an existing Project v2 field:
- Name:
Comment Count
- Type:
NUMBER
Emit this safe output:
{
"type": "update_project",
"project": "https://github.com/orgs/example/projects/1",
"content_type": "issue",
"content_number": 123,
"target_repo": "example/repo",
"fields": {
"Comment Count": 30
}
}
Actual behavior
The handler logs:
Field type mismatch for "Comment Count": Expected SINGLE_SELECT but found NUMBER.
The field is skipped and remains unchanged.
Expected behavior
The existing NUMBER field should be updated to 30.
For an existing field, its actual dataType should determine value coercion. If inference is needed for a missing field, a finite JavaScript number should infer NUMBER rather than SINGLE_SELECT.
Root cause
In v0.83.4, inferFieldDataType can return only DATE, TEXT, or SINGLE_SELECT. Numeric values therefore fall through to SINGLE_SELECT.
The inferred type is checked against the existing field before applying the update. Consequently, the later field.dataType === "NUMBER" branch is unreachable for an existing numeric field supplied through fields.
The same inference logic is present in v0.83.5, v0.84.0, and current main as of 2026-07-29.
Suggested fix
- When a field already exists, use its actual
dataType for coercion rather than rejecting it based on value inference.
- When creating a missing field, infer
NUMBER for finite numeric values.
- Add coverage for updating an existing
NUMBER field with a JSON number, including zero.
Environment
- gh-aw: v0.83.4
- Safe output:
update_project
- Project: organization-owned Project v2
Summary
The
update_projectsafe-output handler cannot update an existing GitHub Projects v2NUMBERfield through thefieldsobject. A JSON number is inferred asSINGLE_SELECT, so the handler reports a type mismatch and skips the update even though it has code to write number values.Reproduction
Given an existing Project v2 field:
Comment CountNUMBEREmit this safe output:
{ "type": "update_project", "project": "https://github.com/orgs/example/projects/1", "content_type": "issue", "content_number": 123, "target_repo": "example/repo", "fields": { "Comment Count": 30 } }Actual behavior
The handler logs:
The field is skipped and remains unchanged.
Expected behavior
The existing
NUMBERfield should be updated to30.For an existing field, its actual
dataTypeshould determine value coercion. If inference is needed for a missing field, a finite JavaScript number should inferNUMBERrather thanSINGLE_SELECT.Root cause
In v0.83.4,
inferFieldDataTypecan return onlyDATE,TEXT, orSINGLE_SELECT. Numeric values therefore fall through toSINGLE_SELECT.The inferred type is checked against the existing field before applying the update. Consequently, the later
field.dataType === "NUMBER"branch is unreachable for an existing numeric field supplied throughfields.The same inference logic is present in v0.83.5, v0.84.0, and current
mainas of 2026-07-29.Suggested fix
dataTypefor coercion rather than rejecting it based on value inference.NUMBERfor finite numeric values.NUMBERfield with a JSON number, including zero.Environment
update_project