mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 07:52:44 +00:00
fix(browser): require managed runtime ownership for tab cap cleanup
This commit is contained in:
committed by
Peter Steinberger
parent
9b938f2bf6
commit
22ec577d80
@@ -476,6 +476,11 @@ describe("browser server-context tab selection state", () => {
|
|||||||
|
|
||||||
global.fetch = withFetchPreconnect(fetchMock);
|
global.fetch = withFetchPreconnect(fetchMock);
|
||||||
const state = makeState("openclaw");
|
const state = makeState("openclaw");
|
||||||
|
(state.profiles as Map<string, unknown>).set("openclaw", {
|
||||||
|
profile: { name: "openclaw" },
|
||||||
|
running: { pid: 1234, proc: { on: vi.fn() } },
|
||||||
|
lastTargetId: null,
|
||||||
|
});
|
||||||
const ctx = createBrowserRouteContext({ getState: () => state });
|
const ctx = createBrowserRouteContext({ getState: () => state });
|
||||||
const openclaw = ctx.forProfile("openclaw");
|
const openclaw = ctx.forProfile("openclaw");
|
||||||
|
|
||||||
@@ -516,6 +521,11 @@ describe("browser server-context tab selection state", () => {
|
|||||||
|
|
||||||
global.fetch = withFetchPreconnect(fetchMock);
|
global.fetch = withFetchPreconnect(fetchMock);
|
||||||
const state = makeState("openclaw");
|
const state = makeState("openclaw");
|
||||||
|
(state.profiles as Map<string, unknown>).set("openclaw", {
|
||||||
|
profile: { name: "openclaw" },
|
||||||
|
running: { pid: 1234, proc: { on: vi.fn() } },
|
||||||
|
lastTargetId: null,
|
||||||
|
});
|
||||||
const ctx = createBrowserRouteContext({ getState: () => state });
|
const ctx = createBrowserRouteContext({ getState: () => state });
|
||||||
const openclaw = ctx.forProfile("openclaw");
|
const openclaw = ctx.forProfile("openclaw");
|
||||||
|
|
||||||
@@ -699,6 +709,11 @@ describe("browser server-context tab selection state", () => {
|
|||||||
|
|
||||||
global.fetch = withFetchPreconnect(fetchMock);
|
global.fetch = withFetchPreconnect(fetchMock);
|
||||||
const state = makeState("openclaw");
|
const state = makeState("openclaw");
|
||||||
|
(state.profiles as Map<string, unknown>).set("openclaw", {
|
||||||
|
profile: { name: "openclaw" },
|
||||||
|
running: { pid: 1234, proc: { on: vi.fn() } },
|
||||||
|
lastTargetId: null,
|
||||||
|
});
|
||||||
const ctx = createBrowserRouteContext({ getState: () => state });
|
const ctx = createBrowserRouteContext({ getState: () => state });
|
||||||
const openclaw = ctx.forProfile("openclaw");
|
const openclaw = ctx.forProfile("openclaw");
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,13 @@ function createProfileContext(
|
|||||||
};
|
};
|
||||||
|
|
||||||
const enforceManagedTabLimit = async (keepTargetId: string): Promise<void> => {
|
const enforceManagedTabLimit = async (keepTargetId: string): Promise<void> => {
|
||||||
if (profile.driver !== "openclaw" || !profile.cdpIsLoopback || state().resolved.attachOnly) {
|
const profileState = getProfileState();
|
||||||
|
if (
|
||||||
|
profile.driver !== "openclaw" ||
|
||||||
|
!profile.cdpIsLoopback ||
|
||||||
|
state().resolved.attachOnly ||
|
||||||
|
!profileState.running
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user