Skip to content

feat: allow script agents to declare output schemas for typed downstream access #118

@PolyphonyRequiem

Description

@PolyphonyRequiem

Feature Request: Allow script agents to declare output schemas

Current behavior

Script agents (\ ype: script) cannot declare an \output:\ block. Validation fails with:

\
script agents cannot have 'output' schema (output is always stdout/stderr/exit_code)
\\

Desired behavior

Script agents should be able to declare typed output schemas, just like LLM agents. The script writes JSON to stdout; conductor should parse it according to the declared schema and make it available as \�gent_name.output.field_name\ for downstream agents and routing conditions.

Why this matters

When converting LLM agents to deterministic scripts (for routing, validation, state detection), the output contract is the same — downstream agents need typed fields. Currently the workaround is:

  1. Route via exit codes (e.g., \�xit_code == 10\ → planning, \�xit_code == 20\ → implementation)
  2. Downstream agents read the raw stdout JSON

This works but has drawbacks:

  • Exit codes are opaque — no self-documenting schema
  • Routing conditions can't reference output fields (\output.phase == 'done')
  • No validation that the script actually outputs the expected JSON structure
  • The exit code workaround diverges from how LLM agent routing works

Proposed solution

Allow \ ype: script\ agents to optionally declare \output:\ with the same schema syntax as LLM agents. Conductor would:

  1. Parse stdout as JSON
  2. Validate it against the declared schema (if present)
  3. Make fields available as \�gent_name.output.field_name\
  4. Allow \when:\ conditions to reference output fields

If no \output:\ is declared, current behavior (raw stdout/stderr/exit_code) is preserved.

Workaround

Currently using exit codes for routing and raw stdout for context. Functional but less ergonomic than typed outputs.

Environment

  • Conductor v0.1.9
  • Python 3.14.2
  • Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions