Repository navigation
Closed
Description
Context
Answering "what is running and what is the review state of each PR" currently takes list_tasks → list_pull_requests → get_pull_request per item, with correlation by hand. list_pull_requests (packages/api/mcp/pullRequestInventory.ts) is PR-centric and scans GitHub; list_tasks (packages/api/mcp/tools.ts) is task-centric and never calls GitHub. Neither gives the joined view.
Requirements
- New read-only tool
get_work_overview(scoperead), arguments:repository(optional; omit = every repository in the grant, same resolution aslist_tasks),state:active(default) |recent|all—recent= terminal within the window,sinceMinutes(default 1440, max 10080) applies torecent/all,limit(default 20, max 50),offset,includeChecks(default true) — include check rollup and review decision.
- Output:
{ items: [{ task: <compact task summary as list_tasks returns>, pullRequest: null | { number, url, state, draft, head, reviewDecision, checks: { state }, mergeable: 'CLEAN'|..., latestReview: { score, reviewedHead, matchesCurrentHead } | null, ultrafixActive } }], nextOffset, githubLookups: { requested, completed, truncated } }. - Task selection reuses the same query and visibility rules as
list_tasks(other users' private goal tasks excluded). Refactor thelist_tasksquery into a shared function so the two tools cannot drift. - PR enrichment uses one GraphQL request per repository, aliasing each PR number (
pr_42: pullRequest(number: 42) { ... }), bounded to 25 PRs per repository and 5 repositories per call (githubLookups.truncatedwhen exceeded). A repository that answers 403/404 is skipped for enrichment (items keeppullRequest.enrichment: 'unavailable') — the task list is still returned. - Merge state from
notification_pull_request_statewins over GitHub'sclosed(same rule asmarkMergedPullRequests). latestReviewuses the newest ProPR AI review comment (<!-- propr:ai-review ... -->) fetched in the same GraphQL query (comments(last: 10)), parsed with the existing review parser used byget_pull_request_discussion: score, reviewed head, and whether it matches the current head. Comment prose is never returned.- Deterministic ordering: active tasks by
updated_at desc, recent by completion time desc.
Implementation Specification
- New
packages/api/mcp/taskListing.tsexportingqueryTaskSummaries(db, { repositories, state, principalUserId, offset, limit, since? })— moved out of thelist_taskstool body, andlist_tasksswitched to call it (no behaviour change). - New
packages/api/mcp/toolsWorkOverview.tswithaddWorkOverviewTools(tools, deps, listScope)registeringget_work_overview, plusenrichPullRequests(principal, repository, numbers). - Register in
createToolCatalog(tools.ts). - Tests
packages/api/test/mcpWorkOverview.test.tswith a GraphQL fake asserting a single call per repository.
Acceptance Criteria
- With two running tasks on PRs AI Fix for Issue #40: Feat: Monitor PR comments for follow-up tasks #42 and #7 in two repos, one call returns both items with
reviewDecision,checks.stateandlatestReview.score, issuing exactly one GraphQL request per repository. - A task without a PR returns
pullRequest: null. - A forbidden repository is skipped (not an error) and a merged-in-ProPR PR shows
state: 'merged'. -
list_tasksoutput is byte-for-byte unchanged by the refactor (existingmcpGoalTaskDepth.test.tspasses). -
state: 'recent', sinceMinutes: 60excludes tasks finished earlier.
Created by ProPR AI Planner
Activity
propr-dev commentedon Sep 28, 2026
Suggested Implementation:
Implementation Approach
The overview is task-first: tasks come from ProPR's database (cheap, authoritative for what ProPR is doing), and only the PRs referenced by the returned page are enriched from GitHub. A PR-first approach (start from
list_pull_requestsand attach tasks) was rejected because it scans all open PRs of every repository, most of which are unrelated to running work, and pays GitHub quota for them.Batching with GraphQL aliases makes the enrichment cost
O(repositories)requests instead ofO(PRs), and the explicit caps (25 PRs × 5 repositories) keep a single call bounded. We extract thelist_tasksquery intotaskListing.tsso both tools share one visibility predicate — duplicating it would risk leaking private goal tasks through the new tool.File:
packages/api/mcp/taskListing.ts(new file)Why this file: Single task-listing query used by
list_tasksandget_work_overview.In
tools.ts, replace the body oflist_taskswith:and pass
listScopeintoaddWorkOverviewTools.File:
packages/api/mcp/toolsWorkOverview.ts(new file)Why this file: Hosts the new joined view and its GitHub batching, keeping
tools.tsfrom growing further.File:
packages/api/test/mcpWorkOverview.test.ts(new file)Why this file: Verifies the join, the bounded single-request-per-repository behaviour, and graceful degradation.
propr-dev commentedon Sep 29, 2026
🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-5.6-sol2598/gpt-5.6-sol-mcp-add-get_work_overview-20260929-1602-r1y2593-epic-mcp-observability-cf6issue-2598-20260929-1602-gpt-5.6-sol-r1y🔍 Track Task Execution
fix(ai): Resolve issue #2598 - MCP: add get_work_overview — running o…
fix(ai): Resolve issue #2598 - MCP: add get_work_overview — running o…