mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
Forward brief clear through Claude close
This commit is contained in:
@@ -21,6 +21,7 @@ import { claudeHeldSends } from '../claude-command-lifecycle'
|
||||
import { settledClaudeTurnEndLeaf } from './claude-structured-resume-point'
|
||||
import { settleClaudeTurnEndWaiters } from '../claude-request-end-wait'
|
||||
import type { StructuredAgentSessionLogger } from '../../native-chat/agent-session-wire/host/structured-agent-session-logger'
|
||||
import type { ProviderProcessCloseOptions } from '../../provider-process/provider-process-close'
|
||||
|
||||
/** Root exit releases the lease even with unverified descendants; a failed spawn proves no exit. */
|
||||
export function claudeRootExitObserved(
|
||||
@@ -107,6 +108,7 @@ type CloseClaudePublishedSessionInput = {
|
||||
onEvent?: (event: ClaudeStructuredSessionEvent) => void
|
||||
logger?: StructuredAgentSessionLogger
|
||||
settledExitErrors?: Map<string, Error>
|
||||
closeOptions?: ProviderProcessCloseOptions
|
||||
}
|
||||
|
||||
async function finalizeClaudePublishedSession(
|
||||
@@ -120,7 +122,7 @@ async function finalizeClaudePublishedSession(
|
||||
for (const prompt of session.prompts.clear()) {
|
||||
prompt.settle(null)
|
||||
}
|
||||
const connectionClosed = await session.connection.close()
|
||||
const connectionClosed = await session.connection.close(input.closeOptions)
|
||||
session.unbindReadingControl?.()
|
||||
const rootExitVerdict = claudeCloseReport(
|
||||
session.connection,
|
||||
|
||||
+3
@@ -175,6 +175,9 @@ describe('same-conversation clear', () => {
|
||||
).toBe('pending')
|
||||
await withTestAgentSessionDatabase(generationRoot(), (db) => db.exec('DROP TRIGGER fail_clear'))
|
||||
await clearCommits(params)
|
||||
expect(adapter.closeSession).toHaveBeenCalledWith(HOST_TEST_SESSION, undefined, {
|
||||
grace: 'brief'
|
||||
})
|
||||
expect(await clearRows()).toHaveLength(1)
|
||||
expect(
|
||||
store.getOperationRow(caller.callerKey, params.envelope.clientOperationId)?.outcome.status
|
||||
|
||||
Reference in New Issue
Block a user