Skip to content

Conversation

@35C4n0r
Copy link
Collaborator

@35C4n0r 35C4n0r commented Jan 12, 2026

Description

  • Add support for AI Bridge

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder-labs/modules/codex
New version: v4.1.0
Breaking change: [ ] Yes [x] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun fmt)
  • Changes tested locally

Related Issues

Closes: #650

@35C4n0r 35C4n0r changed the title feat(coder-labs/modules/codex) feat(coder-labs/modules/codex): add support for aibridge Jan 12, 2026
@35C4n0r 35C4n0r marked this pull request as draft January 12, 2026 16:06
@35C4n0r 35C4n0r marked this pull request as ready for review January 12, 2026 16:11
@35C4n0r 35C4n0r self-assigned this Jan 12, 2026
@matifali matifali requested a review from pawbana January 15, 2026 08:05
@pawbana
Copy link

pawbana commented Jan 15, 2026

I'm not familiar with modules/templates enough to confidently review this but from my shallow understanding it looks good, codex config changes look good.

@DevelopmentCats
Copy link
Contributor

I will go ahead and give this a test today but everything looks good after looking through this again.

@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Jan 21, 2026

@DevelopmentCats I am confused by these 3 suggestions, can you please help to clarify them ?

#655 (comment)

module "codex" {
     count           = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0

#655 (comment)

app_id = module.codex[count.index].task_app_id

Do we do this in any other module ? What is the purpose of this ?


#655 (comment)

data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0

Setting coder_ai_task count to 0 has no effect, it will still show down in the task dropdown. Is there any other reason to set this to 0 ?

@DevelopmentCats
Copy link
Contributor

DevelopmentCats commented Jan 21, 2026

@DevelopmentCats I am confused by these 3 suggestions, can you please help to clarify them ?

#655 (comment)

module "codex" {
     count           = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0

#655 (comment)

app_id = module.codex[count.index].task_app_id

Do we do this in any other module ? What is the purpose of this ?

#655 (comment)

data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0

Setting coder_ai_task count to 0 has no effect, it will still show down in the task dropdown. Is there any other reason to set this to 0 ?

This is directly from the docker tasks template from the registry. Essentially this is the documented way of setting this module to only be enabled when run from the tasks ui.

Although it has changed a bit this is what I was referencing so you are probably fine here.

resource "coder_ai_task" "task" {
  count  = data.coder_workspace.me.start_count
  app_id = module.claude-code[count.index].task_app_id
}

# You can read the task prompt from the `coder_task` data source.
data "coder_task" "me" {}

# The Claude Code module does the automatic task reporting
# Other agent modules: https://registry.coder.com/modules?search=agent
# Or use a custom agent:
module "claude-code" {
  count               = data.coder_workspace.me.start_count
  source              = "registry.coder.com/coder/claude-code/coder"
  version             = "4.0.0"
  agent_id            = coder_agent.main.id
  workdir             = "/home/coder/projects"
  order               = 999
  claude_api_key      = ""
  ai_prompt           = data.coder_task.me.prompt
  system_prompt       = data.coder_parameter.system_prompt.value
  model               = "sonnet"
  permission_mode     = "plan"
  post_install_script = data.coder_parameter.setup_script.value
}

@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Jan 21, 2026

@DevelopmentCats I am confused by these 3 suggestions, can you please help to clarify them ?

#655 (comment)

module "codex" {
     count           = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0

#655 (comment)

app_id = module.codex[count.index].task_app_id

Do we do this in any other module ? What is the purpose of this ?

#655 (comment)

data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0

Setting coder_ai_task count to 0 has no effect, it will still show down in the task dropdown. Is there any other reason to set this to 0 ?

This is directly from the docker tasks template from the registry. Essentially this is the documented way of setting this module to only be enabled when run from the tasks ui.

Although it has changed a bit this is what I was referencing so you are probably fine here.

resource "coder_ai_task" "task" {
  count  = data.coder_workspace.me.start_count
  app_id = module.claude-code[count.index].task_app_id
}

# You can read the task prompt from the `coder_task` data source.
data "coder_task" "me" {}

# The Claude Code module does the automatic task reporting
# Other agent modules: https://registry.coder.com/modules?search=agent
# Or use a custom agent:
module "claude-code" {
  count               = data.coder_workspace.me.start_count
  source              = "registry.coder.com/coder/claude-code/coder"
  version             = "4.0.0"
  agent_id            = coder_agent.main.id
  workdir             = "/home/coder/projects"
  order               = 999
  claude_api_key      = ""
  ai_prompt           = data.coder_task.me.prompt
  system_prompt       = data.coder_parameter.system_prompt.value
  model               = "sonnet"
  permission_mode     = "plan"
  post_install_script = data.coder_parameter.setup_script.value
}

This is directly from the docker tasks template from the registry. Essentially this is the documented way of setting this module to only be enabled when run from the tasks ui.

Yeah, that would make sense for the Docker template, but if we do that in agent specific module then it would just be a normal workspace (when not created as tasks).

Great, Ig then no more changes are needed here, I have updated the readme, @matifali would you like to give the Readme a quick review ? I have tried to keep it in the same format as that of claude-code.

@DevelopmentCats
Copy link
Contributor

@DevelopmentCats I am confused by these 3 suggestions, can you please help to clarify them ?

#655 (comment)

module "codex" {
     count           = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0

#655 (comment)

app_id = module.codex[count.index].task_app_id

Do we do this in any other module ? What is the purpose of this ?

#655 (comment)

data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0

Setting coder_ai_task count to 0 has no effect, it will still show down in the task dropdown. Is there any other reason to set this to 0 ?

This is directly from the docker tasks template from the registry. Essentially this is the documented way of setting this module to only be enabled when run from the tasks ui.
Although it has changed a bit this is what I was referencing so you are probably fine here.

resource "coder_ai_task" "task" {
  count  = data.coder_workspace.me.start_count
  app_id = module.claude-code[count.index].task_app_id
}

# You can read the task prompt from the `coder_task` data source.
data "coder_task" "me" {}

# The Claude Code module does the automatic task reporting
# Other agent modules: https://registry.coder.com/modules?search=agent
# Or use a custom agent:
module "claude-code" {
  count               = data.coder_workspace.me.start_count
  source              = "registry.coder.com/coder/claude-code/coder"
  version             = "4.0.0"
  agent_id            = coder_agent.main.id
  workdir             = "/home/coder/projects"
  order               = 999
  claude_api_key      = ""
  ai_prompt           = data.coder_task.me.prompt
  system_prompt       = data.coder_parameter.system_prompt.value
  model               = "sonnet"
  permission_mode     = "plan"
  post_install_script = data.coder_parameter.setup_script.value
}

This is directly from the docker tasks template from the registry. Essentially this is the documented way of setting this module to only be enabled when run from the tasks ui.

Yeah, that would make sense for the Docker template, but if we do that in agent specific module then it would just be a normal workspace (when not created as tasks).

Great, Ig then no more changes are needed here, I have updated the readme, @matifali would you like to give the Readme a quick review ? I have tried to keep it in the same format as that of claude-code.

You are all good from my perspective then here 😸

@35C4n0r 35C4n0r requested a review from matifali January 21, 2026 17:54
@matifali matifali added the version:minor Add to PRs requiring a minor version upgrade label Jan 27, 2026
@github-actions
Copy link
Contributor

Version Bump Required

One or more modules in this PR need their versions updated.

To fix this:

  1. Run the version bump script locally:
    ./.github/scripts/version-bump.sh 
  2. Commit the changes:
    git add . && git commit -m "chore: bump module versions ()"
  3. Push your changes

The CI will automatically re-run once you push the updated versions.

@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Jan 27, 2026

@matifali wait, I think I marked the wrong version int he Readme. Let me fix that.

@matifali matifali added version:minor Add to PRs requiring a minor version upgrade and removed version:minor Add to PRs requiring a minor version upgrade labels Jan 30, 2026
@matifali
Copy link
Member

@35C4n0r is it ready to merge?

@github-actions
Copy link
Contributor

Version Bump Required

One or more modules in this PR need their versions updated.

To fix this:

  1. Run the version bump script locally:
    ./.github/scripts/version-bump.sh 
  2. Commit the changes:
    git add . && git commit -m "chore: bump module versions ()"
  3. Push your changes

The CI will automatically re-run once you push the updated versions.

@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Jan 30, 2026

@35C4n0r is it ready to merge?

Yes.

@matifali
Copy link
Member

@35C4n0r, can you fix the version issue and then merge and release? Also mention that it requires Coder version 2.30+ in the AI Bridge section. Thanks.

@35C4n0r 35C4n0r added version:minor Add to PRs requiring a minor version upgrade and removed version:minor Add to PRs requiring a minor version upgrade labels Jan 31, 2026
@35C4n0r 35C4n0r enabled auto-merge (squash) January 31, 2026 03:10
@35C4n0r 35C4n0r merged commit 360b3cd into main Jan 31, 2026
4 checks passed
@35C4n0r 35C4n0r deleted the 35C4n0r/feat-codex-aibridge branch January 31, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version:minor Add to PRs requiring a minor version upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add AI Bridge Integration to Codex Module

4 participants