Files
orca/src
Benson LUOandKelvin Amoaba e4e342e700 fix(native-chat): keep the answer visible when a Stop hook fails (#42508)
* fix(native-chat): keep the answer visible when a Stop hook fails

A failed Stop hook follows a completed answer, but the turn fold treated
its red row as the turn's final answer, hiding the reply behind the
Worked-for disclosure. Mark failed Stop-hook rows with a dedicated
presentation so they stay visible beside the answer instead of
displacing it; turns that genuinely fail still end on their error.

Fixes #42487

* fix(native-chat): identify Claude Stop hooks from hook_event

hook_name carries the matcher-suffixed display name (for example
Stop:guard), so comparing it to 'stop' dropped the hook-failed
presentation for Stop hooks with a matcher. Read the bare event name
from hook_event and keep hook_name for display; a matcher-suffixed
hook_name without hook_event still counts so hook_name-only frames
keep working.

* fix(native-chat): read failed hooks from their frame and fold only mid-turn ones

Every failed hook, not just Stop, completes the turn, and a failing
PostModelRequest hook also lands after the answer. The fold now spots a
failed-hook row by the hook frame every such row already carries, so it
also works for rows from older hosts and rows already stored. Failures
that end a turn stay visible below the answer; earlier ones fold as work.

---------

Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
2026-11-15 01:54:25 +00:00
..