fix(runtime-fallback): reuse normalized messages for visible assistant checks
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -7,6 +7,7 @@ import { createFallbackState } from "./fallback-state"
|
|||||||
import { getFallbackModelsForSession } from "./fallback-models"
|
import { getFallbackModelsForSession } from "./fallback-models"
|
||||||
import { resolveFallbackBootstrapModel } from "./fallback-bootstrap-model"
|
import { resolveFallbackBootstrapModel } from "./fallback-bootstrap-model"
|
||||||
import { dispatchFallbackRetry } from "./fallback-retry-dispatcher"
|
import { dispatchFallbackRetry } from "./fallback-retry-dispatcher"
|
||||||
|
import { extractSessionMessages } from "./session-messages"
|
||||||
|
|
||||||
export function hasVisibleAssistantResponse(extractAutoRetrySignalFn: typeof extractAutoRetrySignal) {
|
export function hasVisibleAssistantResponse(extractAutoRetrySignalFn: typeof extractAutoRetrySignal) {
|
||||||
return async (
|
return async (
|
||||||
@@ -20,12 +21,7 @@ export function hasVisibleAssistantResponse(extractAutoRetrySignalFn: typeof ext
|
|||||||
query: { directory: ctx.directory },
|
query: { directory: ctx.directory },
|
||||||
})
|
})
|
||||||
|
|
||||||
const msgs = (messagesResp as {
|
const msgs = extractSessionMessages(messagesResp)
|
||||||
data?: Array<{
|
|
||||||
info?: Record<string, unknown>
|
|
||||||
parts?: Array<{ type?: string; text?: string }>
|
|
||||||
}>
|
|
||||||
}).data
|
|
||||||
|
|
||||||
if (!msgs || msgs.length === 0) return false
|
if (!msgs || msgs.length === 0) return false
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user