feat(mcp): add octobroker_commit_status_set broker-owned tool#52
Merged
Conversation
The upstream GitHub MCP server exposes no commit-status mutation (only
the read-only get_status), so review agents cannot publish a verdict as
a status check. Add a second octobroker-owned local tool that creates a
commit status via POST /repos/{owner}/{repo}/statuses/{sha} through the
scoped GitHub App credential.
- Introduce a LOCAL_TOOLS registry; generalize the write gate, local
dispatch, tools/list injection, and x-mcp-tools filtering to cover
every broker-owned tool (each still requires its own explicit
allowlist entry)
- Strict argument validation: owner/repo/sha become URL path segments
(charset + full 40/64-hex SHA enforced), state enum, non-empty
context, description <= 140 chars, http(s) target_url
- Fail closed: only HTTP 201 with an echoed state counts as success
- Same repository policy, write gate, in-flight cap, and fail-closed
audit as upstream write tools; Phase 1 / writes-disabled agents are
denied before credential resolution
- Requires 'Commit statuses: write' on the GitHub App (README updated)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Review agents need to publish a PR-review verdict as a commit status check (e.g.
context: "OpenAB PR Review",state: failure), but the upstream GitHub MCP server offers no commit-status mutation at all — only the read-onlyget_status. This surfaced in live operation: a review bot correctly refused to fabricate an endpoint and reported the capability gap.This PR adds a second octobroker-owned local tool,
octobroker_commit_status_set, following theoctobroker_review_minimize_commentpattern from #45 (issue #44).Changes
LOCAL_TOOLSregistry — the early write gate, local dispatch,tools/listinjection, andx-mcp-toolsupstream filtering are generalized over all broker-owned tools. Each tool still requires its own explicit per-agent allowlist entry to be advertised or callable.handle_commit_status_set— executesPOST /repos/{owner}/{repo}/statuses/{sha}locally through the scoped GitHub App credential. Never forwarded upstream.owner/repo/shabecome URL path segments: charset-checked and full 40/64-hex SHA enforced, so arguments cannot escape the policy-checked repository path.statemust be one oferror|failure|pending|success;contextnon-empty;description≤ 140 chars;target_urlmust be http(s).statecounts as success; anything else returns a tool error. Phase 1 (no-agent) mode and writes-disabled agents are denied before credential resolution.Commit statuses: writerow in the App permission table.Tests
8 new/updated tests; full suite 132 passed, 0 failed, clippy clean:
/repos/{owner}/{repo}/statuses/{sha}path and payload (mock REST server)javascript:target_url, >140-char description) rejected before any network calltools/listinjection requires each local tool's own allowlist entry;x-mcp-toolsfilter strips all local toolsApp permission
Requires Commit statuses: write on the GitHub App installation(s) — grant + per-installation approval needed before agents can use it.