Skip to content

fix(runtime): emit error event on silent SSE stream truncation#104

Merged
yishuiliunian merged 1 commit intomainfrom
worktree-swift-leaping-barto
Apr 15, 2026
Merged

fix(runtime): emit error event on silent SSE stream truncation#104
yishuiliunian merged 1 commit intomainfrom
worktree-swift-leaping-barto

Conversation

@yishuiliunian
Copy link
Copy Markdown
Contributor

Summary

  • SSE stream silent truncation (connection lost after HTTP 200) only logged a warning, never emitted an error event to the TUI
  • User saw no response and immediate idle state after typing "continue"
  • Now emits AgentEventPayload::Error so the conversation shows a clear "connection lost" message

Changes

  • crates/loopal-runtime/src/agent_loop/llm.rs: added emit(Error) call in the silent truncation detection path (line 78-86)

Test plan

  • bazel build //crates/loopal-runtime passes
  • bazel test //crates/loopal-runtime:loopal-runtime_test passes
  • bazel build //crates/loopal-runtime --config=clippy passes (zero warnings)
  • CI passes

When the SSE stream ended without message_stop (e.g. network interruption
after HTTP 200), the agent only logged a warning and returned Ok with
stream_error=true. The TUI never received an error event, so the user
saw no response and an immediate idle state. Now emits an Error event
so the user sees a clear "connection lost" message in the conversation.
@yishuiliunian yishuiliunian merged commit d639512 into main Apr 15, 2026
4 checks passed
@yishuiliunian yishuiliunian deleted the worktree-swift-leaping-barto branch April 15, 2026 11:43
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.

1 participant