Model stages: outcome-first output shape and one in-session outcome repair

The prompt now says output.md must start with # outcome and the outcome
word alone on the next line, then # handoff, then detail. Runs 241/243
followed the old "start with # handoff" wording and dropped the outcome.

When a completed turn lacks a valid outcome, the OpenCode/agent and Pi
clients send one short follow-up in the same session asking only for the
outcome line. An outcome-only reply goes at the top of the original report;
a still-invalid reply fails with the same validation error as before. The
follow-up's tokens accrue to the session usage. No outcome is inferred.

Missing tools/evidence now name blocked when declared, else error. The
parser tolerates a trailing period on the outcome word.
This commit is contained in:
2026-11-04 17:20:58 +00:00
parent b5927505cc
commit 88dfc051e5
13 changed files with 457 additions and 16 deletions
+7
View File
@@ -431,6 +431,13 @@ func (c *OpenCodeClient) Generate(ctx context.Context, config ModelConfig, promp
if err != nil {
return "", err
}
text, data, err = c.repairOutput(ctx, config, session.Data.ID, text)
if len(data) > 0 {
c.FormatAudit = string(data)
}
if err != nil {
return "", err
}
if !config.Budget.Enabled() {
// As with AgentClient, missing usage is not a generation failure when
// no limit is enabled (and a nil ledger needs no aggregate read).