Skip to content

[Issue] add-comment for Discussion doesn't allow for replies to a threaded comment reply #23944

Description

@corygehr

@copilot add-comment in a discussion should be a threaded comment reply rather than a top level discussion reply.

Originally posted by @pelikhan in #23753

PR #23836 added auto-threading for add_comment when triggered by discussion_comment: it derives replyToId from context.payload.comment.node_id. This works perfectly when the triggering comment is a top-level Discussion comment.

In our case, the triggering comment is itself a threaded reply (Level 1). The handler passes the reply's node_id as replyToId, and GitHub's API returns:

"Parent comment is already in a thread, cannot reply to it"

GitHub Discussions only supports two levels: top-level comments and one level of replies. replyToId must point to a top-level comment.

We tried patching GITHUB_EVENT_PATH in a pre-step to swap the comment.node_id to the parent, but pre-steps run in the agent job while add_comment executes in the safe_outputs job — which gets its own unpatched copy of the event payload.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions