Repository navigation
agent-runtime 1.7.0
What's new
- Enforcement on CLI drivers. codex, claude-code, and opencode now validate the agent's final answer against your schema. On a mismatch, the platform resumes the agent's session with the validation error and retries (up to 3 attempts total, all within the task's existing timeout). If the output still doesn't conform, the task fails with error code invalid_structured_output — a completed task always means valid output.
- Native enforcement where available. When your schema fits the providers' strict subset (additionalProperties: false, all properties required, no $ref), the schema is also passed natively to the CLI (codex --output-schema, claude --json-schema) for constrained decoding — better first-shot validity, fewer retries. Schemas outside the subset are never rejected; they simply rely on the platform's own validation. Either way, the platform's validator is the guarantee.
- Server-side validation at submission. Invalid requests now fail fast with 400 invalid_output_schema (missing or malformed JSON Schema) or 400 structured_output_unsupported (driver can't honor the contract) instead of running the task and returning unvalidated text. Applies to both POST .../tasks and POST .../tasks/from-prompt.
- Retry visibility. Each failed validation attempt emits a warn-level event in the task stream (structured output invalid (attempt N/3): …), so you can see why a structured task took extra round-trips.
- Console. The structured-output contract in the Submit Task form is now available for all drivers.
Under the hood
- All drivers share one enforcement core (tolerant JSON extraction, jsonschema validation, session-resume retry loop) — no per-driver behavior drift.
- Claude Code CLI in the agent image bumped to 2.1.212 (versions before 2.1.205 silently ignored invalid --json-schema arguments).
- Robustness hardening: JSON extraction is no longer confused by bracketed prose ([INFO], [1]-style citations) around the answer, and near-strict schemas that would be rejected by provider-native endpoints correctly fall back to platform-side validation instead of failing the task.