mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +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);
|
||||
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 openclaw = ctx.forProfile("openclaw");
|
||||
|
||||
@@ -516,6 +521,11 @@ describe("browser server-context tab selection state", () => {
|
||||
|
||||
global.fetch = withFetchPreconnect(fetchMock);
|
||||
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 openclaw = ctx.forProfile("openclaw");
|
||||
|
||||
@@ -699,6 +709,11 @@ describe("browser server-context tab selection state", () => {
|
||||
|
||||
global.fetch = withFetchPreconnect(fetchMock);
|
||||
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 openclaw = ctx.forProfile("openclaw");
|
||||
|
||||
|
||||
@@ -139,7 +139,13 @@ function createProfileContext(
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user