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
description = "The model for Codex to use. Defaults to gpt-5.1-codex-max."
default = ""
description = "The model for Codex to use. Defaults to gpt-5.2-codex."
default = "gpt-5.2-codex"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it is not yet available for the API billing we use. So maybe use next best gpt-5.1-codex?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Collaborator Author

@35C4n0r 35C4n0r Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matifali @DevelopmentCats imo, we should leave the default as empty and not mention this either

Defaults to gpt-5.1-codex-max.

And make passing the model mandatory in the case of enable_aibridge = true.
lmk your thoughts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue that I notice with using these codex models with aibridge, is that the openai codex modules only support the v1/responses endpoint, and not v1/chat/completions

Currently from what I can see aibridge does not currently log v1/responses and only v1/chat/completions in the current release of aibridge, but I can see there has been work on this and it will be in soon.

coder/aibridge#84
coder/aibridge#87

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. It will be supported by next release. We will release this until we bring the interception functionality

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. It will be supported by next release. We will release this until we bring the interception functionality

Copy link
Member

@matifali matifali Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. It will be supported by the next release. We will release this once we bring in the interception functionality

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add AI Bridge Integration to Codex Module

4 participants