Skip to content

[Bug][github_graphql] Collect Issues fails on second phase with Field 'requestedIssues' doesn't exist on type 'Query' #8853

@yamoyamoto

Description

@yamoyamoto

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

In v1.0.3-beta12 the second phase of github_graphql Collect Issues (the stale-local-issue cleanup added in #8820) aborts the subtask with Field 'requestedIssues' doesn't exist on type 'Query':

[Collect Issues] ended Graphql collector execution with error
        Wraps: (2) Field 'requestedIssues' doesn't exist on type 'Query'
        Error types: (1) *hintdetail.withDetail (2) graphql.DataError

The unexported requestedIssues field added to GraphqlQueryIssueDetailWrapper in #8820 (issue_collector.go L54-L62) is intended as Go-side per-request metadata — populated before the request (L198) and read in the response callback (L221, L231) to detect issues that disappeared upstream. The merico-ai/graphql marshaller appears not to skip unexported fields, so requestedIssues is emitted as a top-level selection on Query and GitHub rejects it.

What do you expect to happen

Collect Issues completes both phases when _tool_github_issues already has rows.

How to reproduce

  1. Collect Data once so _tool_github_issues has rows for the scope.
  2. Collect Data again — phase 2 fails on the first request.

A scope with an empty _tool_github_issues skips phase 2 and does not surface the bug.

Anything else

The right fix is to move requestedIssues out of GraphqlQueryIssueDetailWrapper and keep it on the closure or on GithubTaskData. merico-ai/graphql's writeQuery (query.go L111-L173) does not special-case graphql:"-" (the tag value would just be rendered as the field name -) and does not skip unexported fields, so there is no struct-tag-only escape hatch on the wrapper as written.

Version

v1.0.3-beta12

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/pluginsThis issue or PR relates to pluginspriority/highThis issue is very importantseverity/p1This bug affects functionality or significantly affect uxtype/bugThis issue is a bug

    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