mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
fix(dsh-plugin-browserskill): register observation routes once webServer appears
ctx.get('webServer') at apply time raced the web composition's service
registration (the fallback SPA then answered /bsk-observation/* with
index.html). Ride ctx.inject(['webServer'], …) instead: the callback
runs when the service is provided and never runs in headless
compositions, keeping route registration timing-safe and optional.
This commit is contained in:
@@ -65,6 +65,8 @@ describe("dispose cleanup ownership", () => {
|
||||
const ctx = {
|
||||
tools: { register: (def: ToolDefinition) => tools.set(def.name, def) },
|
||||
get: () => undefined,
|
||||
// No webServer in this harness: the inject callback never runs.
|
||||
inject: () => {},
|
||||
effect: (fn: () => () => Promise<void>) => {
|
||||
disposers.push(fn());
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user