mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-31 03:56:51 +00:00
Agents: add fallback error observations (#41337)
Merged via squash.
Prepared head SHA: 852469c82f
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
This commit is contained in:
@@ -199,6 +199,7 @@ export async function runAgentTurnWithFallback(params: {
|
||||
const onToolResult = params.opts?.onToolResult;
|
||||
const fallbackResult = await runWithModelFallback({
|
||||
...resolveModelFallbackOptions(params.followupRun.run),
|
||||
runId,
|
||||
run: (provider, model, runOptions) => {
|
||||
// Notify that model selection is complete (including after fallback).
|
||||
// This allows responsePrefix template interpolation with the actual model.
|
||||
|
||||
@@ -474,6 +474,7 @@ export async function runMemoryFlushIfNeeded(params: {
|
||||
try {
|
||||
await runWithModelFallback({
|
||||
...resolveModelFallbackOptions(params.followupRun.run),
|
||||
runId: flushRunId,
|
||||
run: async (provider, model, runOptions) => {
|
||||
const { authProfile, embeddedContext, senderContext } = buildEmbeddedRunContexts({
|
||||
run: params.followupRun.run,
|
||||
|
||||
@@ -159,6 +159,7 @@ export function createFollowupRunner(params: {
|
||||
cfg: queued.run.config,
|
||||
provider: queued.run.provider,
|
||||
model: queued.run.model,
|
||||
runId,
|
||||
agentDir: queued.run.agentDir,
|
||||
fallbacksOverride: resolveRunModelFallbacksOverride({
|
||||
cfg: queued.run.config,
|
||||
|
||||
Reference in New Issue
Block a user