mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 01:27:35 +00:00
fix(provider-process): kill a provider group its SIGKILLed supervisor leaves behind (#30997)
* fix(provider-process): kill a provider group its SIGKILLed supervisor leaves behind * fix(provider-process): re-read a provider start in its read second; poll instead of sleeping in tests * fix(provider-process): keep the report channel through the Codex session adapter; re-prove same-second starts * fix(provider-process): never kill a leaderless provider group; list guard files in the CLI project
This commit is contained in:
@@ -13,6 +13,7 @@ import { cancelUnreadResponseBody } from '../lib/unread-response-body'
|
||||
import type { ChildProcessHandle } from '@orca/process-host/process-spec'
|
||||
import { createProviderSpawnSpec } from '../provider-process/provider-process-supervisor'
|
||||
import { stopSupervisedChildProcess } from '../provider-process/supervised-child-process-stop'
|
||||
import { guardSupervisedProviderGroup } from '../provider-process/provider-group-orphan-guard'
|
||||
|
||||
const OPENCODE_PREFLIGHT_KILL_SITE = 'opencode-launch-model-preflight'
|
||||
// A supervisor's pipes are its own, so they close as it exits.
|
||||
@@ -29,7 +30,10 @@ const agent = z.object({
|
||||
const location = z.object({ directory: z.string() })
|
||||
const modelResponse = z.object({ location, data: availableModel.array() })
|
||||
const agentResponse = z.object({ location, data: agent.array() })
|
||||
const defaultModelResponse = z.object({ location, data: availableModel.nullable() })
|
||||
const defaultModelResponse = z.object({
|
||||
location,
|
||||
data: availableModel.nullable()
|
||||
})
|
||||
const configResponse = z.array(
|
||||
z.object({
|
||||
type: z.enum(['directory', 'document']),
|
||||
@@ -107,7 +111,11 @@ export async function probeOpenCodeLaunchModelContext(options: {
|
||||
args: ['serve', '--hostname', '127.0.0.1', '--port', '0'],
|
||||
cwd: options.cwd
|
||||
},
|
||||
{ ...options.env, OPENCODE_SERVER_USERNAME: 'opencode', OPENCODE_SERVER_PASSWORD: password },
|
||||
{
|
||||
...options.env,
|
||||
OPENCODE_SERVER_USERNAME: 'opencode',
|
||||
OPENCODE_SERVER_PASSWORD: password
|
||||
},
|
||||
process.platform,
|
||||
// `opencode serve` never exits on stdin end, so on POSIX only its supervisor stops it with Orca.
|
||||
{ lifetime: 'one-shot' }
|
||||
@@ -117,7 +125,12 @@ export async function probeOpenCodeLaunchModelContext(options: {
|
||||
args: spawnSpec.args,
|
||||
cwd: options.cwd,
|
||||
env: spawnSpec.env,
|
||||
detached: true
|
||||
detached: true,
|
||||
stdio: ['pipe', 'pipe', 'pipe', ...spawnSpec.groupReportStdio]
|
||||
})
|
||||
guardSupervisedProviderGroup(child, {
|
||||
site: OPENCODE_PREFLIGHT_KILL_SITE,
|
||||
supervised: spawnSpec.supervised
|
||||
})
|
||||
const output = createOutputSink(4096)
|
||||
let childClosed = false
|
||||
|
||||
Reference in New Issue
Block a user