Skip to content

feat(set_issue_field): handle builtin issue properties (body, title) via REST API#44152

Closed
pelikhan with Copilot wants to merge 1 commit into
mainfrom
copilot/investigate-agent-body-field-issue
Closed

feat(set_issue_field): handle builtin issue properties (body, title) via REST API#44152
pelikhan with Copilot wants to merge 1 commit into
mainfrom
copilot/investigate-agent-body-field-issue

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

The set_issue_field handler only knew about custom project fields (GraphQL issueFields). When the Codex agent produced field_name: "body" — a built-in REST property — it failed with "Issue field 'body' not found."

Changes

  • set_issue_field.cjs: Added BUILTIN_ISSUE_FIELDS = {"body", "title"}. When field_name matches a builtin, skip GraphQL discovery entirely and call issues.update() directly. allowed_fields validation still applies; matching is case-insensitive.
// Before: fails — "body" not in issueFields GraphQL response
{ type: "set_issue_field", issue_number: 42, field_name: "body", value: "..." }

// After: routes to issues.update({ body: "..." }) successfully
  • set_issue_field.test.cjs: 5 new tests covering body, title, case-insensitivity, allowed_fields restriction, and wildcard passthrough.
  • safe_outputs_tools.json (both copies): Updated set_issue_field description to surface builtin field support to agents, reducing hallucination of builtin names as custom fields.

When field_name is "body" or "title", use REST API issues.update()
instead of the custom project fields GraphQL API. This prevents the
handler from failing when an agent uses set_issue_field to update
built-in issue properties.

Investigated run 28850818943: the Codex agent chose field_name="body"
instead of selecting from available custom project fields when testing
set_issue_field. With this change the action succeeds gracefully.

Also update the tool description to mention builtin field support,
so agents are more likely to use it correctly going forward.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title feat: add builtin field support (body/title) to set_issue_field handler feat(set_issue_field): handle builtin issue properties (body, title) via REST API Jul 8, 2026
Copilot AI requested a review from pelikhan July 8, 2026 02:06
@pelikhan pelikhan closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants