Repository navigation
feat(maintenance): release or resume held follow-ups from Settings and MCP - #3427
Conversation
…d MCP A follow-up handoff held for an operator blocks every later command on its pull request, and until now the only ways to settle one were the admin REST routes and a CLI release that the installed CLI did not have. integry/propr #3423 sat behind such a hold for a day with no visible way out. Settings → Workflow & PR Rules gains a Maintenance section (administrators with instance.manage_runtime) that lists every tracked handoff with its reason, branch, unpublished commit and next action, and offers Resume and Release. A forced release, for a worktree that still holds unpublished work, needs an explicit checkbox. Refusals show the server's reason. MCP gains list_followup_handoffs, get_followup_handoff, resume_followup_handoff and release_followup_handoff under the same permission, calling the same recovery entry points as the routes. A refusal is a failed receipt that names the reason. The retained worktree's host path stays on the REST route and CLI; chat results are redacted anyway. Docs: capability matrix row, MCP guide paragraph, operator workflow row, and the four operator surfaces in the maintenance guide. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds useful UI and MCP access to existing handoff recovery operations. It needs a localized authorization fix before merge: the new MCP list exposes handoffs outside the client’s repository grant. ✅ Shared recovery semantics — Resume re-arms the handoff, runs keyed recovery, and then inspects its status using the existing recovery entry points. ✅ Explicit forced release — The UI defaults to ordinary release and requires a checkbox before sending ✅ Host-path omission — MCP payloads expose This review used static analysis of the supplied code; no commands or tests were run. The authoritative checks show no failures and four pending checks. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Filter handoffs by repository authorization
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Offer cancellation authorization in SettingsThe UI’s Resume button always omits ScoreThe implementation largely follows the intended workflow, but the repository-information disclosure requires correction. The focused tests cover several important paths; current checks have no reported failures, with four still pending. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/ultrafix |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ Applied the requested follow-up changes in commit 4770943
Summary of ChangesI fixed F1: The fix (
Sibling tools: Regression (
Verification
Problems I found but did not fix (outside F1)
This change has nothing visible in the UI, so there are no previews. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ffs in repositories the connected client is allowed to read. The new test passes, and it fails when the filter is taken out. One catch: CI does not run this test file at all (details below). I fixed F1: `list_followup_handoffs` now only returns handoffs in repositories the connected client is allowed to read. The new test passes, and it fails when the filter is taken out. One catch: CI does not run this test file at all (details below). **The fix (`packages/api/mcp/toolsMaintenance.ts`)** - After loading all handoffs, the list handler runs each record's repository through the same check the shared executor uses for read tools: the repository must be in the client's grant, configured on the instance, and readable on GitHub right now. - A refusal (403) hides that record. Any other error is still raised, so a policy failure can't quietly empty the list. - Each repository is checked once per call, however many handoffs it has. - The tool description now says the list covers only repositories the client may access. **Sibling tools:** `get_followup_handoff`, `release_followup_handoff` and `resume_followup_handoff` all require a `repository` argument, so the shared executor checks access before they run. The release and resume tools also require GitHub write access. No other new maintenance tool returns handoff data without a repository check. **Regression (`packages/api/test/mcpMaintenance.test.ts`)** - The new test uses an administrator client with a narrow grant and handoffs in four repositories: - one fully authorized, with two pull requests. - one outside the grant. - one granted, but GitHub now denies access. - one granted, but not configured on the instance. - It asserts that only the two authorized handoffs come back, and that no name or branch from the other three appears anywhere in the result. - It also asserts that GitHub is called only for granted, configured repositories, once each. - To support this, the test's mock list of configured repositories now includes the extra repositories; the existing test is unaffected. **Verification** - The maintenance tests (2), `mcpToolInputBudget`, `mcpDocs`, `mcpObservableSurface` and `mcpOperatorSurface` all pass: 18 of 18. - With the filter removed, the new test fails. - ESLint with `--max-warnings 0` is clean, and the API typecheck shows no errors in the changed files. **Problems I found but did not fix (outside F1)** - **CI never runs `mcpMaintenance.test.ts`.** It isn't listed in `test:mcp` or any other script, so the new regression and the PR's original maintenance test only protect anything once the file is added there. - **The file hangs on its own.** Run alone, the tests pass but the process never exits until the runner's timeout cancels it. The file as it was before my change does the same. Adding `--test-force-exit` (which the command above used) avoids it; the cause is probably a handle left open by the test setup. - **Four type errors in the existing test body.** When the file is typechecked, it reports four errors in the original test, at lines 97, 98, 140 and 144: two principal objects whose `permissions` type is too loose, and two `calls.at(-1)` lookups typed as `never`. My additions add none. This change has nothing visible in the UI, so there are no previews. PR: #3427 Comment by: @integry (ID: 6736432714) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationMerge-ready within the reviewed scope. The PR adds focused UI and MCP maintenance surfaces while reusing the existing recovery operations. ✅ Repository access filtering — MCP listing checks each repository against current policy and excludes denied repositories before returning records. ✅ Explicit force control — The UI defaults to ordinary release and requires a checkbox before sending ✅ Recovery sequencing — MCP resume re-arms the handoff, runs keyed recovery, and then inspects its resulting state. This assessment is based on static review of the supplied diff and context. No commands were run; no current-head check runs were reported. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Clarify cancelled-work recovery in UI
S3: 🟢 Show incomplete recovery outcomesThe UI resume message includes published, settled, and awaiting-operator counts but omits errors, failed-closed outcomes, and skipped recovery. Consider displaying those counters when nonzero so operators can distinguish successful settlement from an incomplete recovery pass. The refreshed handoff list already provides continued visibility, so this is a diagnostic improvement. ScoreThe implementation follows the intended scope, preserves backend refusal handling, and includes targeted permission and operation tests. Static review found no merge blockers; current-head automated verification remains unreported. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
Why
A follow-up handoff held for an operator blocks every later
/fix,/reviewor follow-up on its pull request. Until now the only ways to see or settle one were the admin REST routes (/api/admin/followup-handoffs) and thepropr handoffsCLI group, which the installed CLI on this host predates. #3423 sat behind a fork-publication hold for a day; every command on it waited aspredecessor_awaiting_operatorand nothing in the UI or MCP said so.What
Settings → Workflow & PR Rules → Maintenance (
propr-ui/src/pages/SettingsPage/MaintenanceSection.tsx). Visible only to administrators withinstance.manage_runtime, like the routes. Lists every tracked handoff with status, phase, the reason it is held (in plain words for the known reasons), branch, unpublished commit, next action, task id and retained worktree path, linked to the pull request. Resume re-arms a hold and runs its keyed recovery pass; Release frees the branch. A forced release, for a worktree that still holds unpublished work, needs an explicit checkbox and the button then reads Release anyway. A refusal shows the server's reason. Client inpropr-ui/src/api/followupHandoffsApi.ts.MCP (
packages/api/mcp/toolsMaintenance.ts):list_followup_handoffs,get_followup_handoff,resume_followup_handoff(optionalauthorizeCancelled) andrelease_followup_handoff(optionalforce).managescope plusinstance.manage_runtime, calling the same recovery entry points the routes use (ToolDeps.followupHandoffslets tests inject them). A refusal is a failed operation receipt whose error names the recovery module's reason (HANDOFF_NOT_RELEASED,HANDOFF_NOT_RESUMED,NOT_FOUND). The retained worktree's host path is left out of MCP results (they are redacted anyway) and reported asretainedWorktree: true.Docs: capability matrix row, a paragraph in the MCP guide, an operator workflow row, and the four operator surfaces (Settings, MCP, CLI, API) in the maintenance guide's "Stuck follow-ups settle themselves" section.
The section lives under Workflow & PR Rules rather than as a new rail category: the rail renders every category for every user, so a Maintenance category would show empty for non-administrators until the rail learns to hide categories without visible sections.
Tests
packages/api/test/mcpMaintenance.test.ts: permission gating before any recovery call, list/get payloads without host paths, plain release refused with the reason, forced release, not-found, resume order (resume, keyed recovery, inspect), cancellation authorization refusal.propr-ui/src/pages/SettingsPage/MaintenanceSection.test.tsx: hidden for members and for admins without the runtime permission, listing, empty state, release refusal surfaced, forced release behind the checkbox, resume summary.demoViewer.test.tsxmock extended with the new section factory).mcpObservableSurface,mcpOperatorSurface,mcpDocs,mcpToolInputBudget,mcpAccessLogDispatch,followupHandoffRoutespass.mcpRequestBounds.test.tsfails identically without this change on this checkout (schema validation runs before the element budget with the installed MCP SDK); not related.🤖 Generated with Claude Code