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.
Use actual mounted MCP CLI wrappers so AI Moderator safe outputs remain reliable #39243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use actual mounted MCP CLI wrappers so AI Moderator safe outputs remain reliable #39243
Changes from all commits
1a82cc306f197067ce9d1File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/tdd] The single
itblock combines a happy-path assertion and the empty-array regression case. Splitting them into two nameditblocks means failure messages directly identify the broken scenario, and the regression intent is self-documenting.💡 Suggested split
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/diagnose] The nil-guard uses
getMCPCLIServerNames(data)— configured servers — not the runtime mount result. In the partial-failure scenario where all configured servers fail to mount, this prompt section is still generated; at runtime${{ steps.mount-mcp-clis.outputs.mounted-servers-list }}resolves to"", so the model receives the "CLI servers available on PATH" preamble with an empty bullet list.💡 Suggested mitigation
This is an edge case, but could produce confusing model behaviour. Options:
mcp_cli_tools_prompt.mdcan wrap the bullet list in a conditional block ({% if GH_AW_MCP_CLI_SERVERS_LIST %}...{% endif %}), the empty-list case degrades cleanly.mounted-servers-listoutput (or emit a sentinel value) when the list is empty, so downstream consumers can detect the empty case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/diagnose] The step ID
mount-mcp-clisis a magic string embedded in this Go-generated runtime expression. If the step is renamed in the workflow definition, the binding breaks silently — no compile-time check catches the mismatch.💡 Suggested improvement
Define a Go constant that holds the step ID and reference it when building the expression:
This also makes it easier to verify consistency with the step definition elsewhere in the Go layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fragile magic-string assertion will not catch a step/output rename: this only validates the expression is spelled correctly today, not that the env var will be populated at runtime.
💡 Details
The new assertion:
has no compile-time or test-time link to the step ID
mount-mcp-clisor the output keymounted-servers-listgenerated elsewhere in the compiler. If either name drifts (e.g., step is renamed tomount-mcp-cli-tools), the generated YAML silently produces an empty server list and this test continues to pass with exit 0.Suggested fix: extract the expression to a named constant in the package (e.g.,
const mcpCLIMountedServersListExpr = "${{ steps.mount-mcp-clis.outputs.mounted-servers-list }}"), use it in both the production code and the test, and add aTestMainor init-time assertion that the step ID constant matches what the compiler actually emits for the mount step. That way a rename breaks in exactly one place.Uh oh!
There was an error while loading. Please reload this page.