Skip to content

The open source AI video agent: turns any coding agent into a video agent, with an editor to change anything it makes.

Desktop: asking an agent how it signs in stops everything it started (#246)

riverisbuilding9c0ca73a3e00
diff --git a/.changeset/sign-in-probe-tree.md b/.changeset/sign-in-probe-tree.md
new file mode 100644
index 0000000..ad68bb8
--- /dev/null
+++ b/.changeset/sign-in-probe-tree.md
@@ -0,0 +1,5 @@
+---
+"@openfilm/desktop": patch
+---
+
+Asking an agent how it signs in stops everything it started afterwards, as closing a chat does: on Windows, an agent behind `cmd.exe` was left running.
diff --git a/apps/desktop/src/agents.mjs b/apps/desktop/src/agents.mjs
index 7c10a08..bb7d838 100644
--- a/apps/desktop/src/agents.mjs
+++ b/apps/desktop/src/agents.mjs
@@ -535,7 +535,7 @@ export async function agentSignInMethods(id) {
const cli = resolveAgentCli(id, { pathDirs: shell.PATH.split(PATH_SEP) });
if (!cli) return [];
const launch = adapterLaunch(id, cli.path);
- const child = spawn(launch.cmd, launch.args, { env: childEnvironment({ shell, extra: launch.env }), stdio: ['pipe', 'pipe', 'ignore'], windowsHide: true });
+ const child = spawn(launch.cmd, launch.args, { ...OWN_GROUP, env: childEnvironment({ shell, extra: launch.env }), stdio: ['pipe', 'pipe', 'ignore'], windowsHide: true });
child.once('error', () => {});
try {
const conn = acp.client({ name: 'openfilm-desktop' }).connect(acp.ndJsonStream(Writable.toWeb(child.stdin), Readable.toWeb(child.stdout)));
@@ -550,7 +550,7 @@ export async function agentSignInMethods(id) {
} catch {
return [];
} finally {
- child.kill();
+ stopTree(child);
}
}