codexPostWrite runs after the generic Apply for the openai-codex tool. If the selected model starts with "gpt", it sets [model_providers. ] wire_api = "responses" Otherwise it unsets wire_api on that provider. No-op for other tools.
(tool Tool, endpointName, model, configPath string)
| 14 | // |
| 15 | // Otherwise it unsets wire_api on that provider. No-op for other tools. |
| 16 | func codexPostWrite(tool Tool, endpointName, model, configPath string) error { |
| 17 | if tool.Name != "openai-codex" { |
| 18 | return nil |
| 19 | } |
| 20 | path := configPath |
| 21 | if path == "" && tool.ConfigTarget != nil { |
| 22 | path = pathutil.Expand(tool.ConfigTarget.Path) |
| 23 | } |
| 24 | if path == "" || endpointName == "" { |
| 25 | return nil |
| 26 | } |
| 27 | return applyCodexWireAPI(path, endpointName, model) |
| 28 | } |
| 29 | |
| 30 | func applyCodexWireAPI(path, endpointName, model string) error { |
| 31 | data, err := readConfigFile(path, "toml") |