Skip to content

Dashboard should allow changing an existing bot's CLI and model #316

Description

@icankeep

Problem

Once a bot is created, the Dashboard only surfaces defaults such as working directory, roles, card behavior, grants, and startup settings. The bot's agent runtime is effectively fixed from the UI:

  • A bot created as one CLI, such as TraeX, cannot be changed to Claude/Codex/TTADK from the Dashboard.
  • The configured model is not shown in the bot defaults payload or UI.
  • Operators must edit bots.json manually or recreate the bot to change agent/runtime selection.

This is especially painful for wrapper launchers such as TTADK, where the selected wrapper and model must stay consistent.

Expected behavior

The Bot Defaults page should include a small CLI / Model section for each online bot:

  • show the current CLI selection and model when available
  • reuse the existing /api/cli-options source of truth
  • support wrapper selection keys such as ttadk-x-codex
  • save cliId, wrapperCli, and model together
  • apply changes to future sessions without mutating currently running sessions

Acceptance criteria

  • /api/bots exposes the current model and wrapper metadata needed by the UI.
  • Dashboard can PUT an agent update for a specific bot and proxy it to that bot's daemon.
  • The daemon persists cliId, wrapperCli, and model atomically and updates live bot config for future spawns.
  • The UI explains that running sessions need /restart to pick up the new CLI/model.
  • Unit coverage exists for payload, frontend rendering, and IPC persistence.

问题背景

机器人创建完成后,Dashboard 目前只能配置默认工作目录、角色、卡片行为、授权、启动命令等运行偏好,但不能直接调整这个机器人的 agent 运行时:

  • 如果创建时选择了 TraeX,后续无法在 Dashboard 上改成 Claude、Codex 或 TTADK 等其他 CLI。
  • 已配置的 model 没有出现在 bot 默认配置接口和页面中,用户看不到当前模型。
  • 运维人员只能手动编辑 bots.json,或者重新创建机器人来完成 CLI / 模型切换。

对于 TTADK 这类 wrapper launcher,CLI 选择项和 model 必须保持一致,手工编辑更容易出错。

期望行为

在“数字员工档案 / Bot Defaults”页面中,为每个在线 bot 增加一个简洁的“CLI / 模型”配置区:

  • 能展示当前 CLI 选择和已配置模型。
  • 复用现有 /api/cli-options 作为 CLI 选项单一事实源。
  • 支持 ttadk-x-codex 这类 wrapper 选择 key。
  • 保存时同时写入 cliId、wrapperCli 和 model,避免不一致状态。
  • 配置只影响后续新会话,不直接修改正在运行的会话。

验收标准

  • /api/bots 返回 UI 所需的当前 model / wrapper 元数据。
  • Dashboard 支持对指定 bot 发起 agent 更新,并代理到对应 daemon。
  • daemon 原子持久化 cliId、wrapperCli、model,并同步内存配置供后续新会话使用。
  • UI 明确提示运行中会话需要 /restart 后才会使用新的 CLI / model。
  • 覆盖 payload、前端渲染、IPC 持久化相关单元测试。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions