Skip to content

issues reply fails: CommentCreateInput missing issueId (Argument Validation Error) #226

Closed

Description

@jjuraszek

Summary

linearis issues reply <root-thread-id> --body "..." always fails with a GraphQL validation error. The reply mutation builds a CommentCreateInput with only parentId + body, omitting the parent entity id (issueId/projectId/initiativeId) that Linear requires even on threaded replies.

Repro

linearis issues reply f94ee0d6-b8d1-4f84-82c3-87076c40ede0 --body "hello"

Actual

{
  "error": "GraphQL request failed: Argument Validation Error - Exactly one of projectUpdateId, initiativeUpdateId, postId, documentContentId, projectId, initiativeId or issueId must be defined."
}

issues discuss (root comment) works fine, because startIssueDiscussion passes issueId. Only the reply path is broken.

Root cause

dist/services/discussion-service.js -> replyToDiscussion:

export async function replyToDiscussion(client, input) {
    await assertRootDiscussionThread(client, input.threadId, input.entityKind);
    const result = await client.request(StartDiscussionDocument, {
        input: {
            parentId: input.threadId,   // no entity id alongside parentId
            body: input.body,
        },
    });
    ...
}

Linear's CommentCreateInput requires exactly one entity id (issueId etc.) in addition to parentId for a threaded reply. The CLI sends only parentId.

Suggested fix (low effort - the data is already fetched)

assertRootDiscussionThread already returns the comment via GetDiscussionCommentContext, which selects issueId, projectId, and initiativeId. Capture its return value and forward the entity id:

export async function replyToDiscussion(client, input) {
    const thread = await assertRootDiscussionThread(client, input.threadId, input.entityKind);
    const result = await client.request(StartDiscussionDocument, {
        input: {
            parentId: input.threadId,
            issueId: thread.issueId ?? undefined,
            projectId: thread.projectId ?? undefined,
            initiativeId: thread.initiativeId ?? undefined,
            body: input.body,
        },
    });
    ...
}

No extra network call needed - the context query already returns all three ids. Same applies to project/initiative reply paths.

Version

linearis 2026.4.9

Activity

  1. linear commented on Jun 10, 2026

    @linear
  2. added a commit that references this issue on Jun 16, 2026
    745ca56
  3. iamfj commented on Jul 2, 2026

    @iamfj
    Member

    Thanks for the detailed report and the fix in #227 — forwarding the parent entity id (issueId/projectId/initiativeId) on threaded replies so they stop hitting the "Exactly one of … must be defined" validation error. This is now rolled out on the prerelease channel (npm i -g linearis@next, currently 2026.6.0-next.5) — would love if you could confirm it on your end. Planning to promote it to stable soon (#231). Happy for any feedback!

  4. added a commit that references this issue on Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions