Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions plugins/codex/commands/agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
description: Configure agent models — switch between Claude and OpenAI models
allowed-tools: Bash(node:*)
---

Run the interactive TUI directly:

```bash
node "${CLAUDE_PLUGIN_ROOT}/scripts/agent-config-tui.mjs"
```

After the TUI exits, read the applied changes from stdout and summarize them to the user.
38 changes: 38 additions & 0 deletions plugins/codex/commands/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,41 @@ Output rules:
- Present the final setup output to the user.
- If installation was skipped, present the original setup output.
- If Codex is installed but not authenticated, preserve the guidance to run `!codex login`.

After setup completes successfully (Codex installed and authenticated):
- Use `AskUserQuestion` to ask whether the user wants to configure agent models now.
- Use these two options:
- `Configure agent models`
- `Skip for now`
- If the user chooses to configure, run the agent config flow:

**Agent config flow:**

1. Get available models:
```bash
node "${CLAUDE_PLUGIN_ROOT}/scripts/patch-agents.mjs" available-models --json
```

2. List current agents:
```bash
node "${CLAUDE_PLUGIN_ROOT}/scripts/patch-agents.mjs" list --json
```

3. If there are many agents (>10), use `AskUserQuestion` first:
- `Configure all agents one by one`
- `Select specific agents to configure`
- `Skip`
- If user picks "Select specific", list agent names and let them pick.

4. For each agent to configure, use `AskUserQuestion` with format:
```
<agent-name> (current: <current-model>)
```
Options: all available models (mark current with `(current)`), plus `Skip` at the end.

5. For each selection that differs from current, run:
```bash
node "${CLAUDE_PLUGIN_ROOT}/scripts/patch-agents.mjs" patch <agent-name> <model> --json
```

6. Summarize all changes made.
9 changes: 9 additions & 0 deletions plugins/codex/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
"timeout": 5
}
]
},
{
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/auto-patch-agents-hook.mjs\"",
"timeout": 5
}
]
}
],
"SessionEnd": [
Expand Down
Loading