Skip to content

chore(tools, github): Add repository, page params + comment fetching#650

Merged
JeanMertz merged 5 commits into
mainfrom
prr220
May 18, 2026
Merged

chore(tools, github): Add repository, page params + comment fetching#650
JeanMertz merged 5 commits into
mainfrom
prr220

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

The github_issues and github_pulls tools were previously hardcoded to the project's own GitHub repository and returned no comments. This commit addresses both limitations.

Both tools now accept a repository parameter in owner/repo form, defaulting to the project's own repo when omitted. A parse_repo() helper centralises the parsing and default logic, replacing ad-hoc split_once('/') calls scattered across the tool modules.

A page parameter was added to both tools so that long comment threads can be walked incrementally. When a specific number is provided, the tool fetches that page of conversation comments (10 per page) and includes them in the response alongside a comments_count total. The page size is intentionally bounded to keep responses within LLM context limits.

The underlying jp_github crate gained a list_comments() method on IssuesHandler, backed by a new IssueCommentListBuilder and a Comment model. The Issue model also now carries a comments field (the total count) which GitHub exposes on both the list and detail endpoints.

Auth handling was also improved: github_issues, github_pulls, and github_read_file now use a new auth_optional() path that falls back to anonymous access when no token is configured. Read-only operations against public repos no longer require a token.

Finally, web_fetch now detects GitHub issue and PR URLs and returns a redirect error pointing at the correct dedicated tool, rather than silently returning near-empty HTML (GitHub renders comments client-side).

JeanMertz added 5 commits May 16, 2026 23:57
The `github_issues` and `github_pulls` tools were previously hardcoded
to the project's own GitHub repository and returned no comments. This
commit addresses both limitations.

Both tools now accept a `repository` parameter in `owner/repo` form,
defaulting to the project's own repo when omitted. A `parse_repo()`
helper centralises the parsing and default logic, replacing ad-hoc
`split_once('/')` calls scattered across the tool modules.

A `page` parameter was added to both tools so that long comment threads
can be walked incrementally. When a specific `number` is provided, the
tool fetches that page of conversation comments (10 per page) and
includes them in the response alongside a `comments_count` total. The
page size is intentionally bounded to keep responses within LLM context
limits.

The underlying `jp_github` crate gained a `list_comments()` method on
`IssuesHandler`, backed by a new `IssueCommentListBuilder` and a
`Comment` model. The `Issue` model also now carries a `comments` field
(the total count) which GitHub exposes on both the list and detail
endpoints.

Auth handling was also improved: `github_issues`, `github_pulls`, and
`github_read_file` now use a new `auth_optional()` path that falls back
to anonymous access when no token is configured. Read-only operations
against public repos no longer require a token.

Finally, `web_fetch` now detects GitHub issue and PR URLs and returns a
redirect error pointing at the correct dedicated tool, rather than
silently returning near-empty HTML (GitHub renders comments
client-side).

Signed-off-by: Jean Mertz <git@jeanmertz.com>
…t fetching

Signed-off-by: Jean Mertz <git@jeanmertz.com>
…t fetching

Signed-off-by: Jean Mertz <git@jeanmertz.com>
…t fetching

Signed-off-by: Jean Mertz <git@jeanmertz.com>
…t fetching

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 6a4c45c into main May 18, 2026
14 checks passed
@JeanMertz JeanMertz deleted the prr220 branch May 18, 2026 08:10
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.

1 participant