mirror of
https://github.com/stablyai/orca.git
synced 2026-10-24 08:03:58 +00:00
Merge #24257 head c9b4dc0578 (prompted agent.launch is a long poll)
This commit is contained in:
@@ -44,6 +44,25 @@ describe('OrcaRuntimeRpcServer', () => {
|
||||
).toBe('wait')
|
||||
})
|
||||
|
||||
it.each(['agent.launch', 'agent.launchReplay'])(
|
||||
'keeps a prompted %s alive while it waits for the agent to be ready',
|
||||
(method) => {
|
||||
const prompt = { text: 'fix the build', delivery: 'submit' }
|
||||
expect(
|
||||
classifyRuntimeLongPoll({
|
||||
id: 'req_launch',
|
||||
authToken: 'token',
|
||||
method,
|
||||
params: { prompt }
|
||||
})
|
||||
).toBe('wait')
|
||||
// Without a prompt nothing waits on the agent, so the launch stays a short call.
|
||||
expect(
|
||||
classifyRuntimeLongPoll({ id: 'req_launch', authToken: 'token', method, params: {} })
|
||||
).toBeNull()
|
||||
}
|
||||
)
|
||||
|
||||
it('keeps agent-prompt submission sockets alive during verification', () => {
|
||||
expect(
|
||||
classifyRuntimeLongPoll({
|
||||
|
||||
@@ -26,6 +26,17 @@ export function classifyRuntimeLongPoll(request: RpcRequest): RuntimeLongPollCla
|
||||
if (request.method === 'orchestration.workerStart') {
|
||||
return 'wait'
|
||||
}
|
||||
// A launch with a prompt waits for the agent's readiness before writing it, up to 60 s, and a
|
||||
// reply lost to the 30 s idle timer reads as a dead runtime instead of an undelivered prompt.
|
||||
if (
|
||||
(request.method === 'agent.launch' || request.method === 'agent.launchReplay') &&
|
||||
typeof request.params === 'object' &&
|
||||
request.params !== null &&
|
||||
'prompt' in request.params &&
|
||||
request.params.prompt !== undefined
|
||||
) {
|
||||
return 'wait'
|
||||
}
|
||||
if (request.method === 'browser.clientHost.attach') {
|
||||
return 'browser-host'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user