Repository navigation
feat: handover card, session divider and mode label (E8.3) - #693
Conversation
…stream (E8.3); tested on a real DOM incl. reload and History
Preview Deployment
This preview will be updated automatically when you push new commits. |
…ule; card is a group; started speaks summarized too (tested)
|
Review round 1 outcomes (fixes in one commit on this branch):
Tested: |
…ls on the two-class regression (tested, mutation-checked)
|
Review round 2 outcome.
|
|
PM verdict: not merged. The frontend criteria look covered (handover card, mode label, restore, updated events test; review rounds 1 and 2 have outcomes). Unmet against this PR's brief: the backend criteria (tier and conversation_id columns, migration test, model-routing tests, conversation-cost query tests, cost-report CLI) live in #694, which is still open and not in this diff; the cost-report output from a copy of the dev database has not been posted on #678 with the follow-up note; and |
# Conflicts: # CHANGELOG.md # frontend/osa-chat-widget.js
Summary
The widget now draws the quick-to-analysis handover that the server already streams (E8.3, board A6).
<details>"What the analysis model is told" that holds the summary as text, a line saying the summary could not be written when it isdegraded, and "Handing it to the analysis model with your question".role="separator"divider, "Analysis session · Claude Sonnet 5.5", with the label taken from the widget's model list (an unknown id is shown as given).done.modeputs aQuickorAnalysispill (aria-label"Mode: ...") in the header, a "Quick answers" tag on quick replies, and the footnote above the input. All three are absent for a community whose stream sends no mode, and a first-message flip (no handover events) shows the label and no card.normalizePersistedMessage(summary at most 2000 characters, counts whole numbers, model must be a valid id), so a reload and a chat opened from History bring the card, divider and label back; a new chat clears them.textContent, so a summary containing<img onerror>stays inert (tested).// --- Handover (E8.3) ---block after the Fresh chat on return block, with its CSS after the history CSS; one hook call per message inrenderMessagesplus one sync call after the loop. The run card, plan and notebook code are untouched.The diff for E8.3 and E8.4 together was about 2000 lines, over the 1500 lines the brief allows, so the backend half is split out as its own PR (#694, branch
feature/issue-678-cost-per-conversation): thetierandconversation_idcolumns, the per-conversation query andosa metrics cost-report. The two are independent; this PR needs nothing from that one (done.modeis already merged).Closes #677
Refs #678
Tests and commands
bun frontend/test-widget-handover-card.js: 90 passed, 0 failed (new; happy-dom, real widget, SSE throughfetch)bun frontend/test-widget-handover-events.js: 14 passed, 0 failed (updated: the "events change nothing" assertions are replaced; session adoption,done.session_idand the single reply are kept)bun frontend/test-widget-history-store.js,test-widget-history-panel.js,test-widget-run-card.js,test-widget-tools.js,test-widget-context-switch.js: passfrontend/test-*.jsexits 0node --check frontend/osa-chat-widget.js: okuv run pytest tests/test_frontend tests/test_metrics tests/test_api/test_model_routing.py tests/test_api/test_streaming_metrics.py tests/test_agents/test_model_routing.py tests/test_cli -q: 663 passed, 2 skippeduv run ruff check . && uv run ruff format --check .: cleanNot run: a manual look at the card in a browser against develop-demo (no Chrome session here); the layout follows board A6 and reuses the widget's notice colors, so it follows light and dark mode.