Skip to content

feat(subagent): display model name next to task titles in subagent view - #561

Open
cinvymoe wants to merge 21 commits into
omdsh-dev:mainfrom
cinvymoe:feat/show-subagent-task-model-name
Open

feat(subagent): display model name next to task titles in subagent view#561
cinvymoe wants to merge 21 commits into
omdsh-dev:mainfrom
cinvymoe:feat/show-subagent-task-model-name

Conversation

@cinvymoe

@cinvymoe cinvymoe commented Sep 5, 2026

Copy link
Copy Markdown

Summary

在任务管理(SubagentView)显示界面的每一个执行任务标题后面,新增显示当前执行的模型名称徽章。

Changes

  1. 服务端多级模型提取 (src/subagent-live-route.ts):
    • 扩展 subagents.live 返回值增加 models: Record<string, string>
    • 实现 resolveSessionModel:依次从 Live Agent options、Live Session requestHeader/requestContext、Session snapshotEvents、以及持久化 sessionPersistence.inspect 提取模型信息
  2. 客户端接口与数据流 (src/client/api.ts, src/client/SubagentView.tsx):
    • 扩展 SubagentLiveResult 类型声明包含 models?: Record<string, string>
    • useSubagentLive 维护 live models 并在节点中消费
    • 增加客户端兜底解析函数 resolveSessionModel
  3. UI 视图与样式规范 (src/client/SubagentView.tsx, src/client/SubagentView.module.css):
    • 主代理节点、子代理树节点、后台任务行标题后均展示胶囊模型徽章(.subagentModelBadge
    • 符合皮肤契约(使用 --dsw-alias-hairline--dsw-font-xxxs-11--dsw-alias-label-tertiary 令牌)
  4. 单测覆盖:
    • 补充完善 tests/subagent-live-route.spec.tstests/subagent-live-polling.spec.tsxtests/subagent-jobs-view.spec.tsx

File routes (fs.tree/fs.read/fs.write, media, HTML preview, upload) accept
extra roots beyond the session cwd. Default: ~/.dsh/external when it exists;
explicit [] disables; '~' expands; non-absolute entries fail loudly. The
symlink-escape guard and the 403 contract are unchanged; fs.search stays
workspace-only.
Clicking an edit-tool file link in the chat probes the file's OWN repository
(new git.status-at route, fenced by extraRoots) and opens the worktree diff
tab when the file has pending changes; non-repo files and unchanged files
fall back to the editor. git.diff accepts external repoRoots inside the
fence instead of silently retargeting the session repo. The editOpensDiff
preference (default on) has a settings-page switch in 24 locales.
Edit/write file links from the chat now land in one fixed chat-preview tab:
same-type editor opens patch title/path in place, diff or type switches
rebuild under the same id, floated previews are patched or re-docked. The
reducer path bypasses openTab's per-path dedupe so persistent editor tabs
never capture the preview seed. Explorer and editor-menu opens keep
one-tab-per-file behavior.
detectNewDirectSubagent fired only on the 0-to-1 transition, so sessions
that ever had a subagent never auto-opened again. It now diffs direct
subagent ids per snapshot (same new-id semantics as detectNewJob); the
debounce window merges concurrent triggers instead of dropping them.
# Conflicts:
#	src/index.ts
# Conflicts:
#	src/fs-operations.ts
#	src/path-security.ts
#	tests/plugin-shape.spec.ts
#	tests/prefs.spec.ts
# Conflicts:
#	src/client/api.ts
#	src/client/builtins/tabs.tsx
# Conflicts:
#	src/client/TerminalView.tsx
#	src/client/intercept.tsx
#	tests/openpath-intercept.spec.ts
# Conflicts:
#	tests/bundle-route.spec.ts
# Conflicts:
#	package.json
#	src/client/Sidebar.tsx
#	src/client/subagent-detect.ts
- Diff view: default expand single-file diffs and all files in DiffTab (with wider code/config file extension matching)
- Subagent navigation: directly jump to corresponding child subagent session when clicking subagent tool rows in chat
- Read tool clicks (or file links in read rows) always open as plain file in editor, never probing or showing git diff
- Automatically jump and scroll to the read line/offset in the editor when available
- Preserve git diff preview for actual edit/write tool links via editOpensDiff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant