chorus icon indicating copy to clipboard operation
chorus copied to clipboard

Template enum value `iterate.onDisagreement: accept-doer` is exposed in schema + cockpit UI but unimplemented in runner

Open brianmarr opened this issue 6 months ago • 0 comments

Summary

The schema accepts iterate.onDisagreement: 'continue' | 'escalate' | 'accept-doer', and the cockpit's template-dialog form exposes all three values to users — but the daemon runner only honors 'continue'. Setting accept-doer (or escalate) on a template validates and persists, but has no effect on chat behavior.

Evidence (against main, also reflected in [email protected] on npm)

Schema + UI define the enum:

  • src/lib/template-schema.ts — onDisagreement: z.enum(['continue', 'escalate', 'accept-doer']).default('continue')
  • src/components/template-dialog/emit.ts carries an explicit comment mapping:
    // fail → 'accept-doer' (drop reviewer veto, accept doer)
    
  • src/components/template-dialog/{types,parse}.ts — form parses/emits the value
  • docs/v05/SPEC-D-templates.md — schema documented

Runner never reads the field:

  • src/daemon/runner.ts round loop (for (let round = 1; round <= stdPhase.iterate.maxRounds; round++)) breaks on consensus, otherwise falls through to phase_failed with reason: 'max_rounds_exhausted' → final emitChatDone({ status: 'failed', verdict: 'failed', error: 'doer_failed_all_rounds' }). No branch consults iterate.onDisagreement.
  • src/daemon/runner/review-only-phase.ts only sets onDisagreement: 'continue' as a synthetic config for the wrapped reviewer call.
  • All templates/*.yaml and tests/*.ts use 'continue' exclusively.

A repo-wide grep for accept-doer / acceptDoer shows zero callers outside the schema, the cockpit form, and the SPEC doc.

Reproduce

  1. Create a user template with iterate.onDisagreement: accept-doer, agreementThreshold: 1, and a doer + reviewer that will disagree.
  2. Submit a chat where the reviewer requests changes every round.
  3. Expected (per cockpit label "drop reviewer veto, accept doer"): chat ends successfully with the doer's last answer.
  4. Observed: chat ends status: failed, error: doer_failed_all_rounds.

Impact

"Set it, nothing happens" trap. Users picking the option from the cockpit form (or writing it in YAML to match the schema) get silent no-op behavior. Particularly relevant for decision/recommendation-style templates where the doer's final draft is a legitimate fallback when reviewers can't agree.

Question

Is accept-doer (and escalate) planned but not yet wired into the runner, or has the runner regressed away from honoring it? Either way it'd be nice to ship the runner behavior — or, failing that, hide the unimplemented enum values from the cockpit form and schema so users aren't misled.

brianmarr avatar May 15 '26 16:05 brianmarr