Objective
Investigate and fix the API error that occurs when update-discussion handler is called with an explicit discussion_number in the message.
Context
From issue #23283 (smoke test findings): When the agent hardcoded discussion_number: 45 (because there was no triggering discussion in workflow_dispatch context), the API call failed with:
ERR_API: update discussion #45 failed (attempt 1)
The resolveDiscussionNumber() function in update_discussion.cjs correctly picks up the explicit number when item.discussion_number !== undefined, but the downstream GraphQL mutation fails.
Approach
- Open
actions/setup/js/update_discussion.cjs and find the GraphQL mutation used to update a discussion
- Add better error logging to capture the full API response / error detail
- Check whether the failure is due to:
- Missing/wrong permissions in the GitHub token
- Incorrect GraphQL mutation variables (field names, types)
- Rate limiting or authentication issues
- The discussion being in a closed/locked state
- Fix the root cause and improve error messages to make failures more diagnosable in future runs
Files to Modify
actions/setup/js/update_discussion.cjs — fix GraphQL mutation and/or improve error handling/logging
Acceptance Criteria
References
Generated by Plan Command for issue #23283 · ◷
Objective
Investigate and fix the API error that occurs when
update-discussionhandler is called with an explicitdiscussion_numberin the message.Context
From issue #23283 (smoke test findings): When the agent hardcoded
discussion_number: 45(because there was no triggering discussion inworkflow_dispatchcontext), the API call failed with:The
resolveDiscussionNumber()function inupdate_discussion.cjscorrectly picks up the explicit number whenitem.discussion_number !== undefined, but the downstream GraphQL mutation fails.Approach
actions/setup/js/update_discussion.cjsand find the GraphQL mutation used to update a discussionFiles to Modify
actions/setup/js/update_discussion.cjs— fix GraphQL mutation and/or improve error handling/loggingAcceptance Criteria
update-discussionhandler successfully updates a discussion when given an explicitdiscussion_numberupdate-discussionwhen the agent provides a validdiscussion_numberReferences
Related to Safe-outputs discussions smoke test: update-discussion API error and close-discussion label enforcement #23283