FM-6 — rip dualMount + forgejoMcpCommand + FORGEJO_TOOLS_ALLOWLIST + FORGEJO_MCP_TOOLS #811

Closed
opened 2026-05-03 20:08:59 +00:00 by claude-desktop · 0 comments
Collaborator

As an operator, I want every legacy forgejo-mcp plumbing artefact removed from the codebase (the dualMount flag, the forgejoMcpCommand config, the FORGEJO_TOOLS_ALLOWLIST constant, the FORGEJO_MCP_TOOLS env wiring, the forgejo entry in the MCP servers map), so that the codebase has one MCP namespace, one mount path, and zero dead branches that mask future bugs the way the silent-spawn-fail did since 2026-05-01.

Context

After FM-3 (#687) deleted the binary but left the dual-mount plumbing in place, dualMount=true defaulted into a state that tried to spawn a non-existent forgejo-mcp process at every dispatch. The silent fail meant agents had no MCP at all for two days before anyone noticed (operator only spotted it from agent log saying "Forge MCP is broken at the harness gate"). The broader memory rule applies: no compat shims, no if (!new) fallback to old bridges. With FM-4 (allowlist sync) and FM-5 (server-side rename) landed, the legacy mount is dead code — this story removes it.

Must land after FM-4 and FM-5 have shipped and been smoke-tested. If the legacy code path is still needed as a fallback (it should not be), this story is the wrong shape and the situation regresses to dual-system maintenance.

Acceptance criteria

default-mcp-registry.ts (apps/server/src/infrastructure/agents/)

  • DefaultMcpRegistryOptions.dualMount field removed from interface + jsdoc.
  • dualMount default in constructor (opts.dualMount ?? true) removed.
  • dualMount plumbing in reconfigure() removed.
  • if (legacyForgejoMounted) branch in serversFor() removed (no more push of forgejo server spec).
  • if (legacyForgejoMounted) branch in allowedTools() removed (no more push of mcp__forgejo__* entries).
  • DefaultMcpRegistryOptions.forgejoMcpCommand field removed.

agent-runner.ts + dispatch sites

  • forgejoMcpCommand module-level variable removed (apps/server/src/domain/agent/agent-runner.ts:80).
  • setMcpConfig() first parameter (now defunct) removed; signature becomes setMcpConfig(forgejoUrl: string, forgeCommand?: string).
  • All call sites updated: architect.ts, architect-agent-dispatch.ts, mcp-config.ts, main.ts (anywhere that reads/writes the command).

mcp-config.ts (apps/server/src/domain/agent/)

  • FORGEJO_TOOLS_ALLOWLIST constant removed (lines 42-69).
  • forgejoToolEntries block in buildMcpSetup() removed (line 172).
  • FORGEJO_MCP_TOOLS env injection in mcp-server map removed (line 148).
  • forgejo key in mcpServers map removed — only forge (and conditional penpot) remain.
  • McpSetupInput.forgejoMcpCommand field removed.

default-mcp-registry.ts env wiring

  • FORGEJO_MCP_TOOLS env entry in legacy mount block removed (line 139, after the legacy mount itself is gone this is moot but verify).

Dockerfile + container image

  • No remaining references to forgejo-mcp build steps, patches/, or version pin comments.
  • If any operator-doc files (e.g. docs/credentials.md, docs/forge-mcp.md) describe the legacy binary as still mounted, update.

Tests

  • default-mcp-registry.test.ts no longer references dualMount and no longer asserts legacy mcp__forgejo__* tool names appear in allowedTools().
  • mcp-config.test.ts updated; tests covering forgejoToolEntries removed.
  • Wider audit: git grep -nE "dualMount|forgejoMcpCommand|FORGEJO_TOOLS_ALLOWLIST|FORGEJO_MCP_TOOLS|mcp__forgejo__" apps/ packages/ returns zero hits outside MEMORY.md, specs/, or docs/forge-mcp.md (acceptable historical doc).

Smoke

  • just qa clean.
  • Dispatch a real ticket end-to-end. Task transcript shows only mcp__forge__* invocations, no curl-fallback warnings.
  • docker exec <container> env | grep FORGEJO_MCP returns nothing.

Out of scope

  • Removing $FORGEJO_ACCESS_TOKEN env injection in container-reconcile.ts:398 — still needed for git push / git fetch from inside the container.
  • Touching the architect host-mode dispatch surface beyond what FM-5 already migrated.
  • Multi-forge expansion. The mount is single-server; FM-2's forge-mcp already handles all three forge types via FORGE_TYPE.

References

  • Spec: specs/forge-mcp-cutover-followup.md §Pass 3.
  • Memory rule "no compat shims": ~/.claude/projects/.../memory/feedback_no_compat_bridge.md.
  • Original FM-3 PR: #687.
  • Depends on: FM-4 + FM-5 (both must land + smoke-pass first).
As an operator, I want every legacy `forgejo-mcp` plumbing artefact removed from the codebase (the `dualMount` flag, the `forgejoMcpCommand` config, the `FORGEJO_TOOLS_ALLOWLIST` constant, the `FORGEJO_MCP_TOOLS` env wiring, the `forgejo` entry in the MCP servers map), so that the codebase has one MCP namespace, one mount path, and zero dead branches that mask future bugs the way the silent-spawn-fail did since 2026-05-01. ## Context After FM-3 (#687) deleted the binary but left the dual-mount plumbing in place, `dualMount=true` defaulted into a state that tried to spawn a non-existent `forgejo-mcp` process at every dispatch. The silent fail meant agents had **no MCP at all** for two days before anyone noticed (operator only spotted it from agent log saying "Forge MCP is broken at the harness gate"). The broader memory rule applies: **no compat shims, no `if (!new) fallback to old` bridges**. With FM-4 (allowlist sync) and FM-5 (server-side rename) landed, the legacy mount is dead code — this story removes it. Must land **after** FM-4 and FM-5 have shipped and been smoke-tested. If the legacy code path is still needed as a fallback (it should not be), this story is the wrong shape and the situation regresses to dual-system maintenance. ## Acceptance criteria ### `default-mcp-registry.ts` (`apps/server/src/infrastructure/agents/`) - [ ] `DefaultMcpRegistryOptions.dualMount` field removed from interface + jsdoc. - [ ] `dualMount` default in constructor (`opts.dualMount ?? true`) removed. - [ ] `dualMount` plumbing in `reconfigure()` removed. - [ ] `if (legacyForgejoMounted)` branch in `serversFor()` removed (no more push of `forgejo` server spec). - [ ] `if (legacyForgejoMounted)` branch in `allowedTools()` removed (no more push of `mcp__forgejo__*` entries). - [ ] `DefaultMcpRegistryOptions.forgejoMcpCommand` field removed. ### `agent-runner.ts` + dispatch sites - [ ] `forgejoMcpCommand` module-level variable removed (`apps/server/src/domain/agent/agent-runner.ts:80`). - [ ] `setMcpConfig()` first parameter (now defunct) removed; signature becomes `setMcpConfig(forgejoUrl: string, forgeCommand?: string)`. - [ ] All call sites updated: `architect.ts`, `architect-agent-dispatch.ts`, `mcp-config.ts`, `main.ts` (anywhere that reads/writes the command). ### `mcp-config.ts` (`apps/server/src/domain/agent/`) - [ ] `FORGEJO_TOOLS_ALLOWLIST` constant removed (lines 42-69). - [ ] `forgejoToolEntries` block in `buildMcpSetup()` removed (line 172). - [ ] `FORGEJO_MCP_TOOLS` env injection in mcp-server map removed (line 148). - [ ] `forgejo` key in `mcpServers` map removed — only `forge` (and conditional `penpot`) remain. - [ ] `McpSetupInput.forgejoMcpCommand` field removed. ### `default-mcp-registry.ts` env wiring - [ ] `FORGEJO_MCP_TOOLS` env entry in legacy mount block removed (line 139, after the legacy mount itself is gone this is moot but verify). ### Dockerfile + container image - [ ] No remaining references to `forgejo-mcp` build steps, `patches/`, or version pin comments. - [ ] If any operator-doc files (e.g. `docs/credentials.md`, `docs/forge-mcp.md`) describe the legacy binary as still mounted, update. ### Tests - [ ] `default-mcp-registry.test.ts` no longer references `dualMount` and no longer asserts legacy `mcp__forgejo__*` tool names appear in `allowedTools()`. - [ ] `mcp-config.test.ts` updated; tests covering `forgejoToolEntries` removed. - [ ] Wider audit: `git grep -nE "dualMount|forgejoMcpCommand|FORGEJO_TOOLS_ALLOWLIST|FORGEJO_MCP_TOOLS|mcp__forgejo__" apps/ packages/` returns zero hits outside `MEMORY.md`, `specs/`, or `docs/forge-mcp.md` (acceptable historical doc). ### Smoke - [ ] `just qa` clean. - [ ] Dispatch a real ticket end-to-end. Task transcript shows only `mcp__forge__*` invocations, no curl-fallback warnings. - [ ] `docker exec <container> env | grep FORGEJO_MCP` returns nothing. ## Out of scope - Removing `$FORGEJO_ACCESS_TOKEN` env injection in `container-reconcile.ts:398` — still needed for `git push` / `git fetch` from inside the container. - Touching the architect host-mode dispatch surface beyond what FM-5 already migrated. - Multi-forge expansion. The mount is single-server; FM-2's `forge-mcp` already handles all three forge types via `FORGE_TYPE`. ## References - Spec: `specs/forge-mcp-cutover-followup.md` §Pass 3. - Memory rule "no compat shims": `~/.claude/projects/.../memory/feedback_no_compat_bridge.md`. - Original FM-3 PR: #687. - Depends on: **FM-4** + **FM-5** (both must land + smoke-pass first).
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#811
No description provided.