feat(mcp): approval-queue control tools — list + decide pending agent actions (#784) - #934
Conversation
… actions (JSONbored#784) Phase 3's MCP control surface could already read automation state (gittensory_get_automation_state) and stage an action (gittensory_propose_action), but could not surface or decide the approval queue it proposes into — that was only reachable via the CLI `maintain` commands and the HTTP routes. This closes the MCP parity gap with two tools: - gittensory_list_pending_actions {owner, repo, status?} — surface the queue (default status=pending) with each action's id/class/PR/status/level/reason. - gittensory_decide_pending_action {owner, repo, id, decision} — accept (execute via the live executor gates) or reject a staged action. Both wrap already-tested primitives (listPendingAgentActions, decidePendingAgentAction), are maintainer-manage scoped (the full queue with reasons is more sensitive than the bare count), and decide is repo-scoped + idempotent — mirroring the HTTP decision route so a guessed id from another repo's queue cannot be decided. Tests (mcp-automation-state.test.ts): list (default + status filter + empty), decide reject (+ idempotent already_decided), decide accept honoring dry-run, repo-scoped not_found, and the maintainer-access gate on both tools. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔍 Maintainer reviewReviewed 2 file(s) — ✅ all CI green. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · No blocking issues spotted. |
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #934 +/- ##
=======================================
Coverage 96.61% 96.61%
=======================================
Files 110 110
Lines 14928 14954 +26
Branches 5399 5404 +5
=======================================
+ Hits 14422 14448 +26
Misses 104 104
Partials 402 402 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Part of #784 (Phase 3 — agent automation control surface). First of two focused PRs; the audit feed follows separately.
Why
Phase 3's MCP control surface could already read automation state (
gittensory_get_automation_state) and stage an action (gittensory_propose_action) — but it could not surface or decide the approval queue it proposes into. That was only reachable through the CLImaintaincommands and the HTTP routes, leaving an MCP-only client (or autonomous agent) unable to complete the loop it can already start.What this adds
Two tools wrapping already-tested primitives (
listPendingAgentActions,decidePendingAgentAction):gittensory_list_pending_actions{owner, repo, status?}— surface the approval queue (defaultstatus=pending), each entry with id / actionClass / pullNumber / status / autonomyLevel / reason / decidedBy / decidedAt / createdAt.gittensory_decide_pending_action{owner, repo, id, decision}—accept(run through the live executor gates) orreject(cancel) a staged action.Safety / parity with existing surfaces
requireRepoManageAccess) — the full queue with reasons is more sensitive than the bare countget_automation_stateexposes.decideis repo-scoped (a guessed id from another repo's queue →not_found, untouched) and idempotent (a second decision →already_decided), mirroring the HTTP decision route exactly.accepthonors current mode (dry-run / pause / autonomy) via the existing executor — no new execution path.Tests
test/unit/mcp-automation-state.test.ts: list (default, status filter, empty), decide reject + idempotency, decide accept honoring dry-run, repo-scopednot_found, and the maintainer-access gate on both tools. Fullnpm run test:coveragegreen (branches 97.01%); new lines fully covered.🤖 Generated with Claude Code