远程 Codex 会话不吃本地 -c spawn 注入:子代理配置(含按需委托策略)需经远端通道统一下发
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
## 背景
`prepareCodexExtraSpawnConfig` 的 `remoteHostId` 分支返回空 `extraArgs`(`apps/desktop/src/main/maker-host/index.ts:1025`)——**所有**本地 `-c` spawn 注入对 SSH 远程工作区的 Codex 一律不生效,远端 daemon 使用自己隔离的 `CODEX_HOME`。
受影响的配置(同一缺口,行为一致):
- 既有:「Codex 子代理」设置全套——`agents.enabled` 总开关、`default_subagent_model` / `default_subagent_reasoning_effort`、`max_concurrent_threads_per_session`、`max_depth`
- #1368 新增:`features.multi_agent_v2.multi_agent_mode_hint_text`(按需委托策略)与 `expose_spawn_agent_model_overrides`
即:远程会话的子代理仍走上游默认策略(非 ultra 档 `explicitRequestOnly`,不会自发委托),且用户在设置页对子代理的所有配置在远程均静默无效。
## 为什么不在 #1368 内修
这是存量架构边界,不是该 PR 引入;只为两个新键单独开远程通道会造成新旧键行为分裂。应整体设计一次:把整组子代理配置经远端 daemon 支持的通道(远端 config.toml 写入,或 daemon 协议注入)统一下发,并处理设置变更时的远端同步与回滚。
## 验收
- [ ] 远程 Codex 会话的 rollout `turn_context.multi_agent_mode` 与本地一致(custom 文案)
- [ ] 设置页子代理配置(开关/模型/强度/并发)对远程会话生效,变更经 DeferredCodexRestart 等价机制兑现
- [ ] 远端注入失败时有明确日志,不静默降级
关联:#1368(按需委托默认)、review 讨论 https://github.com/makecindy/cindy/pull/1368#discussion_r3698572423 附近 thread。
Contributor guide
Research direction
Start at apps/desktop/src/main/maker-host/index.ts:1025 and trace prepareCodexExtraSpawnConfig for remoteHostId. Read the linked #1368 discussion and inspect the remote daemon channel options mentioned in the issue. Done means the full subagent configuration synchronizes for remote sessions, changes take effect through the equivalent deferred restart path, rollout context matches locally, and injection failures are logged clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai-infra-agents
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100