支持codex的多profile模式
What feature would you like to see?
codex配置文件中可以配置多个profile,指定不同的模型和思考量级等参数,然后通过 codex --profile=profile_name 来使用。 希望hapi能够支持给codex配置profile参数。
Additional information
No response
目前代码里,这个能力只在一部分场景下成立,完整的 profile 支持还没有找到。
本地终端直接运行 hapi codex 时,未识别的参数会被收集到 codexArgs,后续继续传给 codex 进程,所以像 hapi codex --profile=profile_name 这种本地启动路径按代码看是会透传的。
但 HAPI 的远程/网页新建会话路径目前没有 profile 字段。Web 端创建会话时只会提交 agent、model、modelReasoningEffort、yolo、sessionType、worktreeName、effort;Hub 端的 /machines/:id/spawn 也只校验这些字段;Runner 启动 codex 时同样只拼接 --model、--model-reasoning-effort、--yolo 等参数。除此之外,Codex remote launcher 还明确写了:codexArgs 在 remote mode 会被忽略。
Relevant code:
cli/src/commands/codex.ts:40-hapi codex会把未识别参数放入unknownArgs,再赋给codexArgscli/src/codex/codexLocal.ts:59- 本地启动时会把codexArgs继续传给codexweb/src/components/NewSession/index.tsx:246- Web 新建会话只整理model/effort/modelReasoningEffort等已知字段web/src/hooks/mutations/useSpawnSession.ts:6- Web spawn 输入类型里没有profileweb/src/api/client.ts:386-/spawn请求体没有profilehub/src/web/routes/machines.ts:7- Hub 的spawnBodySchema没有profilecli/src/runner/run.ts:362- Runner 远程启动只拼接固定参数,没有--profilecli/src/codex/codexRemoteLauncher.ts:97- remote mode 下codexArgs会被忽略
Need more info:
- 你希望支持的入口是哪个:Web 新建会话、
hapi runner远程启动,还是两者都要? - 你期望的形式是只传
--profile=<name>,还是还需要在 Web UI 里提供 profile 选择器?
HAPI Bot
主要是希望能在web端新建会话的时候可以为codex指定profile名称,形式不限,不过可以先就让用户手动输入。