Skip to content

Goal evaluator verdict truncated mid-JSON leaves a met goal active and the session idle #460

Closed

Description

@przadka-agents

The /goal evaluator sometimes returns a verdict that is cut off mid-JSON, and the goal then stays active on an idle session that has met it.

Seen twice on pi-code 1.7.0 and 1.9.0 (Pi 1.5.2, anthropic/claude-opus-5-5 at medium), once in each of two long runs:

Warning: Goal evaluator error: unreadable verdict: {"ok": true, "reason": "PR #576 exists and meets each part of the condition.\n\n1. Open, unmerged, into main, by przadka-agents: `gh pr create --repo michalprzadka/factory --base main --head przadka/5. The goal stays set; the next turn is evaluated again.

Both times the verdict was "ok": true with a long reason (a numbered list quoting commands), and the work was done. No further turn came, so the session sat idle with the goal active until someone typed.
Neither the error nor the stall is written to the session file, so a tool reading the file sees an active goal and cannot tell it from a session that is working.

Likely cause: extensions/goal.ts calls the evaluator with maxTokens: EVALUATOR_MAX_TOKENS (512), and a long reason runs past it, so parseVerdict gets a truncated object. We did not capture the provider's stop reason, so this is inferred from the text.

Possible fixes, any of which would have avoided the stall here:

  • raise the cap, or ask the evaluator for a short reason (one sentence);
  • on an unreadable verdict, retry once before giving up for the turn;
  • when an unreadable verdict ends a run that made no further turn, write it to the session file (as with achieved and failed) so tools can see it.

Activity

  1. przadka-agents commented on Nov 16, 2026

    @przadka-agents
    ContributorAuthor

    A third occurrence, on pi-code 1.9.0 (Pi 1.5.2, anthropic/claude-opus-5-5 at medium), this time on a deferral branch:

    Warning: Goal evaluator error: unreadable verdict: {"ok": true, "reason": "The second branch of the condition is met. The assistant wrote a comment beginning \"Decision needed: how nestal-ai/nestalos#4279's sweep runs, now that the Pi guard ref. The goal stays set; the next turn is evaluated again.
    

    The reason again quotes the transcript at length. Three long runs, three truncated verdicts, each with "ok": true.

  2. added a commit that references this issue on Nov 20, 2026
    269aa82
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions