Skip to content

copilot CLI: /tmp/install.sh: line 204: ARG_COPILOT_MODEL: unbound variable #462

@romracer

Description

@romracer

Adding the Copilot CLI module to a template generates the following error in the logs and doesn't complete installation / Coder tasks integration:

/tmp/install.sh: line 204: ARG_COPILOT_MODEL: unbound variable

It doesn't appear ARG_COPILOT_MODEL is passed to agentapi's install script:

ARG_MCP_APP_STATUS_SLUG='${local.app_slug}' \
ARG_REPORT_TASKS='${var.report_tasks}' \
ARG_WORKDIR='${local.workdir}' \
ARG_MCP_CONFIG='${var.mcp_config != "" ? base64encode(var.mcp_config) : ""}' \
ARG_COPILOT_CONFIG='${base64encode(local.final_copilot_config)}' \
ARG_EXTERNAL_AUTH_ID='${var.external_auth_id}' \
ARG_COPILOT_VERSION='${var.copilot_version}' \
/tmp/install.sh

And it has no default on line 204:

if [ -n "$ARG_COPILOT_MODEL" ] && [ "$ARG_COPILOT_MODEL" != "claude-sonnet-4.5" ]; then

Seems like the proper fix is to pass ARG_COPILOT_MODEL to install.sh:

    ...
    ARG_COPILOT_VERSION='${var.copilot_version}' \
    ARG_COPILOT_MODEL='${var.copilot_model}' \
    /tmp/install.sh

and then reference it there:

...
ARG_EXTERNAL_AUTH_ID=${ARG_EXTERNAL_AUTH_ID:-github}
ARG_COPILOT_VERSION=${ARG_COPILOT_VERSION:-0.0.334}
ARG_COPILOT_MODEL=${ARG_COPILOT_MODEL:-claude-sonnet-4.5}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions