Skip to content

[backport] Validate required params in add_comment_to_pending_review (upstream main) #21

Description

@gastrodon

Summary

add_comment_to_pending_review used mapstructure.WeakDecode to parse parameters, which silently zero-valued missing required arguments (e.g. a missing owner would become the empty string ""). This caused the GraphQL query to run with zero values rather than returning a clear validation error.

Fix: replace WeakDecode with explicit RequiredParam[string] / RequiredInt calls for owner, repo, pullNumber, path, body, and subjectType. Missing arguments now return an isError tool result with a descriptive message before any API call is made.

Upstream reference

Fork conflict

None. The fork does not modify add_comment_to_pending_review.

Context

Agents calling this tool without all required parameters would receive opaque GraphQL errors (or partial results) instead of actionable validation feedback. Returning isError: true with a clear message lets the agent self-correct on the next invocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backportBackport from upstreambugSomething isn't workingno-opFork already has equivalent functionality

    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