Skip to content

orchestrate: validate_run_state rejects resolvedRouting.fallback: null — non-premium slices should omit it, but the contract is ambiguous #333

Description

@rodrigorjsf

Symptom

During a real /orchestrate run (orchestrate plugin v1.6.0), after freezing per-slice routing into run-state.json, writing the resolved-routing block for a non-premium slice (no route:* label, no model fallback) as:

"resolvedRouting": { "model": "...", "variant": "...", "fallback": null, "fallbackTaken": false }

caused validate_run_state and all three render tools (render_dashboard, render_graph, render_report) to fail with:

run-state.json does not match the expected shape: slices.<N>.resolvedRouting.fallback: Expected object, received null

Why this is an easy trap

The SKILL spine describes freezing { model, variant, optional fallback }. "Optional" naturally reads as nullable — so writing "fallback": null for a slice with no fallback looks correct. But the schema is .optional(), which accepts an absent key yet rejects a literal null. The key must be omitted, not set to null, when there is no fallback.

Worse, the error only surfaces at the final render step — after the entire wave loop has run — rather than at the checkpoint write that introduced the bad shape. The whole run can complete and then fail to render.

Relationship to existing issues (read before deduping)

So this is a genuinely new surface, not a duplicate of #300/#315.

Suggested fix (options)

  1. Relax the schema so resolvedRouting.fallback accepts null and treats it as absent (.nullish() / z.object(...).nullable().optional()), so both null and omitted validate. (Touches orchestrate-mcp/src + requires npm run build and a rebuilt committed dist/.)
  2. Document explicitly in the spine/reference that resolvedRouting.fallback must be OMITTED (not null) for non-premium slices — and have the freeze/checkpoint guidance show the no-fallback shape so authors copy the correct form. (Doc-only, mirrors the orchestrate: run-state.md subState wording — say 'omit the key' (an explicit null is rejected) #300 fix.)

Ideally do both: relax the schema AND show the no-fallback shape in the reference, so the trap is closed at the schema and the doc.

Environment

orchestrate plugin v1.6.0, observed during a real /orchestrate run.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggrill-primedPrimed with an autonomous pre-grill triage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions