fix(config): reject unsupported env placeholders - #324
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 2:33 PM ET / 18:33 UTC. ClawSweeper reviewWhat this changesThe PR rejects unsupported Merge readinessKeep open: the PR remains a focused, evidence-backed fix for the linked configuration bug, and review found no actionable correctness defect in the current head. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherMCPorter reads server definitions from configuration, imports, and SDK callers, resolves environment values, then creates HTTP or stdio transports. Invalid placeholder handling must stop before headers are sent or child processes start. flowchart LR
A[Configuration and SDK definitions] --> B[Environment value resolver]
B --> C[Placeholder validation]
C --> D[HTTP header construction]
C --> E[Stdio command preparation]
D --> F[Remote MCP server]
E --> G[Child MCP process]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the narrow fail-fast validation and documentation update so invalid imported or authored placeholders cannot reach authentication headers or child-process launch. Do we have a high-confidence way to reproduce the issue? Yes. The resolver and its HTTP and stdio callers make the failing path clear, and the PR supplies redacted after-fix CLI traces plus focused regression coverage. Is this the best way to solve the issue? Yes. Rejecting the unsupported syntax at the shared resolver is narrower and safer than silently translating a grammar MCPorter has not documented as supported. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae3d9000c320. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bd3515b5a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Closes #323
Summary
${env:VAR}placeholders before HTTP requests or stdio process launches, including inherited environment keys and direct SDK runtime definitions${VAR},${VAR:-fallback}, and whole-value$env:VARforms in CLI help, the packaged README, import guidance, and generated schemaBehavior proof
On current main, resolving
Bearer ${env:MCPORTER_TEST_TOKEN}withMCPORTER_TEST_TOKENset returned the same literal string, allowing it to reach an authorization header unchanged. A whole-value${env:MCPORTER_TEST_TOKEN}also entered the legacy default parser instead of reporting unsupported syntax.After the fix, two isolated configurations were exercised through the built CLI. Paths are redacted below. The HTTP configuration failed while resolving its header, before any request:
The stdio configuration used inherited
PATHand a child command that would create a sentinel if launched. It failed on the configured value before inherited-key precedence, and the sentinel remained absent:A direct
createRuntime({ servers })regression also supplies${env:MCPORTER_COMMAND}as the stdio executable and verifies thatruntime.connect()returns the same corrective error before transport creation.Validation
Focused regression coverage passed with 4 files and 29 tests. The full suite passed with 194 files and 1,639 tests; 4 files and 26 tests were skipped by the existing suite configuration. Documentation listing, formatting, lint, type checking, the build, the documentation site build, and the diff check also passed on Node.js 24.19.0 with pnpm 10.34.5.
Limitations
This rejects
${env:VAR}with corrective guidance rather than translating it. Supported placeholder behavior is unchanged, and no live provider credentials are required for this parser and help-surface fix.Disclosure: AI was used to understand the codebase and review the fix.