> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narrative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Invalid Effective Config

> The workflow could not decode the run's effective_config JSONB into the expected shape.

**Surface:** `GET /agents/runs/{id}`, `error.type = "AgentLoopInvalidEffectiveConfig"`

## When this error occurs

When a workflow starts, its load activity reads `agent_runs.effective_config` (the merged
defaults + override snapshot produced by the API at run-creation time) and decodes it into the
workflow's typed config. This error means the JSONB doesn't match the workflow's current shape.

Causes:

* **Schema drift** — the API persisted a shape the workflow doesn't recognise yet (deploy
  ordering issue: workers older than the API).
* **Discriminator mismatch** — a discriminated union (`tool_choice.kind`, `payload.kind`, etc.)
  carries an unexpected discriminator value. The `error.message` field includes the failing
  JSON path.

## How to fix

If a redeploy is in progress, wait for the workers to catch up; the run row is already in
`failed` status, but you can re-post the same `client_op_id` after the deploy completes —
the API will return the existing terminal row (no retry) and you'll need to start a fresh run
with a new `client_op_id`. Production-wise, deploy workers before the API to avoid this race.

For caller-driven causes (unexpected `tool_choice` shape, etc.), inspect `error.message` for
the path and compare against the API docs for the relevant DTO.
