From bf12b7769c71765c67d2d86cf962fb74fb9d0761 Mon Sep 17 00:00:00 2001 From: Harsh panwar Date: Mon, 4 May 2026 11:38:21 +0530 Subject: [PATCH 1/4] fix: the MPC disconnection --- registry/coder-labs/modules/gemini/main.tf | 10 ++------- .../modules/gemini/scripts/install.sh | 21 +++++++++++++++++++ .../modules/gemini/scripts/start.sh | 2 +- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/registry/coder-labs/modules/gemini/main.tf b/registry/coder-labs/modules/gemini/main.tf index dbc81bc79..cb24774fd 100644 --- a/registry/coder-labs/modules/gemini/main.tf +++ b/registry/coder-labs/modules/gemini/main.tf @@ -148,22 +148,16 @@ locals { base_extensions = <<-EOT { "coder": { + "command": "/tmp/coder.WQWVyS/coder", "args": [ "exp", "mcp", "server" ], - "command": "coder", - "description": "Report ALL tasks and statuses (in progress, done, failed) you are working on.", - "enabled": true, "env": { "CODER_MCP_APP_STATUS_SLUG": "${local.app_slug}", "CODER_MCP_AI_AGENTAPI_URL": "http://localhost:3284" - }, - "name": "Coder", - "timeout": 3000, - "type": "stdio", - "trust": true + } } } EOT diff --git a/registry/coder-labs/modules/gemini/scripts/install.sh b/registry/coder-labs/modules/gemini/scripts/install.sh index 7b70a6af4..059851f1b 100644 --- a/registry/coder-labs/modules/gemini/scripts/install.sh +++ b/registry/coder-labs/modules/gemini/scripts/install.sh @@ -17,6 +17,7 @@ echo "--------------------------------" printf "gemini_config: %s\n" "$ARG_GEMINI_CONFIG" printf "install: %s\n" "$ARG_INSTALL" printf "gemini_version: %s\n" "$ARG_GEMINI_VERSION" +printf "BASE_EXTENSIONS: %s\n" "$BASE_EXTENSIONS" echo "--------------------------------" set +o nounset @@ -140,6 +141,25 @@ function add_system_prompt_if_exists() { fi } +function patch_coder_mcp_command() { + CODER_BIN=$(which coder) + SETTINGS_PATH="$HOME/.gemini/settings.json" + + if [ -z "$CODER_BIN" ]; then + printf "Warning: could not find coder binary, MCP command path not patched.\n" + return + fi + + printf "Patching coder MCP command path to: %s\n" "$CODER_BIN" + + TMP_SETTINGS=$(mktemp) + jq --arg bin "$CODER_BIN" \ + '.mcpServers.coder.command = $bin' \ + "$SETTINGS_PATH" > "$TMP_SETTINGS" && mv "$TMP_SETTINGS" "$SETTINGS_PATH" + + printf "Patch complete.\n" +} + function configure_mcp() { export CODER_MCP_APP_STATUS_SLUG="gemini" export CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284" @@ -149,4 +169,5 @@ function configure_mcp() { install_gemini populate_settings_json add_system_prompt_if_exists +patch_coder_mcp_command configure_mcp diff --git a/registry/coder-labs/modules/gemini/scripts/start.sh b/registry/coder-labs/modules/gemini/scripts/start.sh index eed550907..3acfda827 100644 --- a/registry/coder-labs/modules/gemini/scripts/start.sh +++ b/registry/coder-labs/modules/gemini/scripts/start.sh @@ -71,4 +71,4 @@ else fi agentapi server --term-width 67 --term-height 1190 -- \ - bash -c "$(printf '%q ' gemini "${GEMINI_ARGS[@]}")" + bash -c "$(printf '%q ' gemini --debug "${GEMINI_ARGS[@]}")" From 258b0088eae1a0afff25e1deaaa94326810ee823 Mon Sep 17 00:00:00 2001 From: Harsh panwar Date: Mon, 4 May 2026 12:25:51 +0530 Subject: [PATCH 2/4] add node js pre-install script template for Users --- registry/coder-labs/modules/gemini/README.md | 16 ++++++++++++++++ .../coder-labs/modules/gemini/scripts/start.sh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/registry/coder-labs/modules/gemini/README.md b/registry/coder-labs/modules/gemini/README.md index d0a113a02..1cc531214 100644 --- a/registry/coder-labs/modules/gemini/README.md +++ b/registry/coder-labs/modules/gemini/README.md @@ -105,6 +105,22 @@ module "gemini" { You are a helpful coding assistant. Always explain your code changes clearly. YOU MUST REPORT ALL TASKS TO CODER. EOT + pre_install_script = <<-EOT + #!/bin/bash + set -e + + echo "Installing Node.js via NodeSource..." + + sudo apt-get update -qq && sudo apt-get install -y curl ca-certificates + + curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash - + + sudo apt-get install -y nodejs + + echo "Node version: $(node -v)" + echo "npm version: $(npm -v)" + echo "Node install complete." + EOT } ``` diff --git a/registry/coder-labs/modules/gemini/scripts/start.sh b/registry/coder-labs/modules/gemini/scripts/start.sh index 3acfda827..eed550907 100644 --- a/registry/coder-labs/modules/gemini/scripts/start.sh +++ b/registry/coder-labs/modules/gemini/scripts/start.sh @@ -71,4 +71,4 @@ else fi agentapi server --term-width 67 --term-height 1190 -- \ - bash -c "$(printf '%q ' gemini --debug "${GEMINI_ARGS[@]}")" + bash -c "$(printf '%q ' gemini "${GEMINI_ARGS[@]}")" From 3af9c97043b747849c03d9d737072c21d8891e4d Mon Sep 17 00:00:00 2001 From: Harsh panwar Date: Mon, 4 May 2026 12:34:39 +0530 Subject: [PATCH 3/4] fmt --- registry/coder-labs/modules/gemini/README.md | 2 +- registry/coder-labs/modules/gemini/main.tf | 2 +- registry/coder-labs/modules/gemini/scripts/install.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/registry/coder-labs/modules/gemini/README.md b/registry/coder-labs/modules/gemini/README.md index 1cc531214..dafca05d5 100644 --- a/registry/coder-labs/modules/gemini/README.md +++ b/registry/coder-labs/modules/gemini/README.md @@ -105,7 +105,7 @@ module "gemini" { You are a helpful coding assistant. Always explain your code changes clearly. YOU MUST REPORT ALL TASKS TO CODER. EOT - pre_install_script = <<-EOT + pre_install_script = <<-EOT #!/bin/bash set -e diff --git a/registry/coder-labs/modules/gemini/main.tf b/registry/coder-labs/modules/gemini/main.tf index cb24774fd..336c112f9 100644 --- a/registry/coder-labs/modules/gemini/main.tf +++ b/registry/coder-labs/modules/gemini/main.tf @@ -148,7 +148,7 @@ locals { base_extensions = <<-EOT { "coder": { - "command": "/tmp/coder.WQWVyS/coder", + "command": "coder", "args": [ "exp", "mcp", diff --git a/registry/coder-labs/modules/gemini/scripts/install.sh b/registry/coder-labs/modules/gemini/scripts/install.sh index 059851f1b..ce44beb9c 100644 --- a/registry/coder-labs/modules/gemini/scripts/install.sh +++ b/registry/coder-labs/modules/gemini/scripts/install.sh @@ -144,7 +144,7 @@ function add_system_prompt_if_exists() { function patch_coder_mcp_command() { CODER_BIN=$(which coder) SETTINGS_PATH="$HOME/.gemini/settings.json" - + if [ -z "$CODER_BIN" ]; then printf "Warning: could not find coder binary, MCP command path not patched.\n" return From 6a0225703d7864568454a736608a192551639015 Mon Sep 17 00:00:00 2001 From: Harsh panwar Date: Wed, 6 May 2026 12:24:41 +0530 Subject: [PATCH 4/4] version update --- registry/coder-labs/modules/gemini/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registry/coder-labs/modules/gemini/README.md b/registry/coder-labs/modules/gemini/README.md index dafca05d5..57842ac63 100644 --- a/registry/coder-labs/modules/gemini/README.md +++ b/registry/coder-labs/modules/gemini/README.md @@ -13,7 +13,7 @@ Run [Gemini CLI](https://github.com/google-gemini/gemini-cli) in your workspace ```tf module "gemini" { source = "registry.coder.com/coder-labs/gemini/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.main.id folder = "/home/coder/project" } @@ -46,7 +46,7 @@ variable "gemini_api_key" { module "gemini" { source = "registry.coder.com/coder-labs/gemini/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.main.id gemini_api_key = var.gemini_api_key folder = "/home/coder/project" @@ -94,7 +94,7 @@ data "coder_parameter" "ai_prompt" { module "gemini" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder-labs/gemini/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.main.id gemini_api_key = var.gemini_api_key gemini_model = "gemini-2.5-flash" @@ -134,7 +134,7 @@ For enterprise users who prefer Google's Vertex AI platform: ```tf module "gemini" { source = "registry.coder.com/coder-labs/gemini/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.main.id gemini_api_key = var.gemini_api_key folder = "/home/coder/project"