Skip to content

fix(runtime): persist explicit incomplete capability results as failed turns - #1956

Merged
pancacake merged 2 commits into
HKUDS:devfrom
yepyhun:contrib/capability-incomplete-outcome
Oct 18, 2026
Merged

pancacake merged 2 commits into
HKUDS:devfrom
yepyhun:contrib/capability-incomplete-outcome

Conversation

@yepyhun

@yepyhun yepyhun commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Problem

A capability can emit a final result with completed: false and return normally.
The orchestrator previously treated the absence of an exception as success,
emitting DONE status=completed. The durable turn store consequently marked a
rejected interaction completed even though the capability's finish guard had
correctly refused it.

Change

Read the last explicit capability-result completion flag through the existing
turn-local stream owner. A final boolean false emits the native terminal error
contract and failed DONE (capability_incomplete, retryable). Existing result
payloads, usage, partial text and saved learner work remain intact. Omitted
completion flags and successful results keep their previous lifecycle; a later
successful result supersedes an intermediate incomplete result.

There is no alternate turn store, exception-policy rewrite or Mastery-specific
shortcut. Ordinary recoverable tool errors remain recoverable.

Evidence

  • RED on the clean release baseline: the incomplete case reports completed
    instead of failed (1 failed, 2 passed in the selected parameterized test).
  • GREEN: 64 tests passed across orchestrator, StreamBus and session subscription
    outcome handling in the clean contribution, and separately in the combined
    installation. Assertions include persisted outcome/failure-metadata mapping.
  • Does not itself repair source selection, quiz delivery or arbitrary model
    claims. Those are separately tracked workflow concerns.

Related: #1955, #1941 and the contribution map #1940. This resolves only the terminal-outcome portion of #1955.

@pancacake
pancacake merged commit 2a4dad3 into HKUDS:dev Oct 18, 2026
9 of 15 checks passed
alvinets pushed a commit to alvinets/DeepTutor that referenced this pull request Nov 8, 2026
…ete-outcome

fix(runtime): persist explicit incomplete capability results as failed turns
alvinets pushed a commit to alvinets/DeepTutor that referenced this pull request Nov 8, 2026
…ete-outcome

fix(runtime): persist explicit incomplete capability results as failed turns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants