Skip to content

Commit 03a93e3

Browse files
committed
fix(miot-chat): handle new harness event types in transcript projector
Task 2's event-type parity fix widened HarnessEvent["type"] with six literals (approval.auto, decision.requested, decision.resolved, steering.mode_denied, steering.injected, run.interrupted). applyHarnessEvent is an exhaustive switch with no default, so the unhandled cases let it fall through -> TS2366 'Function lacks ending return statement' in check-types. Add explicit cases: run.interrupted joins the terminal run.completed/ run.failed group; the run-control/steering events are explicit no-ops (the legacy approval.requested row still renders; the decision/steering TUI migration is out of scope). Kept default-less so future event types keep tripping the type-checker until handled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RtLa5MJ6nUHwBMC3FX6of6
1 parent 7d3232b commit 03a93e3

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

  • turbo-repo/packages/miot-chat/src/tui/transcript

turbo-repo/packages/miot-chat/src/tui/transcript/project.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,29 @@ export function applyHarnessEvent(
3232

3333
case "run.completed":
3434
case "run.failed":
35+
case "run.interrupted":
3536
// The session reducer's END_TURN orchestrates the final transition;
3637
// mid-stream we leave the transcript alone so callers don't have to
37-
// race the projector against END_TURN.
38+
// race the projector against END_TURN. run.interrupted (Plan C) is a
39+
// graceful stop and terminates the run like the other two.
3840
return slice;
3941

42+
case "approval.auto":
43+
case "decision.requested":
44+
case "decision.resolved":
45+
case "steering.mode_denied":
46+
case "steering.injected":
47+
// Plan A/B/C run-control + steering events. The transcript still
48+
// renders the legacy approval.requested row (dual-emitted alongside
49+
// decision.requested for tool approvals), and the decision/steering
50+
// TUI migration is out of scope here — so these are intentionally not
51+
// projected. They are handled explicitly (rather than via a default)
52+
// to keep this switch exhaustive, so any future event type keeps
53+
// tripping the type-checker until it is handled. Surfacing them in the
54+
// TUI is a follow-up.
55+
return slice;
56+
57+
4058
case "answer.completed":
4159
return upsertAssistantItem(slice, event, runId, ctx);
4260

0 commit comments

Comments
 (0)