You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] session/create with only cwd (no workspaceId) does not attach the session to the owning workspace
#6446
Creating a session through session/create with a cwd but withoutworkspaceId produces a session in the correct folder, but the session is not added to the workspace that owns that path. The session stays «ungrouped» and is invisible in the workspace panel.
Root cause (verified in source):
workspace is resolved only when request.workspaceId is present (lines 569–573); there is no path → workspace lookup for a bare cwd.
workspace.attachSession(sessionId) runs only inside if (workspace !== undefined) (lines 581–588).
As a result, a cwd-only create sets the correct cwd (line 574: workspace?.path ?? request.cwd ?? this.defaultCwd) but never registers the session in the workspace's sessionIds.
Steps to reproduce
Call session/create with { request: { cwd: "<path of an existing workspace>" } } (no workspaceId).
Observe: the session is created and its cwd is correct.
Inspect workspace.json → tables.workspaces[<id>].sessionIds: the new session id is absent, and the session shows as «ungrouped» in the workspace panel.
Expected vs Actual behavior
Expected
Actual
Session created under a path owned by a workspace
Automatically accounted in that workspace's sessionIds (visible in the workspace panel)
Not attached — session stays «ungrouped», invisible in the workspace panel
Impact
Any API/headless flow that creates a session by cwd alone (e.g. automation, external tooling, migrations) silently orphans the session — it is not listed under any workspace. Recovery today is a second «adoption» session/create call with the same sessionId plus workspaceId.
Suggested fix
Resolve the owning workspace from cwd (path → workspace lookup) and call attachSession even when only cwd is provided; or
Expose a public workspace/attachSession remote method so callers can attach a session created by cwd.
[Баг] session/create только с cwd (без workspaceId) не привязывает сессию к воркспейсу-владельцу пути
EN: [Bug] session/create with only cwd (no workspaceId) does not attach the session to the owning workspace
Окружение
Параметр
Значение
Продукт
DSH (превью) — DeepSeek Harness, @deepseek-ai/dsh
Версия
0.1.2-rc.1 (через npx)
ОС
Windows, PowerShell 7 + Node.js
Где проявилось
сессия, созданная автоматизацией/headless-потоком; тот же класс, что партия «ungrouped» сессий
Исходник
@deepseek-ai/dsh-api-session-controller/lib/index.js, метод SessionCommandController.create (строки 566–594)
Краткое описание
Создание сессии через session/create с cwd, но безworkspaceId даёт сессию в правильной папке, но она не добавляется в воркспейс-владелец этого пути. Сессия остаётся «ungrouped» и не видна в панели ВС.
Причина (проверено по исходникам):
workspace резолвится только при наличии request.workspaceId (строки 569–573); поиска «путь → воркспейс» для голого cwd нет.
workspace.attachSession(sessionId) вызывается только внутри if (workspace !== undefined) (строки 581–588).
Итог: при создании только по cwd ставится верный cwd (строка 574: workspace?.path ?? request.cwd ?? this.defaultCwd), но сессия не регистрируется в sessionIds воркспейса.
Проверить workspace.json → tables.workspaces[<id>].sessionIds: нового id сессии там нет, в панели ВС сессия показывается как «ungrouped».
Ожидаемое vs фактическое поведение
Ожидается
Фактически
Сессия создаётся по пути, которым владеет воркспейс
Автоматически учитывается в sessionIds этого воркспейса (видна в панели ВС)
Не привязывается — сессия остаётся «ungrouped», невидима в панели ВС
Влияние
Любой API/headless-поток, создающий сессию только по cwd (автоматизация, внешние инструменты, миграции), молча «теряет» сессию — она не числится ни в одном воркспейсе. Восстановление сейчас — повторный «усыновляющий» вызов session/create с тем же sessionId плюс workspaceId.
Предложение по исправлению
Резолвить воркспейс-владелец из cwd (поиск «путь → воркспейс») и вызывать attachSession даже при передаче только cwd; либо
Выставить публичный метод workspace/attachSession, чтобы вызывающий мог привязать сессию, созданную по cwd.
Anonymized for public reporting: workspace names, paths, session names/ids and dates have been genericized.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
RU: [Баг]
session/createтолько сcwd(безworkspaceId) не привязывает сессию к воркспейсу-владельцу путиEnvironment
@deepseek-ai/dsh0.1.2-rc.1(resolved vianpx)@deepseek-ai/dsh-api-session-controller/lib/index.js,SessionCommandController.create(lines 566–594)Summary
Creating a session through
session/createwith acwdbut withoutworkspaceIdproduces a session in the correct folder, but the session is not added to the workspace that owns that path. The session stays «ungrouped» and is invisible in the workspace panel.Root cause (verified in source):
workspaceis resolved only whenrequest.workspaceIdis present (lines 569–573); there is no path → workspace lookup for a barecwd.workspace.attachSession(sessionId)runs only insideif (workspace !== undefined)(lines 581–588).cwd-only create sets the correctcwd(line 574:workspace?.path ?? request.cwd ?? this.defaultCwd) but never registers the session in the workspace'ssessionIds.Steps to reproduce
session/createwith{ request: { cwd: "<path of an existing workspace>" } }(noworkspaceId).cwdis correct.workspace.json→tables.workspaces[<id>].sessionIds: the new session id is absent, and the session shows as «ungrouped» in the workspace panel.Expected vs Actual behavior
sessionIds(visible in the workspace panel)Impact
Any API/headless flow that creates a session by
cwdalone (e.g. automation, external tooling, migrations) silently orphans the session — it is not listed under any workspace. Recovery today is a second «adoption»session/createcall with the samesessionIdplusworkspaceId.Suggested fix
cwd(path → workspace lookup) and callattachSessioneven when onlycwdis provided; orworkspace/attachSessionremote method so callers can attach a session created bycwd.[Баг]
session/createтолько сcwd(безworkspaceId) не привязывает сессию к воркспейсу-владельцу путиEN: [Bug]
session/createwith onlycwd(noworkspaceId) does not attach the session to the owning workspaceОкружение
@deepseek-ai/dsh0.1.2-rc.1(черезnpx)@deepseek-ai/dsh-api-session-controller/lib/index.js, методSessionCommandController.create(строки 566–594)Краткое описание
Создание сессии через
session/createсcwd, но безworkspaceIdдаёт сессию в правильной папке, но она не добавляется в воркспейс-владелец этого пути. Сессия остаётся «ungrouped» и не видна в панели ВС.Причина (проверено по исходникам):
workspaceрезолвится только при наличииrequest.workspaceId(строки 569–573); поиска «путь → воркспейс» для гологоcwdнет.workspace.attachSession(sessionId)вызывается только внутриif (workspace !== undefined)(строки 581–588).cwdставится верныйcwd(строка 574:workspace?.path ?? request.cwd ?? this.defaultCwd), но сессия не регистрируется вsessionIdsворкспейса.Шаги воспроизведения
session/createс{ request: { cwd: "<путь существующего воркспейса>" } }(безworkspaceId).cwdверен.workspace.json→tables.workspaces[<id>].sessionIds: нового id сессии там нет, в панели ВС сессия показывается как «ungrouped».Ожидаемое vs фактическое поведение
sessionIdsэтого воркспейса (видна в панели ВС)Влияние
Любой API/headless-поток, создающий сессию только по
cwd(автоматизация, внешние инструменты, миграции), молча «теряет» сессию — она не числится ни в одном воркспейсе. Восстановление сейчас — повторный «усыновляющий» вызовsession/createс тем жеsessionIdплюсworkspaceId.Предложение по исправлению
cwd(поиск «путь → воркспейс») и вызыватьattachSessionдаже при передаче толькоcwd; либоworkspace/attachSession, чтобы вызывающий мог привязать сессию, созданную поcwd.All reactions