Skip to content

Commit 070e939

Browse files
authored
feat(skills): add codex user agent (googleapis#2973)
## Description > Should include a concise description of the changes (bug or feature), it's > impact, along with a summary of the solution ## PR Checklist > Thank you for opening a Pull Request! Before submitting your PR, there are a > few things you can do to make sure it goes smoothly: - [ ] Make sure you reviewed [CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md) - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) - [ ] Make sure to add `!` if this involve a breaking change 🛠️ Fixes #<issue_number_goes_here>
1 parent 5346249 commit 070e939

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

cmd/internal/skills/generator.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ function prepareEnvironment() {
171171
userAgent = "skills-geminicli";
172172
} else if (process.env.CLAUDECODE === '1') {
173173
userAgent = "skills-claudecode";
174-
}
174+
} else if (process.env.CODEX_CI === '1') {
175+
userAgent = "skills-codex";
176+
}
175177
mergeEnvVars(env);
176178
{{if .OptionalVars}}
177179
OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => {

cmd/internal/skills/generator_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,16 @@ func TestGenerateScriptContent(t *testing.T) {
297297
`env[key.substring(prefix.length)] = process.env[key];`,
298298
},
299299
},
300+
{
301+
name: "codex ci script",
302+
toolName: "codex-tool",
303+
configArgs: `"--prebuilt", "test"`,
304+
mode: "bin",
305+
wantContains: []string{
306+
`userAgent = "skills-codex";`,
307+
`} else if (process.env.CODEX_CI === '1') {`,
308+
},
309+
},
300310
}
301311

302312
for _, tt := range tests {

0 commit comments

Comments
 (0)