Repository navigation
Replies: 1 comment
|
Re-checked on the current release — still present on dsh The guard is unchanged (now
One number moved: a fresh session on Caveat: I have not re-measured a resume on a fresh |
|
Re-checked on the current release — still present on dsh The guard is unchanged (now
One number moved: a fresh session on Caveat: I have not re-measured a resume on a fresh |
Uh oh!
There was an error while loading. Please reload this page.
Summary
In the
tuiprofile, a freshly created session exposes 27 tools, includingask_user_questionandpresent. Resume that same session (dsh --profile tui --resume <id>, or/resume <id>inside the TUI) and it comes back with 25 — exactly those two gone, for the rest of the session's life. Only a new session gets them again.Repro
dsh --profile tui, start a session — tool list has 27 entries,ask_user_questionandpresentincluded.dsh --profile tui --resume <id>(or/resume <id>from inside).Reproducible on every resume, not intermittently: 20 sessions / 25 resume events on this machine, no exceptions. The session log records it —
request/headerevents carry the model-facing tool list, and a header is only appended when it differs from the previously logged one, so the 25s are the real composed set, not a logging artefact.Root cause
@tomowang/dsh-tui'sattachSession()(lib/index.js, ~lines 803-830) resolves the preset only on the fresh-session branch:So a resumed agent is booted with a
setupthat installs the model selection and never joins a preset.AgentPresets.mount()is what binds the agent's scope to the standing composition (bindScopeParent(agentKey, standing.key)), and the only other join path iscomposeFrom(), which exists for child agents joining a parent.@deepseek-ai/dsh-agent-presetsdetects and warns about exactly this state from its ownagent/createdlistener:The comment directly above the guard says the resumed session's preset is "whatever its persisted header (or a later
agent-preset/selectedevent) already recorded" — but nothing on this path reads that projection and mounts it. The data is available and built for reconstruction: theagentPresetprojection isinit: (header) => header.agentPreset ?? null, documented as "Reconstruction reads theagentPresetSession projection, never the header".Why only those two tools look broken
dsh-basehost-mounts its own copies of nearly every model-facing row, so the global layer still yields 25 tools and the resumed session looks almost normal. Comparing row sets, only three rows exist inpresets/standard/agent.cordis.ymland nowhere indsh-base:@deepseek-ai/dsh-persona@deepseek-ai/dsh-tool-ask-user→ask_user_question@deepseek-ai/dsh-tool-present→presentThe persona row has a near-identical host-side counterpart in the TUI bundle, which masks it. A user-authored preset would presumably lose every preset-only row on resume — tools, prompt sections and skill catalog — with no error and no notice.
Compare
@deepseek-ai/dsh-api-session-controller'scomposeAgent(), documented as "Resolve the preset id and pre-publication Agent setup for a create or resume", always resolves and always mounts:@deepseek-ai/dsh-webhooklikewise.dsh-tuiis the onlymount()caller that branches on resume — and the only one that loses the rows.Suggested fix
Join the persisted preset on resume. Ideally in the agent resume path (read the
agentPresetprojection), so no caller can forget it. Minimal TUI-side alternative: resolve the persisted preset forresumeIdbeforeagents.resumeand setresolvedPresetfrom it so the existingsetupmounts it.Environment
0.1.5-rc.3@tomowang/dsh-tui0.8.1@earendil-works/pi-tui0.84.4tuiprofile (bundles:@deepseek-ai/dsh-base,@tomowang/dsh-tui, plus local plugins)standardAll reactions