agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

bug(config): schema-unknown / misplaced keys are silently stripped instead of rejected — no load-time validation

Open Tonedeath opened this issue 4 months ago • 3 comments

Problem

AO's config loader silently drops keys that don't match the schema instead of rejecting them. A misplaced or misspelled key produces no error at ao start / ao spawn / ao doctor — the daemon runs with the intended setting silently absent, and you only discover it by observing wrong runtime behavior (a worker running with the wrong permissions or model). The config is individually well-documented (ao config-help), but nothing tells you when your file doesn't match it.

Concrete traps (verified against ao config-help, ao 0.8.0)

  1. Right key, wrong scope → silently stripped. agentConfig is valid only under projects.<id>.agentConfig. But agent, runtime, workspace, notifiers, orchestrator, worker are all settable under top-level defaults, so defaults.agentConfig: reads as a natural place to set a fleet-wide default permission/model. It isn't in the defaults schema — so it's dropped, and every project silently runs with default permissions/model. No warning.
  2. Out-of-enum value → no early rejection. agentConfig.permissions accepts permissionless | default | auto-edit | suggest. A plausible guess like permissions: bypass is not in the enum; the intent is lost rather than flagged at load with the accepted set.
  3. Same failure mode as the migration footguns in #2524 — config parsing that is lenient where it should be strict (unknown keys pass) — viewed from the schema-validation angle rather than the wrapped→flat-migration angle.

The likely mechanism is the loader using zod's default object behavior (unknown keys stripped) rather than surfacing them. A published schema/config.schema.json already exists (referenced in the $schema line ao config-help emits), so the raw material for a validate-on-load pass is already there.

Proposal

Validate the whole config against the schema at load time (ao start, ao doctor, and ideally ao config), and reject — or at minimum loudly warn with the offending path — on:

  • Unknown keys (.strict() or an explicit unknown-key diagnostic instead of a silent strip).
  • Known keys in the wrong scope (e.g. agentConfig under defaults) — point at the scope that accepts it.
  • Out-of-enum values — print the accepted set (permissions: got "bypass", expected one of permissionless|default|auto-edit|suggest).

ao doctor is the natural home for a non-fatal "your config has N keys the schema doesn't recognize — did you mean …" report even if start stays lenient for back-compat.

Repro

Add defaults: { agentConfig: { permissions: permissionless } } to a project's agent-orchestrator.yaml, start, and observe workers spawn with default (not permissionless) permissions and no diagnostic about the ignored key.

🤖 Filed with Claude Code on behalf of @Tonedeath

Tonedeath avatar Jul 13 '26 13:07 Tonedeath

Thanks for contributing to Agent Orchestrator.

This issue is being picked up by the current external contributor on-call pair:

  • @neversettle17-101
  • @somewherelostt

If someone is already working on this, please continue as usual. The on-call pair is added for visibility, tracking, and support, not to take over the work. If you need help with review, direction, reproduction, or next steps, please tag @neversettle17-101 and @somewherelostt here. You can also join the AO Discord if you want faster context, want to ask questions live, or just want to follow what the community is building.

You are also welcome to join the AO Discord community.

We do daily Discord calls at 10 PM IST, except Saturday.

Join the session here: https://discord.gg/H6ZDcUXmq

Come by if you want to see what is being built, ask questions, or just hang around with the community.

somewherelostt avatar Jul 13 '26 14:07 somewherelostt

Assigned to @codebanditssss

Rishet11 avatar Sep 27 '26 17:09 Rishet11

Closing as it is obsolete after rewrite.

Vaibhaav-Tiwari avatar Oct 27 '26 10:10 Vaibhaav-Tiwari