MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / getAutonomyTurnOutcome

Function getAutonomyTurnOutcome

src/query.ts:211–236  ·  view source on GitHub ↗
(params: {
  terminal?: Terminal
  thrownError?: unknown
})

Source from the content-addressed store, hash-verified

209}
210
211function getAutonomyTurnOutcome(params: {
212 terminal?: Terminal
213 thrownError?: unknown
214}): AutonomyTurnOutcome {
215 if (params.thrownError !== undefined) {
216 return { type: 'failed', error: params.thrownError }
217 }
218
219 const terminal = params.terminal
220 const reason = terminal?.reason
221 switch (reason) {
222 case 'completed':
223 return { type: 'completed' }
224 case undefined:
225 case 'aborted_streaming':
226 case 'aborted_tools':
227 return { type: 'cancelled' }
228 case 'model_error':
229 return { type: 'failed', error: terminal.error }
230 default:
231 return {
232 type: 'failed',
233 message: `query ended without successful completion: ${reason}`,
234 }
235 }
236}
237
238export type QueryParams = {
239 messages: Message[]

Callers 1

queryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected