Symptom
In the DSH (DeepSeek Harness) web client, the Browser Skill sidebar tab throws on first open, every time. Host (dsh-better-sidebar) catches it in its error boundary and shows a "Retry" button; clicking Retry renders fine.
TypeError: Cannot read properties of undefined (reading 'kind')
at leafNodes (@wxg-prc-cpg/browser-skill-dsh-plugin/lib/client.cjs)
at observationTabOpen (…)
at evaluate (…)
at publish (…)
Root cause (file + line)
lib/client.cjs — leafNodes() (~L4462) and observationTabOpen() (~L4470):
function* leafNodes(node) {
if (node.kind === "leaf") { // <-- throws when node is undefined
yield node; return;
}
for (const child of node.children) yield* leafNodes(child);
}
function observationTabOpen(state) {
if (state === void 0) return false; // only `state` is guarded
for (const root of [state.splits, state.bottomSplits]) // either can be undefined on the first frames
for (const leaf of leafNodes(root)) …
}
On the first render the host workbench layout state is not populated yet, so state.splits / state.bottomSplits are undefined → node.kind throws. That is why the first open always fails and the manual retry always succeeds.
Suggested fix (one line)
function* leafNodes(node) {
if (node === void 0) return;
if (node.kind === "leaf") { yield node; return; }
for (const child of node.children ?? []) yield* leafNodes(child);
}
(or skip undefined roots inside observationTabOpen).
Environment
@wxg-prc-cpg/browser-skill-dsh-plugin@0.2.1 (latest at the time of writing)
dsh-better-sidebar@0.19.1 (latest)
- DSH 0.1.5-rc.1 · Windows 11 · Node 24
Related observation (same file, likely the same migration)
The tab is still opened with the legacy 0.18-era contract:
service.openTab({ type: OBSERVATION_TAB_TYPE, path: OBSERVATION_TAB_PATH })
Under better-sidebar 0.19 this path appears to be resolved as a file path, producing
cannot resolve target "…/browser-skill-observation": ENOENT on the auto-open path
(manually clicking the tab renders fine). May be worth migrating to the 0.19 tab contract.
Locally we patched leafNodes with an undefined-guard and verified the first-open crash is gone.
Symptom
In the DSH (DeepSeek Harness) web client, the Browser Skill sidebar tab throws on first open, every time. Host (dsh-better-sidebar) catches it in its error boundary and shows a "Retry" button; clicking Retry renders fine.
Root cause (file + line)
lib/client.cjs—leafNodes()(~L4462) andobservationTabOpen()(~L4470):On the first render the host workbench layout state is not populated yet, so
state.splits/state.bottomSplitsareundefined→node.kindthrows. That is why the first open always fails and the manual retry always succeeds.Suggested fix (one line)
(or skip undefined roots inside
observationTabOpen).Environment
@wxg-prc-cpg/browser-skill-dsh-plugin@0.2.1(latest at the time of writing)dsh-better-sidebar@0.19.1(latest)Related observation (same file, likely the same migration)
The tab is still opened with the legacy 0.18-era contract:
Under better-sidebar 0.19 this
pathappears to be resolved as a file path, producingcannot resolve target "…/browser-skill-observation": ENOENTon the auto-open path(manually clicking the tab renders fine). May be worth migrating to the 0.19 tab contract.
Locally we patched
leafNodeswith an undefined-guard and verified the first-open crash is gone.