Skip to content

fix(chat): scope workspace changes to their run - #938

Open
rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/chat-isolate-workspace-changes
Open

rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/chat-isolate-workspace-changes

Conversation

@rudycelekli

Copy link
Copy Markdown

What changed

The changes hook intentionally keeps a ready file list visible while refreshing. It also kept that list when changing workspace runs, so a slow request for the next workspace left the previous workspace’s paths and counts visible in the new context. The current run now owns the displayed result. The file-detail panel also remounts on run changes so its per-path cache cannot survive a switch.

Scope

  • Platform chat workspace UI

Compatibility

Refreshes of the same workspace continue to retain the ready view while new data loads. A different workspace starts in the existing loading state.

Validation

  • Added a delayed-response regression that switched between two runs. Main kept the old ready file list. The patch showed a loading state with no old files until the new result arrived.
  • All 9 focused workspace hook and changes panel tests passed. git diff --check passed.
  • Full public browser and platform suites were not run.

Safety

  • I did not include credentials, internal endpoints, production data, or organization-specific infrastructure.
  • I preserved user files and unrelated changes.

@Yanami-2K Yanami-2K left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

核对了 chatbot/src/useWorkspaceChanges.js:state 里加了 runId,只有同一个 run 刷新时才保留已就绪的列表;返回前又按当前 runId 做了一次过滤,这样在 effect 还没跑的那次渲染里也不会露出上一个工作区的文件。ArtifactPanel 给 ChangesPanel 加了 key={workspaceRunId},切换时会重建文件级缓存。新测试用延迟响应断言切换后立即变为 loading 且列表为空,第二个工作区的响应到达后只显示新文件,覆盖了这个问题。它与 #941、#946 都改了改动面板,但改的不是同一段代码。

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.

2 participants