Skip to content

feat(workflows): add ordered pre-side-effect model fallback chain for text nodes - #64

Merged
zereight merged 1 commit into
mainfrom
feat/workflow-fallback-chain
Nov 24, 2026
Merged

zereight merged 1 commit into
mainfrom
feat/workflow-fallback-chain

Conversation

@zereight

Copy link
Copy Markdown
Owner

Summary

  • Add optional ordered fallbacks?: WorkflowModelTarget[] (max 3) to WorkflowNode (server/workflows/types.ts) and observability fields (usedInstanceId, usedModel, fallbackAttempts) to WorkflowNodeRun.
  • Validate fallbacks in server/workflows/check.ts (text nodes only, max 3, non-empty instanceId, no duplicates with primary or earlier fallbacks) and round-trip them through server/workflows/graph-spec.ts and server/drivers/agents-workflow-tools.ts.
  • Update executeTextNode in server/workflows/runner.ts to walk [primary, ...fallbacks] under one shared node timeout budget:
    • Skips unavailable engines.
    • Collects runtime.error events and reuses existing classifyError / engineFailureKind to fall back only on pre-side-effect availability/auth/quota/rate-limit/overload/unknown-model failures.
    • Never falls back after tool execution, permission requests, or assistant output has started (hasSideEffectOrOutput), or on cancellation/timeout (interrupts cleanly on timeout).

Why

  • Regular chat already had multi-step failover via server/host/limit-takeover.ts, whereas workflow text nodes failed immediately on a single missing/limited/signed-out engine.
  • Incorporates DevilsAdvocate safeguards: no duplicate side effects on mid-flight failures, no timeout multiplication, reuse of existing error classifiers, and run-level observability.

Verification

  • Static checks: oxlint --deny-warnings (0 warnings/errors), tsc -p tsconfig.server.json --noEmit (0 errors in changed files), scripts/testing/file-size-ratchet.test.ts passed.
  • Runtime verification (node --experimental-strip-types against createWorkflowRunner + createWorkflowStore):
    • Before: Missing primary engine or runtime.error (limit: "engine") failed the workflow node immediately.
    • After: Verified all 6 scenarios: spec-roundtrip, validation-limits-and-duplicates, missing-engine-skip, pre-side-effect-limit-failover, midflight-tool-blocks-fallback, timeout-blocks-fallback-and-interrupts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant