mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
fix(extension): claim agent tabs explicitly
This commit is contained in:
@@ -302,7 +302,7 @@ describe("handleSessionStop window release (issue #57)", () => {
|
||||
ctx.agentCreatedTabs.add(11);
|
||||
ctx.agentCreatedTabs.add(12);
|
||||
// home tab id from ensureActiveTab override
|
||||
ctx.homeTabId = 10;
|
||||
ctx.agentCreatedTabs.add(10); // home tab
|
||||
// user tab 99 (created via Chrome UI, NOT in agentCreatedTabs)
|
||||
const state: FakeState = {
|
||||
tabs: new Map([
|
||||
@@ -340,7 +340,7 @@ describe("handleSessionStop window release (issue #57)", () => {
|
||||
const sm = new SessionManager({ agentWindow: aw });
|
||||
const ctx = await sm.start("aa11");
|
||||
ctx.agentCreatedTabs.add(11);
|
||||
ctx.homeTabId = 10;
|
||||
ctx.agentCreatedTabs.add(10); // home tab
|
||||
const state: FakeState = {
|
||||
tabs: new Map([
|
||||
[10, { id: 10, windowId: agentWindowId } as chrome.tabs.Tab],
|
||||
@@ -369,7 +369,7 @@ describe("handleSessionStop window release (issue #57)", () => {
|
||||
const sm = new SessionManager({ agentWindow: aw });
|
||||
const ctx = await sm.start("aa11");
|
||||
ctx.agentCreatedTabs.add(11); // no longer in state → remove throws
|
||||
ctx.homeTabId = 10;
|
||||
ctx.agentCreatedTabs.add(10); // home tab
|
||||
const state: FakeState = {
|
||||
tabs: new Map([[10, { id: 10, windowId: agentWindowId } as chrome.tabs.Tab]]),
|
||||
windowsClosed: new Set(),
|
||||
@@ -399,7 +399,7 @@ describe("handleSessionStop window release (issue #57)", () => {
|
||||
const sm = new SessionManager({ agentWindow: aw });
|
||||
const ctx = await sm.start("aa11");
|
||||
ctx.agentCreatedTabs.add(11);
|
||||
ctx.homeTabId = 10;
|
||||
ctx.agentCreatedTabs.add(10); // home tab
|
||||
const state: FakeState = {
|
||||
tabs: new Map([
|
||||
[10, { id: 10, windowId: agentWindowId } as chrome.tabs.Tab],
|
||||
@@ -427,7 +427,7 @@ describe("handleSessionStop window release (issue #57)", () => {
|
||||
const sm = new SessionManager({ agentWindow: aw });
|
||||
const ctx = await sm.start("aa11");
|
||||
ctx.agentCreatedTabs.add(11);
|
||||
ctx.homeTabId = 10;
|
||||
ctx.agentCreatedTabs.add(10); // home tab
|
||||
const state: FakeState = {
|
||||
tabs: new Map([[11, { id: 11, windowId: agentWindowId } as chrome.tabs.Tab]]),
|
||||
windowsClosed: new Set(),
|
||||
@@ -473,7 +473,7 @@ describe("handleSessionStop window release (issue #57)", () => {
|
||||
const sm = new SessionManager({ agentWindow: aw });
|
||||
const ctx = await sm.start("aa11");
|
||||
ctx.agentCreatedTabs.add(11); // Step 4 remove() will throw for this tab
|
||||
ctx.homeTabId = 10;
|
||||
ctx.agentCreatedTabs.add(10); // home tab
|
||||
const state: FakeState = {
|
||||
tabs: new Map([
|
||||
[10, { id: 10, windowId: agentWindowId } as chrome.tabs.Tab],
|
||||
|
||||
Reference in New Issue
Block a user