Skip to content

[feature] Report served answers for VGR recovery #1165

Open

Description

@gburachas

Report served answers for VGR recovery

Proposed implementation: MR !20 — feat(libsy): report served answers for VGR recovery.

Problem

Agent harnesses can send automatic prompts as role: user, such as “Your previous response was empty; continue.” Without initiator metadata, VGR can treat these as a new human request and reset the current turn's tier hold and time budget.

The x-initiator support merged in #1041 already distinguishes human requests from agent continuations. This proposal supports hosts that omit that metadata.

Proposed solution

Add AnswerSummary { final_reply: bool } and default no-op observe_answer methods to Algorithm and Classifier. The SDK reports whether the response it served completed. Custom hosts can report the same information.

VGR uses these reports to preserve the turn's hold and budget after incomplete responses. Explicit x-initiator headers take precedence. Existing hosts that omit reports keep their current behavior.

Alternatives considered

Reliable initiator headers remain the preferred solution. Completion reports provide a fallback when those headers are unavailable.

Scope notes

  • Backward compatibility: Existing trait implementations inherit default methods. No required RoutingOutcome fields or TOML settings are added.
  • Completion: A final response requires nonblank assistant text, completed output, and no tool calls. Empty, truncated, canceled, and failed responses remain incomplete.
  • Timing limitation: Without initiator metadata, the implementation requires a two-second pause after a final response before recognizing a new human turn. A fast human reply can retain the hold; a delayed automatic prompt can release it. Reviewers should assess this heuristic.
  • Purpose: Reports preserve routing state during recovery. The harness performs retries and continuations.

Additional context

Design proposal: #570 — verification-gated routing. The issue requests agreement on the shared API and fallback behavior before upstreaming MR !20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions