fix(session): cancel background agents

This commit is contained in:
Shoubhit Dash
2026-05-12 20:51:31 +05:30
parent 0e214c1a0c
commit ec87f26085
4 changed files with 64 additions and 2 deletions
@@ -7,6 +7,7 @@ import path from "path"
import { fileURLToPath, pathToFileURL } from "url"
import { NamedError } from "@opencode-ai/core/util/error"
import { Agent as AgentSvc } from "../../src/agent/agent"
import { BackgroundJob } from "@/background/job"
import { Bus } from "../../src/bus"
import { Command } from "../../src/command"
import { Config } from "@/config/config"
@@ -175,6 +176,7 @@ function makeHttp() {
lsp,
mcp,
AppFileSystem.defaultLayer,
BackgroundJob.defaultLayer,
status,
SyncEvent.defaultLayer,
).pipe(Layer.provideMerge(infra))
@@ -30,6 +30,7 @@ import { TestLLMServer } from "../lib/llm-server"
// Same layer setup as prompt-effect.test.ts
import { NodeFileSystem } from "@effect/platform-node"
import { Agent as AgentSvc } from "../../src/agent/agent"
import { BackgroundJob } from "@/background/job"
import { Git } from "../../src/git"
import { Bus } from "../../src/bus"
import { Command } from "../../src/command"
@@ -124,6 +125,7 @@ function makeHttp() {
lsp,
mcp,
AppFileSystem.defaultLayer,
BackgroundJob.defaultLayer,
status,
SyncEvent.defaultLayer,
).pipe(Layer.provideMerge(infra))