feat(robomp): added repo-scoped issue search to issue triage flow

- Added `search_issues` support to the GitHub backend and client, including `state_reason` and `is_pull_request` in issue summaries.
- Added the `gh_search_issues` host tool with repo-prefixed query handling, non-empty/restricted `repo:` validation, default and bounded `limit` values, and inbound issue filtering.
- Added proxy integration for issue search with a new `/gh/v1/search_issues` endpoint and matching proxy-client method/response parsing.
- Updated triage prompts to perform pre-`classify_issue` duplicate and already-fixed checks via search, and added tests for search query formatting, validation, and state-aware match rendering.
This commit is contained in:
can1357
2026-07-15 00:30:15 +02:00
parent 539c132094
commit 3e6ae36c7c
12 changed files with 257 additions and 19 deletions
+27
View File
@@ -251,6 +251,29 @@ def round_trip_app(proxy_settings: Settings):
}
],
)
if path == "/search/issues" and req.method == "GET":
assert req.url.params["q"].startswith("repo:octo/widget ")
return httpx.Response(
200,
json={
"total_count": 1,
"items": [
{
"number": 9,
"title": "fixed it",
"state": "closed",
"state_reason": "completed",
"user": {"login": "bob"},
"labels": [{"name": "bug"}],
"comments": 2,
"updated_at": "2026-02-01T00:00:00Z",
"created_at": "2026-01-15T00:00:00Z",
"html_url": "https://example/9",
"pull_request": {"url": "https://example/pull/9"},
}
],
},
)
if path == "/repos/octo/widget/issues/1/comments" and req.method == "GET":
return httpx.Response(
200,
@@ -365,6 +388,10 @@ async def test_round_trip_all_endpoints(round_trip_app) -> None:
issues = await client.list_issues("octo/widget")
assert len(issues) == 1 and isinstance(issues[0], IssueSummary)
found = await client.search_issues("octo/widget", "colon selector is:pr")
assert len(found) == 1 and isinstance(found[0], IssueSummary)
assert found[0].is_pull_request and found[0].state_reason == "completed"
comments = await client.list_comments("octo/widget", 1)
assert len(comments) == 1 and isinstance(comments[0], CommentInfo)