Skip to content

[plan] Fix update-discussion API error when targeting explicit discussion_number #23304

@github-actions

Description

@github-actions

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

  1. Open actions/setup/js/update_discussion.cjs and find the GraphQL mutation used to update a discussion
  2. Add better error logging to capture the full API response / error detail
  3. 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
  4. 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

  • The update-discussion handler successfully updates a discussion when given an explicit discussion_number
  • Error messages include enough detail to diagnose failures (API response body, status code)
  • The smoke test run passes for update-discussion when the agent provides a valid discussion_number

References

Generated by Plan Command for issue #23283 ·

  • expires on Mar 30, 2026, 1:55 AM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions