Repository navigation
feat: add read-only Zapier MCP setup for Codex (QUA-2406) - #225
Conversation
QualityMax ReviewVerdict: COMMENT · Confidence: model judgment; findings have not been reproduced Re-review: Open the QualityMax check and select Re-review after it completes. Files eligible: 19 · Files reviewed: 19 · Files with findings: 2 · Findings: 4 · Inline cards: 0 Priority findings
Review gates
Important files
Advisory MODEL-ONLY candidates (4)These model judgments do not block this PR and are not posted inline. Check reachable callers and existing protections, and reproduce a concrete failure before treating a candidate as a defect. A second model's confirmation or a model-reviewed patch does not reproduce a failure.
Change diagram — Flowgraph TD
A[WriteMCPConfig] --> B[CodexConfigPath]
B --> C{CODEX_HOME set?}
C -- Yes --> D[Use CODEX_HOME]
C -- No --> E[Use UserHomeDir]
D --> F[updateCodexConfig]
E --> F
F --> G[tryCodexConfigLock]
G --> H[upsertCodexMCPEntry]
H --> I[Write Config]
Review lifecycleUse the inline cards to inspect evidence and suggested remediation. Re-run the QualityMax review after pushing a fix; unchanged cards are identified by their stable finding marker. Dismiss with a reason through the existing QualityMax/GitHub review feedback flow. 0 prior card(s) are stale/resolved on this head. Proof legend: GROUNDED deterministic scanner evidence · MODEL-ONLY advisory model judgment · MODEL-REVIEWED patch model judgment, not reproduction. QualityMax project results are available in the configured project. Receipt · commit |
QualityMax Code HealthGrade A · 100/100 · PASS — 0 finding(s) in 19 file(s). No code-health findings. Full report · Commit 5898b06 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
| Gate | Result |
|---|---|
| 🔍 AI diff review | ℹ️ 2 advisory MODEL-ONLY candidate(s) · gemini-3.1-flash-lite · completed · 17 eligible / 17 reviewed · gemini-3.1-flash-lite |
| 🔍 SAST | completed · 19 eligible / 19 reviewed · qwen3.7-plus |
| 🔍 Canonical PR review delivery | completed · 0 eligible / 0 reviewed · exact-head review #5923075959 and overview #6915167572 confirmed |
| 🔍 Repository runtime evidence | completed · 0 eligible / 0 reviewed · runtime execution passed for the assessed revision |
| 🔍 Runtime evidence policy | completed · 0 eligible / 0 reviewed · admissible runtime evidence satisfies this advisory runtime-only policy |
| 🧪 Repo Tests | ✅ 1589/1589 passed (go) |
| 🤖 AI Tests | ❌ blocked before sandbox execution (sandbox_concurrency_limit; go_test) |
Powered by QualityMax — AI-Powered Test Automation
There was a problem hiding this comment.
🟡 Changes recommended
The command timeout can still hang on inherited output pipes, and disconnecting with a fresh CODEX_HOME writes configuration that causes the next connect to fail.
2 open issues
What changed in this PR
Adds opt-in, read-only Zapier MCP setup for qmax-code’s Codex backend using native Codex OAuth and transport. Authenticated tool filtering, an agent-mediated source read, and revoked/expired-auth behavior remain pending live qualification.
Changes:
- Adds
zapier connect|status|disconnect, keyring-only OAuth setup, and structural discovery. - Uses the selected
CODEX_HOMEconsistently and serializes configuration updates while preserving unrelated settings. - Adds regression coverage, untrusted-content prompt guidance, and setup documentation.
| File | Description |
|---|---|
zapier_command.go |
Implements connection, status, and disconnect commands. |
zapier_command_test.go |
Tests command validation and selected-home disconnect behavior. |
README.md |
Links to Zapier setup documentation. |
main.go |
Routes the Zapier subcommand. |
internal/zapier/process_test.go |
Tests shutdown with inherited subprocess streams. |
internal/zapier/discovery.go |
Implements structural discovery and read-tool validation. |
internal/zapier/discovery_test.go |
Tests protocol handling, filtering, cancellation, and failures. |
internal/setup/orch.go |
Uses the selected Codex home during setup and detection. |
internal/setup/orch_test.go |
Isolates tests from inherited CODEX_HOME. |
internal/agent/zapier_config.go |
Manages the read-only Zapier entry and credential-policy checks. |
internal/agent/zapier_config_test.go |
Tests preservation, refusal cases, concurrency, and home selection. |
internal/agent/mcp_reconnect_test.go |
Clears inherited CODEX_HOME in test setup. |
internal/agent/codex_config.go |
Centralizes home selection and locked configuration updates. |
internal/agent/codex_config_test.go |
Accounts for the retained lock file. |
internal/agent/codex_config_lock_windows.go |
Adds Windows configuration locking. |
internal/agent/codex_config_lock_unix.go |
Adds Unix configuration locking. |
internal/agent/codex_agent.go |
Uses the selected home and adds external-content safeguards. |
docs/ZAPIER_MCP.md |
Documents setup, scope, disconnect limits, and qualification status. |
Review effort: Balanced
There was a problem hiding this comment.
QualityMax Review — canonical overview updated; no inline findings were created for this review.
😸 2 finding(s) auto-dismissed by the Finding Verifier
llm-path-traversalinternal/agent/codex_config.go:27 — false positive: CODEX_HOME is an environment variable controlled by the local user executing the tool, so writing to an arbitrary path on their own filesystem is not a path traversal vulnerability.llm-command-injectioninternal/zapier/discovery.go:48 — false positive: exec.CommandContext executes the binary directly without a shell, so shell metacharacters are treated as literal filename characters and cannot cause injection.
Auto-dismissals are advisory. If a dismissal looks wrong, treat the finding as blocking and request a verifier review.
There was a problem hiding this comment.
QualityMax Review — canonical overview updated; no inline findings were created for this review.
😸 2 finding(s) auto-dismissed by the Finding Verifier
llm-command-injectioninternal/zapier/discovery.go:48 — false positive: exec.CommandContext uses an argv list without invoking a shell, and all subsequent arguments are strictly hardcoded, preventing any shell injection or arbitrary command execution.llm-path-traversalinternal/agent/codex_config.go:27 — false positive: CODEX_HOME is an environment variable controlled by the local user running the tool, so overriding the config path is intended behavior, not a path traversal vulnerability.
Auto-dismissals are advisory. If a dismissal looks wrong, treat the finding as blocking and request a verifier review.
There was a problem hiding this comment.
QualityMax Review — canonical overview updated; no inline findings were created for this review.
😸 2 finding(s) auto-dismissed by the Finding Verifier
llm-path-traversalinternal/agent/codex_config.go:26 — false positive: CODEX_HOME is an environment variable controlled by the local user executing the tool, so specifying an arbitrary path does not cross a privilege boundary.llm-command-injectioninternal/zapier/discovery.go:48 — false positive: exec.CommandContext uses an argv list without invoking a shell, so it is not susceptible to shell command injection.
Auto-dismissals are advisory. If a dismissal looks wrong, treat the finding as blocking and request a verifier review.

Adds explicit read-only Zapier MCP setup and discovery for the Codex backend through
qmax-code zapier connect|status|disconnect. Setup and agent turns honor the selectedCODEX_HOME, preserve existing MCP configuration and credential-storage choices, and refuse conflicting custom configuration.Native OAuth uses keyring-only MCP storage and exactly
inspect_zapier_actions/execute_zapier_read_action. Configuration changes are atomic and serialized across qmax processes. Discovery records structural metadata only and refuses interactive requests. The agent prompt treats external business content as untrusted data; it is not a deterministic execution sandbox.Epic: QUA-2405. Ticket: QUA-2406.
Acceptance evidence:
qmax-code --local --backend codexturn executed Google Sheetsget_data_rangefor one selected A4:K4 range on 2026-11-16. The direct tool result verified one row and source identifiers. No business-app write executed. Private sanitized receipts remain in the workspace.CODEX_HOMEisolates configuration but does not isolate Codex 0.144.5 MCP keyring credentials: its key derives from server name and URL. Documentation makes that boundary explicit. User explicitly authorized provider revocation and restoration after the shared-keyring impact was explained; the full cycle is now verified and access restored.Local validation for runtime code at head
5898b06:go test ./...passed across 20 packages;go vet ./...and release-style Go build passed;git diff --checkpassed before commit. Final ponytail review read the changed paths and connected callers and found no remaining confirmed code finding. Earlier validation on the unchanged runtime code includes CI-pinned golangci-lint v2.15.0 (zero issues), atomic-coverage suite, and Windows lock-path cross-compilation. No Windows runtime qualification. No pre-commit configuration exists in this repository.Review fixes in
3a2dc5f: disconnecting an absent server leaves configuration unchanged, including a fresh home; the Codex version probe bounds inherited output pipes after exit/cancellation. Added subprocess coverage for connect/status/disconnect, refusal/error paths, output failures and both inherited-pipe cases. Both Copilot threads are resolved with fix/test evidence.Previous-head CI (
3a2dc5f, not evidence for861e357): required build-and-test and Run Go Tests, Code Health, and both Socket checks passed. QualityMax Pipeline completed neutral, with 1588/1588 Go tests passing; AI diff review 17/17 files and SAST 19/19 completed. AI Tests were blocked before execution bysandbox_concurrency_limit; go_test; preview gate skipped without a deployment. The exact-head review delivered no blocking findings; two model-only advisories were checked against the existing frame/page limits, deadline, typed parsing, RPC-ID matching and sanitized output allowlists, with no concrete defect reproduced.Previous-head Codecov: patch 207/239 lines (86.61088%, 32 missing, previously 63); overall 85.82%. Coverage upload succeeded, but the missing-line warning remains. Local aggregate statement coverage was 85.2%,
runZapierCommand92.7%.Previous documentation head
861e357: required CI and Socket checks passed; QualityMax Code Health passed and Pipeline completed neutral with 1588/1588 tests, review/SAST complete, AI Tests sandbox-blocked and no preview deployment. Its Go-test reporting step emitted HTTP 401 (Invalid API key): tests passed, but external delivery failed. The workflow references repository secretQAMAX_API_KEY; its value was not read or changed.Live follow-up
5898b06adds the reconnect diagnostic and a subprocess regression for the actual cached-oAuth/empty-inventory response. Local full tests, vet, release build and final ponytail review passed. Exact-head CI completed: required build-and-test and Run Go Tests, Code Health (A, 100/100, zero findings) and both Socket checks passed. QualityMax Pipeline completed neutral: 1589/1589 Go tests passed, AI review 17/17 files and SAST 19/19 completed, exact-head review #5923075959 delivered no blocking or inline findings. AI Tests were blocked before execution by sandbox_concurrency_limit; preview gate skipped without deployment. Four model-only advisories were checked against reachable callers, bounded/typed discovery and ASCII output validation; no concrete defect reproduced. Go-test external report delivery still warns HTTP 401 Invalid API key; QAMAX_API_KEY was not read or changed. No release or deployment.Evidence limits: the returned
completed/passedrow is historical demo data, not a new test result. The agent's final answer omitted returned fields and confused a pinned GitHub revision with a sheet revision; the direct result projection preserves the fields and marks sheet revision unknown. Deterministic provenance belongs to QUA-2408. The earlier v1.40.2 approved Sheets append is complete and must not be replayed.No application dependency changes, migrations, write broker, result-write command, release or deployment. 9lives doctor previously reported missing Playwright dependencies at this Go repository root; no runner/browser test execution is claimed. Full before/after workflow, provenance and approved result delivery remain QUA-2407–2410. See
docs/ZAPIER_MCP.mdfor setup and qualification boundaries.