Skip to content

fix(mcp): repo-less agents keep PAT read path in multi-installation mode#40

Merged
chaodu-agent merged 1 commit into
mainfrom
fix/multi-repoless-pat-fallback
Jul 21, 2026
Merged

fix(mcp): repo-less agents keep PAT read path in multi-installation mode#40
chaodu-agent merged 1 commit into
mainfrom
fix/multi-repoless-pat-fallback

Conversation

@chaodu-agent

Copy link
Copy Markdown
Contributor

Summary

Unblocks deploying [[mcp.github_apps]] alongside legacy unrestricted read agents (b2-style). Previously multi mode required every agent to have a repos allowlist, so enabling multi-installation routing would have broken repo-less read agents whose tools (search_code, …) are inherently repo-less.

Behavior

  • Repo-less agent in multi mode → legacy pooled-PAT read path: no fan-out, normal PAT session pinning, repo-less tools keep working.
  • Repo-scoped agents → multi-installation routing, unchanged.
  • Writes for repo-less agents: rejected at startup validation (write tool on allowlist + enable_writes) AND denied 403 at the proxy as defense-in-depth — writes never run on pooled PATs.

Tested

clippy -D warnings clean; cargo test 99 passed / 0 failed. New: test_multi_repoless_agent_keeps_pat_read_path (single upstream request, PAT credential, PAT pin), test_multi_repoless_agent_writes_denied_even_when_enabled (403 with repository-scoped message, upstream untouched, no audit record). Config validation matrix updated.

Review Contract

Scope: multi-mode agent-envelope handling only. Acceptance: legacy single-app/PAT/Phase-1 behavior unchanged; repo-scoped multi routing unchanged; no write path over pooled PATs.

…on mode

Multi-installation mode previously required every [[mcp.agents]] entry to
have a non-empty repos allowlist, which broke legacy unrestricted read
agents (e.g. a search-capable read-only agent) the moment [[mcp.github_apps]]
was configured.

- Repo-less agents now skip fan-out and routing entirely: they keep the
  legacy pooled-PAT read path (initialize pins a PAT session as before)
- Writes remain impossible for them: startup validation rejects a
  repo-less agent allowlisting a write-classified tool when writes are
  enabled, and the proxy denies write calls from repo-less agents in
  multi mode as defense-in-depth (writes never run on pooled PATs)

Verified: clippy -D warnings clean, 99 passed / 0 failed (2 new tests:
PAT read path preserved without fan-out; write denied with 403 even when
enable_writes is on)
@chaodu-agent
chaodu-agent merged commit c5b8d7d into main Jul 21, 2026
1 check passed
@chaodu-agent
chaodu-agent deleted the fix/multi-repoless-pat-fallback branch July 21, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant