Skip to content

Feat/chat sidebar only enabled experts - #517

Closed
chujieHong wants to merge 8 commits into
TencentCloud:mainfrom
chujieHong:feat/chat-sidebar-only-enabled-experts
Closed

Feat/chat sidebar only enabled experts#517
chujieHong wants to merge 8 commits into
TencentCloud:mainfrom
chujieHong:feat/chat-sidebar-only-enabled-experts

Conversation

@chujieHong

Copy link
Copy Markdown
Contributor

Summary

问题
对话页左侧 sidebar 和 minimal布局下的左侧记录面板,会列出 GET /api/agents 返回的所有专家,无视 runtime state。一旦用户在某个焦点专家页打开对话后通过 /experts 或别的入口停掉了它,专家仍然残留在 sidebar 里——但它的 harness runtime已经被卸载。

修复
selectEnabledExperts(在 AgentContext)把 agents 列表收窄到 state === "running" 的项。pinActive 是 opt-in(默认关闭),所以停掉焦点专家会让它立刻从导航里消失。主聊天面板在同一个 URL 上仍然渲染 AgentNotReadyScreen,给用户提供清晰的「回到 /experts 重新启用」路径。
projectChatAgentOption 把 OctopAgent 投影成 composer用的轻量 ChatAgentOption,替换掉 Chat/index.tsx 里重复的内联 map。
@ 按钮弹窗(ExpertPickerPopover)和 @ mention 菜单(MentionPickerMenu)现在只列出 running 专家——之前选一个已停的会 dispatch 进一个未加载的 harness 然后静默失败。
availableAgents 保留为完整列表——这样 ChatInputPreviewBar 和 composerLookups.agents 在专家停掉后还能渲染历史/当前选中的 expert chip。

改动文件
dashboard/src/context/AgentContext.tsx —— helpers
dashboard/src/context/AgentContext.test.ts —— 单测- dashboard/src/pages/Chat/index.tsx
dashboard/src/pages/Chat/components/ChatInput.tsx
dashboard/src/pages/Chat/hooks/useSlashMentionInput.ts ⚠️ breaking:参数从 availableAgents 重命名为 availableExperts
dashboard/src/layouts/MinimalRecordsHost.tsx

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore
  • Release / hotfix

Test plan

  • make all passes locally
  • Added/updated tests

Checklist

  • Updated CHANGELOG.md (if user-facing)
  • README / docs updated (if needed)

github-actions Bot and others added 8 commits August 31, 2026 03:12
…lop-after-manual

chore: sync develop onto main after manual
- api: answer a missing /assets/<hash>.js with 404 instead of the SPA
  shell, so the browser no longer rejects index.html as a module script
  ("not a valid JavaScript MIME type") and hides a stale shell left
  behind by an upgrade.
- dashboard: extend the stale-chunk reload regex to also match MIME
  rejection errors surfaced by WebKit / Chrome / Firefox.
- desktop: split the macOS icon onto an 824/1024 canvas (icons.icns) and
  add applyAppIcon / applyTrayIcon so the Dock glyph is not oversized.
- agents: hand harness an absolute workspace_dir on Windows, where the
  agent-facing /.octop/workspaces/<id> form has no drive letter.
…rd-stale-asset-and-desktop-icons

fix: serve 404 for stale hashed assets and harden desktop shell
Configure MacWindow.InvisibleTitleBarHeight (32px) on the frameless desktop
window so macOS keeps a draggable region beneath the custom title bar.
Only affects the macOS build; other platforms are unchanged.
… rolling latest

- scripts/build-fpk.sh: emit Octop-fnos-docker-<ver>.fpk / Octop-fnos-native-<ver>.fpk (variant in the name, not a bare -native suffix).
- fnos-build-fpk.yml: FPK_NAME_PREFIX is now Octop-fnos; stop passing FPK_ITER; the release tag is fnos-<ver> (no -NN iteration, no -vanilla) and the rolling fnos-vanilla-latest release is no longer produced.
- fnos/README.md: document the new versioned artifact names.
…r clicks

The dashboard is loaded from a remote origin, so Wails never injects
runtime.js. Arm wails:drag ourselves, put window controls on the right, and
drop InvisibleTitleBarHeight. Expert profile skill/subagent cards now show
the icon beside the title, with status or slug on the same row.

Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(desktop): restore only the main window on macOS dock click

Wails shows every hidden window on ApplicationShouldHandleReopen, which
also popped the tray settings overlay. Cancel that default and restore
the main window only.


* fix(desktop): polish splash, tray settings, and health-wait copy

Show window controls on the splash and settings shell, open the
macOS menu-bar popover on left click, and replace /api/health
English errors with locale-aware status text.


* fix(desktop): show only close on the settings popover

Minimise and maximise do not apply to the tray settings window.
Close hides that overlay instead of sending the main window to the tray.


---------
The chat page left sidebar and the minimal-layout records pane both used
to list every expert returned by GET /api/agents regardless of runtime
state. Once a user opened a chat with a focused expert and then stopped
it (via /experts or any other path), the expert would linger in the
sidebar even though its harness was unloaded.

- selectEnabledExperts (in AgentContext) narrows an agents list down to
  running experts. pinActive is opt-in (off by default) so stopping the
  focused expert makes it disappear from the nav immediately. The main
  chat panel still renders AgentNotReadyScreen on the same URL, so the
  user gets a clear path back to /experts to re-enable the expert.
- projectChatAgentOption projects OctopAgent into the lightweight
  ChatAgentOption shape used by the composer, replacing a duplicated
  inline map in Chat/index.tsx.
- The @ button popover (ExpertPickerPopover) and the @ mention menu
  (MentionPickerMenu) now only list running experts. Picking a stopped
  one would dispatch into an unloaded harness and silently fail.
- availableAgents stays as the full list so ChatInputPreviewBar and
  composerLookups.agents keep rendering historical and currently
  selected expert chips even after the underlying expert is stopped.

Files:
- dashboard/src/context/AgentContext.tsx (helpers)
- dashboard/src/context/AgentContext.test.ts (unit tests)
- dashboard/src/pages/Chat/index.tsx
- dashboard/src/pages/Chat/components/ChatInput.tsx
- dashboard/src/pages/Chat/hooks/useSlashMentionInput.ts
- dashboard/src/layouts/MinimalRecordsHost.tsx

Verification:
- npx tsc --noEmit -> exit 0
- npm run lint -> 0 errors
@chujieHong chujieHong closed this Sep 1, 2026
@chujieHong
chujieHong deleted the feat/chat-sidebar-only-enabled-experts branch September 1, 2026 08:56
@chujieHong
chujieHong restored the feat/chat-sidebar-only-enabled-experts branch September 1, 2026 09:14
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.

3 participants