Skip to content

Add title field to discussion in get_discussion tool #803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

tommaso-moro
Copy link
Contributor

Closes #802

Overview

This PR adds the discussion title field to the query in the get_discussion tool. Without it, the model seems to hallucinate title information (see screenshot below), and in general this seems like an important field for this tool

Demos using this discussion facebook/react#34039

Before (model hallucination)
Screenshot 2025-08-01 at 16 16 09

After (retrieves title correctly)
Screenshot 2025-08-01 at 16 21 33

@tommaso-moro tommaso-moro requested a review from a team as a code owner August 1, 2025 15:34
@Copilot Copilot AI review requested due to automatic review settings August 1, 2025 15:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the title field to the GraphQL query in the get_discussion tool to prevent model hallucination when retrieving GitHub discussion information. The change ensures that discussion titles are properly fetched and included in the response rather than being fabricated by the model.

  • Add title field to the GraphQL query structure and response mapping
  • Update test cases to include title field validation
  • Ensure consistent retrieval of discussion metadata

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/github/discussions.go Add title field to GraphQL query structure and response mapping
pkg/github/discussions_test.go Update test query string and test data to include title field validation

@tommaso-moro tommaso-moro changed the title add title to get_discussion query Add title field to discussion in get_discussion tool Aug 1, 2025
Copy link
Contributor

@mattdholloway mattdholloway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! 🚀

@tommaso-moro tommaso-moro merged commit ff6e859 into github:main Aug 1, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing 'title' field to discussion payload in get_discussion tool
2 participants