test(agent-runner): smoke the designer/design-reviewer MCP wiring #66
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!66
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test/design-mcp-smoke"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes the last AC bullet on #56 ("Smoke") at the unit level: the
regression class that surfaced on #62 was
penpot_mcp: trueagentsrunning with no
penpotentry inmcpServers— the agent correctlyaborted ("no
mcp__penpot__*namespace"), but nothing in CI caughtthe wiring gap.
allowedTools+mcpServersassembly out of the SDKquery()call site intobuildMcpSetup, a pure helper inagent-runner.ts.agent-runner.test.ts:mcp__penpot__*penpot_mcp: true+ secrets →penpotserver registered ANDmcp__penpot__*allowed (lockstep — catches the #62 regression)penpot_mcp: true+ no secrets → skips both (agent abortscleanly instead of pretending to have Penpot)
dropping
Agent/Bash/ etc.)Complements:
scripts/smoke-creds.sh— already probes the Penpot MCP binary +Python import at the container layer (landed in #64).
src/webhook-routing.test.ts— coversarea:design → designeranddesigner → design-reviewerat the routing layer.With this change, every layer of the designer pipeline — routing,
container plumbing, SDK wiring — has a regression-catching test.
Test plan
just qapasses locally (239 tests, fmt + lint clean)(label toggle → designer dispatch → handoff comment → review
comment) still works end-to-end. The unit tests don't replace
that smoke, they catch the regression class earlier.
Review: APPROVED ✅
CI green (
success, run #1577, 2m42s). All acceptance criteria from #56 §Tests (unit layer) met.What this PR does well
Core bug fix is correct. The #62 regression was a condition mismatch:
allowedTools:...(usePenpotMcp ? ["mcp__penpot__*"] : [])— gated onusePenpotMcpalonemcpServers:...(usePenpotMcp && penpotMcpEnv ? {...} : {})— gated on bothSo if
penpotMcpEnvwas null,mcp__penpot__*entered the allowlist but no server was registered.buildMcpSetupeliminates the mismatch by using a singleusePenpot = penpotEnabled && penpotEnv !== nullfor both paths. The lockstep test directly pins this.Extraction is clean.
buildMcpSetupis genuinely pure — all module-level state (usePenpotMcp,penpotMcpEnv,forgejoMcpCommand,forgejoHostUrl) is passed in explicitly, so the tests exercise the real logic without any mocking. The five tests cover: non-penpot, penpot+secrets, penpot+no-secrets, forgejo server config, and stable base tool set.mcpSetupis computed once beforerunOnce— correct; config doesn't change between session-resume retries.One nit (non-blocking)
src/agent-runner.test.ts, thepenpotEnvfixture (around line 556):These are the pre-v0.4.0 env vars (cookie + Authelia basic-auth). Since v0.4.0
main.tsbuilds the env from a single~/.config/claude-hooks/penpot-tokenand passes it asPENPOT_ACCESS_TOKEN. The test logic is correct — it only assertsenv: penpotEnvis forwarded verbatim, so the keys don't affect test correctness — but the stale key names could mislead a future reader about what the production env looks like.Suggested: replace the fixture with
{ PENPOT_ACCESS_TOKEN: "tok-test-abc" }in a follow-up. Not worth a re-push here.AC coverage
area:design→designer;designer-authored PRs →design-reviewerwebhook-routing.test.ts)penpot_mcp: trueproduces server + allowlist in lockstepThe end-to-end smoke is explicitly deferred and called out in the test plan — that's an honest scope boundary, not a missing criterion.