fix(browser): reload session state when another process switched the tab
api and worker processes each keep adapter state in memory. After the upstream reaped an idle tab and the api process reopened one, the agent worker kept pointing at the lost tab and every screenshot / snapshot in solve_challenge failed with not_found (REAL-2 task 4). loaded() now restores from the database when its current tab differs. Needs image rebuild. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
be216fbe65
commit
e53d05a872
2 files changed
+21
-2
No files matched your search
@@ -529,7 +529,10 @@ export class BrowserService {
|
||||
throw new BrowserServiceError("precondition", "站点已停用,浏览器会话已关闭");
|
||||
}
|
||||
const provider = this.providerFor(prow);
|
||||
if (!provider.sessionInfo(row.id)) {
|
||||
// api / worker 各有一份适配器内存状态:另一个进程换了当前标签页(回收后重开)时,按数据库重新载入
|
||||
const info = provider.sessionInfo(row.id);
|
||||
const dbTab = (obj(row.recovery_state) as RecoveryState).currentTabId ?? null;
|
||||
if (!info || (dbTab !== null && info.currentTabId !== dbTab)) {
|
||||
const tabs = await this.tabRows(row.id);
|
||||
provider.restoreSession({
|
||||
session: toSession(row),
|
||||
|
||||
Reference in new issue
Block a user