Skip to content

fix(frontend): route product planning EA replies to the CEO terminal#400

Open
zhengxuyu wants to merge 1 commit into
mainfrom
fix/planning-reply-ui
Open

fix(frontend): route product planning EA replies to the CEO terminal#400
zhengxuyu wants to merge 1 commit into
mainfrom
fix/planning-reply-ui

Conversation

@zhengxuyu
Copy link
Copy Markdown
Collaborator

Summary

EA replies in product planning conversations were never rendered in the CEO terminal — they only appeared in server debug logs. The CEO would click Start Planning, see the EA's question in the trace stream, and assume the UI was broken.

Root cause

frontend/app.js:292 — the WebSocket conversation_message handler routes to the CEO terminal only when:

this._currentConvType === 'oneonone' || this._currentConvType === 'ea_chat'

But _openProductPlanningConversation sets _currentConvType = 'product' (app.js:7137). So the EA reply arrived via WebSocket, didn't match the terminal branch, didn't match the chatPanel branch (planning uses the terminal), and got dropped.

The text appeared in logs because the LLM trace layer captures all model output regardless of UI.

Fix

Add 'product' to the type filter; reuse the EA label (玲珑阁 (EA)) since planning is always a CEO ↔ EA conversation.

Test plan

  • node tests/frontend/test_conversation_routing.js — 6 assertions (source-level invariant + 5 behavioral routing cases)
  • pytest tests/integration/test_frontend_conversation_routing.py — pytest wrapper passes
  • Full unit suite: 4299 passed, 2 skipped
  • Manual: click Start Planning on a product, confirm EA's opening message renders in the CEO terminal (not just in logs)

🤖 Generated with Claude Code

The conversation_message handler in app.js routed agent replies to the
CEO terminal only when _currentConvType was 'oneonone' or 'ea_chat'.
Product planning conversations (opened via
_openProductPlanningConversation) set _currentConvType = 'product', so
EA replies arrived via the WebSocket event but were silently dropped:
they didn't match the terminal branch, and they didn't match the
chatPanel branch either (planning uses the terminal, not chatPanel).

The text still showed up in server debug logs because the LLM output
was logged at the trace layer — but the CEO never saw it in the UI,
making the planning conversation look completely broken.

Add 'product' to the type filter and reuse the EA label ('玲珑阁 (EA)')
since planning is always a CEO ↔ EA conversation.

Tests: tests/frontend/test_conversation_routing.js exercises a
behavioral mirror of the routing predicate plus a source-level
invariant. Wrapped in pytest via tests/integration/.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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