Repository navigation
Read every chat with the pinned DSH before the first-run copy - #340
Conversation
…copy A newer DSH can write records that the pinned one must refuse while the session format stays the same, so the file-name check lets such a team through, and a Bot whose current part is one of those chats cannot work in the app. The app now copies the team's chats into a throwaway DSH home and opens each one read-only in a DSH without ds-bot, through sessionPersistence. A SessionFormatUnsupportedError stops the copy with the existing "update DeepSeek Bot first" dialog; Quit asks again at the next start. A damaged log does not stop it, since the user's DSH cannot read it either, and a check that cannot run leaves the copy as before.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b253f40959
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // A copy of the chats in a DSH home of its own, so that nothing of the check stays in the data. | ||
| async function checkTeam(where, newCheck) { | ||
| const home = join(where.dataDir, `.import-check-${String(Date.now())}`) |
There was a problem hiding this comment.
Track the check so quitting removes its session copy
If the user closes the window while copySessions or the check Host is still running, the before-quit handler sees the global host as undefined and permits immediate termination because this check is only stored in a local variable. The finally cleanup therefore never runs, leaving a partial or complete .import-check-* copy of every team chat in the selected data directory. Make the shutdown path wait for the check and its cleanup, as it does for the normal Host.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 43cc6c0: quitting during the check now stops the copy between Sessions or the check's Host, waits until the copy is removed, and the first start does not go on to copy the team. Checked on the packaged Windows app by closing the window 0.3 s after Copy: the app exited 0.7 s later with no .import-check-* folder and no process left.
Closing the window during the check quit at once, since only the Host held the quit back, and left the throwaway copy of the team's chats in the data location. Quitting now stops the copy between Sessions or the check's Host, waits for the copy to be removed, and the first start does not go on to copy the team.
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
rahul05ranjan
left a comment
There was a problem hiding this comment.
The design here is careful and the pieces fit together: reading the sessions through a throwaway copy under the new data location (the import-check profile without ds-bot) keeps the pinned DSH from ever touching the user's DSH home, and unreadableSessions distinguishing SessionFormatUnsupportedError from damaged logs matches the README contract — a newer DSH's record stops the copy, a corrupt one doesn't, since the user's own DSH can't read it either. Resolving checked alongside ready in host-process.mjs is a tidy extension, and checkTeam treating a failed check as "proceed unchecked" rather than a failed start is the right failure mode.
Two thoughts:
checkTeamcopies every team session into.import-check-*inside the data location, and then the real import copies them again — on a large team that doubles first-run I/O. Not a blocker, but it's where a future progress bar or size guard will be needed.- If the final
rmof the throwaway home fails (locked file on Windows, say), a directory with a full copy of the user's sessions stays behind in the data location. A sweep for stale.import-check-*dirs on next start would close that.
Tests cover the pure helpers well; I didn't run the app itself.

Issue
None. This is the read check listed under the desktop app design's known limitations.
What changed / 改了什么
A newer DSH can write records that the pinned DSH must refuse while the session format version stays the same (DSH 0.2.1 added
job/registered,job/settledandworking-directory/changewithin format 4). The first-run check only looked at the format version in the file name, so such a team was copied, and a Bot whose current part was one of those chats could not load its history or send a message in the app.Now, before the copy:
import-check(dsh-baseanddsh-web-app, withoutds-bot), so no Bot runs on them. It opens each chat read-only throughsessionPersistenceand reads it, then removes the copy.SessionFormatUnsupportedErrorstops the copy with the dialog that a newer format already shows: "N chats were written by a newer DeepSeek Harness than this DeepSeek Bot can read. Update DeepSeek Bot, then start it again to copy the team." with Quit and Start without the team. Quit forgets the chosen folders, so the next start asks again.The design note and the app README describe it.
Changelog
Before copying a team from DeepSeek Harness, the desktop app reads each chat once and asks you to update DeepSeek Bot when a newer DeepSeek Harness wrote one.
How I checked it / 怎么验证的
npm testinapp/: 51 pass. New: the classification with a fake store; the real check Host on two chats in format 4, one with a record that DSH does not know (only that one is reported); the copy for the check takes only the team's chats and changes nothing in the user's DSH home.npm test(inds-bot/): not changednode scripts/build-client.mjs --check: not changednpm run lint: not changedChecklist / 检查
src/client/changed →npm run buildran andclient.jsis committed. (not changed)Co-authored-by. / 没有把 AI 工具写成作者或Co-authored-by。