Repository navigation
fix(runtime): omit empty MCP args instead of writing null - #1192
Open
finallylly wants to merge 1 commit into
Open
finallylly wants to merge 1 commit into
finallylly wants to merge 1 commit into
Conversation
mcpConfigEntries wrote "args": null for stdio MCP servers without arguments, such as the built-in gate server. Claude Code skips a server whose args is null, so SOP nodes running on Claude never saw submit_gate_result and stopped for manual confirmation. Omit args when it is empty, matching the Codex renderer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
SOP agent nodes running on Claude Code could not see the
agentflow-gateMCP server, sosubmit_gate_resultwas missing. The platform resumed the CLI session, still received no gate result, and stopped every node for manual confirmation (未收到 submit_gate_result,恢复 CLI session 后仍未提交).mcpConfigEntrieswrote"args": nullintomcp.jsonfor stdio servers without arguments, such as the built-in gate server. Claude Code skips a server whoseargsis null instead of starting it.The entry now omits
argswhen it is empty, which matches how the Codex renderer (codexMCPServerArgs) already handles servers without arguments.This addresses the same problem as #1034, which writes
"args": []instead. Either form works with Claude Code; this PR adds a reproduction on macOS and keeps the generated entry consistent with the Codex renderer. Feel free to close whichever one you do not prefer.Scope
Compatibility
No schema or runner protocol change. Only stdio MCP entries without arguments change:
argsis omitted instead of written asnull. Entries with arguments are unchanged. Consumers inagent_cli.goalready handle a missingargskey.Validation
Run on macOS (Apple silicon).
TestMCPConfigEntriesOmitsEmptyArgsfails without the fix ("args":nullin the rendered config) and passes with it.go test ./internal/runtime: the remaining failures in this macOS environment (Docker-dependent tests) are identical with and without this change."args": null→ no MCP servers loaded,submit_gate_resultabsent;"args": []or omitted →agentflow-gateconnected andsubmit_gate_resultlisted.localsandbox: before the fix every Claude agent node stopped for manual confirmation; after it, the backend delivery SOP ran through and only stopped at the configured approval nodes.go test ./...,scripts/scan-secrets.sh(downloads a Linux-only binary), Local edition scripts (not affected).Safety