fix(coder-labs/modules/codex): address review findings from Netero

- Guard jq usage with command -v check; emit a clear error and skip the
  remote MCP fetch when jq is not available (DEREM-1)
- Remove vacuous length assertion in tftest that tested its own input,
  not the module behavior (DEREM-2)
- Replace em-dash with period in test comment (DEREM-3)
This commit is contained in:
35C4n0r 2026-05-19 10:50:19 +00:00
parent af2cc72e44
commit 594256f961
3 changed files with 5 additions and 6 deletions

View File

@ -469,7 +469,7 @@ describe("codex", async () => {
).text(),
});
// Drop the remote TOML payload at a path the install script will fetch
// via file:// — keeps the test self-contained (no external network).
// via file://. Keeps the test self-contained (no external network).
await execContainer(id, [
"bash",
"-c",

View File

@ -196,11 +196,6 @@ run "test_mcp_config_remote_path" {
]
}
assert {
condition = length(var.mcp_config_remote_path) == 2
error_message = "mcp_config_remote_path should accept a list of URLs"
}
assert {
condition = strcontains(local.install_script, base64encode(jsonencode(var.mcp_config_remote_path)))
error_message = "install script should embed the base64-encoded mcp_config_remote_path JSON"

View File

@ -158,6 +158,9 @@ function populate_config_toml() {
fi
if [ -n "$${ARG_MCP_CONFIG_REMOTE_PATH}" ] && [ "$${ARG_MCP_CONFIG_REMOTE_PATH}" != "[]" ]; then
if ! command -v jq > /dev/null 2>&1; then
printf "Error: 'jq' is required to process mcp_config_remote_path but was not found. Skipping remote MCP config fetch.\n" >&2
else
for url in $(echo "$${ARG_MCP_CONFIG_REMOTE_PATH}" | jq -r '.[]'); do
echo "Fetching MCP configuration from: $${url}"
mcp_toml=$(curl -fsSL "$${url}") || {
@ -167,6 +170,7 @@ function populate_config_toml() {
printf "Appending MCP servers from %s\n" "$${url}"
printf '\n%s\n' "$${mcp_toml}" >> "$${config_path}"
done
fi
fi
if [ "$${ARG_ENABLE_AI_GATEWAY}" = "true" ] && [ -n "$${ARG_AIBRIDGE_CONFIG}" ]; then