Repository navigation
Replies: 1 comment
|
在 0.2.1-rc.5(macOS,Web profile)上也能复现,但触发途径和上面不同:Web 界面点「新会话」时,会带上一个之前保存的草稿会话 ID; 所以修复时除了真正新建的会话,还要覆盖被复用的草稿会话。 -const freshSession = target.firstLiveSeq === 0 && target.eventAt(SessionSeq(0))?.type !== "session/end-seed";
+const freshSession = target.firstLiveSeq === 0 && target.eventAt(SessionSeq(0))?.type !== "session/end-seed" || target.requestHeader?.() === undefined;另外一个相关的易用性问题:如果在 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What happens
The documented model-selection feature for subagents does not work at all. The
README for
@deepseek-ai/dsh-tool-subagentsays:In practice, no session ever records a policy. As a result, every explicit
child route is rejected, even when it is configured and even when it equals the
parent route:
Environment
@deepseek-ai/dsh0.2.2-alpha.2, commitf3803c9697subagent-model-selection-settingswithenabled: trueand anallowedModelslist, provided through the profile patchRoot cause
packages/subagent/tool-subagent/src/model-selection-settings.ts, in theagent/createdhandler:firstLiveSeqis the offset of the first live event, i.e. the number of seedevents. A fresh session in the real harness always starts with five of them:
So
firstLiveSeqis 5, the condition=== 0is never true, and the policy isnever appended.
Why the existing test does not catch it
tests/model-selection-initialization.spec.tscreates its session throughctx.agents.create({ sessionId })— without the initial events theapplication writes at session start. In that environment
firstLiveSeqis 0,the condition matches, and the test is green. The testkit builds something the
app does not.
Evidence
Four sessions on 0.2.2-alpha.2, two of them with
gemini-apias the parent:none carried a
subagent/model-selection-policyevent. The symptom issymmetric — DeepSeek→Gemini and Gemini→DeepSeek both fail with the same
"without a recorded model-selection policy" message.
Suggested fix
The header already carries the right field:
isSeededisfalsefor a freshsession and
truefor one created from a seed (resume/fork). Theelsebranchis already restricted to non-subagents by the
parentIdcheck above, so:The now-unused
SessionSeqimport goes with it.Verified locally
After the change (built with
pnpm exec tsdownin the package and a fullrestart), fresh sessions record the configured routes, and a subagent on an
allowed route runs; a route outside the list is still rejected — but with the
shorter "is not allowed" message, without the "without a recorded
model-selection policy" suffix.
Regression test needed
A test that creates a session with the initial events (or at least with
isSeeded: falseand a live offset > 0) and asserts that the policy isappended. Without it, the same refactor will silently reintroduce this.
All reactions