fix(agent-browser): restore bounded presentation lifecycle
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { accessSync, constants } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import type { AgentBrowserModule } from '../agent-browser';
|
||||
import type { AgentBrowserSnapshot } from '../../shared/agent-browser';
|
||||
import { CodingAttachmentStore } from '../coding-projects/attachment-store';
|
||||
import { createCodingConversationStore } from '../coding-projects/conversation-store';
|
||||
import { CodingProjectService } from '../coding-projects/project-service';
|
||||
@@ -102,6 +103,8 @@ export interface CreateCodingCompositionOptions {
|
||||
accountCache?: AccountPluginCache;
|
||||
clientVersion?: string;
|
||||
policyClient?: PluginPolicyClient;
|
||||
requestAgentBrowserPresentation?(snapshot: AgentBrowserSnapshot): void;
|
||||
publishAgentBrowserState?(snapshot: AgentBrowserSnapshot): void;
|
||||
}
|
||||
|
||||
type PiWorkerExecutableProbe = (candidate: string) => boolean;
|
||||
@@ -241,6 +244,8 @@ export function createCodingComposition(
|
||||
bundledSkillsDir: options.paths.bundledSkillsDir,
|
||||
modelToolRegistry,
|
||||
devicePackageTools,
|
||||
requestAgentBrowserPresentation: options.requestAgentBrowserPresentation,
|
||||
publishAgentBrowserState: options.publishAgentBrowserState,
|
||||
pluginSkillSources,
|
||||
getPluginSkillSources: async () => effectiveResolver
|
||||
? (await effectiveResolver.getSkillSources()).map((source) => ({
|
||||
@@ -543,6 +548,9 @@ export function createCodingComposition(
|
||||
runtime.dispose(conversationId, reason)
|
||||
)));
|
||||
if (reason === 'background_sleep' && runtime.hasActiveWork()) return;
|
||||
if (reason === 'background_sleep') {
|
||||
await options.browser.close().catch(() => undefined);
|
||||
}
|
||||
await agentServer.stop();
|
||||
},
|
||||
async shutdown() {
|
||||
|
||||
Reference in New Issue
Block a user