Skip to content

Chat redesign: conversational replies, streaming, completion report#74

Open
konard wants to merge 3 commits into
Payel-git-ol:masterfrom
konard:issue-70-913795612a15
Open

Chat redesign: conversational replies, streaming, completion report#74
konard wants to merge 3 commits into
Payel-git-ol:masterfrom
konard:issue-70-913795612a15

Conversation

@konard

@konard konard commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Chat redesign (closes #70)

The chat was purely a task-submission box: a casual message like привет got no real answer because it was treated as a task, so the chat felt dead. This PR makes the chat behave like a normal assistant while still launching workflows, and makes sure a finished task is always reported back.

What changed

1. Conversational replies in the user's language (apigateway/internal/fetcher/http.go)

  • Rewrote buildBossChatReply so messages that are not workflow/search requests get a real conversational answer: greetings, how-are-you, thanks, farewell, identity/help, and friendly fallbacks.
  • A plain привет / hello now gets a proper reply instead of an English-only canned line. Replies are returned in Russian when the message contains Cyrillic, English otherwise (new isRussian helper).
  • Task/search detection (shouldLaunchWorkflowFromChat / shouldLaunchSearchWorkflowFromChat) is unchanged, so создай php сервер and research queries still launch the pipeline — research mode keeps working.

2. Streaming typewriter effect (frontend/web/src/app/components/TypewriterText.tsx, Chat.tsx, App.tsx)

  • New TypewriterText component reveals boss replies character-by-character with a blinking cursor, so answers appear to be typed out in real time instead of popping in all at once.
  • Live boss replies animate; restored history, the user's own messages, and the frequently-updating progress message are shown instantly (animate flag on ChatMessage).
  • The chat keeps scrolling to the bottom on each reveal tick.

3. Completion report — the boss "отчитывается" (apigateway/internal/fetcher/http.go, frontend/web/src/hooks/useWebSocket.ts)

  • When a workflow finishes successfully, the boss posts a completion message to the chat (buildCompletionReport / sendCompletionReport): a headline in the request's language, the task title, the boss's own answer (chatSummary), and a link to the result (PR / repo / zip) when available.
  • Works for both chat-launched and canvas-launched tasks since both flow through processTaskStreamWS.
  • Removed the frontend's own chatSummary → chat posting so the report is not double-posted.

How to reproduce the original issue

  1. Open the chat and send привет. Before: silence / dead chat. After: a friendly Russian reply.
  2. Launch any task and wait for it to finish. Before: completion ended in silence. After: the boss reports back in chat with the result link.

Tests

  • Go (apigateway/internal/fetcher/http_test.go):
    • TestBuildBossChatReplyConversational — conversational replies, correct language for привет/hello/спасибо/thanks/capability/fallback.
    • TestSendCompletionReportContent — completion report includes headline, title, summary, result link, and matches the request language.
  • Frontend (scripts/check-chat-typewriter.mjs, wired into npm test):
    • TypewriterText reveals text incrementally and shows full text immediately when animate is false.
    • Chat renders boss messages via TypewriterText; App marks only fresh boss replies as animated.
    • useWebSocket no longer synthesises a completion message from chatSummary.

All Go tests (go test ./...) and the full frontend test suite + vite build pass.

konard added 2 commits June 10, 2026 17:39
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: Payel-git-ol#70
…ayel-git-ol#70)

Make the chat behave like a normal assistant while still launching
workflows, and never leave the user in silence (issue Payel-git-ol#70):

- Backend (apigateway): rewrite buildBossChatReply to answer casual
  messages (greetings, thanks, how-are-you, identity/help, farewell,
  fallbacks) in the user's language. A plain «привет» / "hello" now gets
  a real reply instead of an English-only canned line. Language is
  detected via a new isRussian() Cyrillic check.
- Backend: when a workflow finishes successfully the boss reports back
  in the chat via buildCompletionReport/sendCompletionReport — headline
  in the request's language, task title, the boss's own answer
  (chatSummary), and a result link (PR / repo / zip) when available.
- Frontend: new TypewriterText component reveals boss replies
  character-by-character so answers appear to be typed out in real time.
  Chat renders boss messages through it; live replies animate, while
  restored history, the user's own messages, and the frequently-updating
  progress message are shown instantly (animate flag on ChatMessage).
- Frontend: stop synthesising a completion message from chatSummary in
  useWebSocket — the backend now sends the completion report, avoiding a
  double post.
- Tests: Go table tests for conversational replies and completion-report
  content; frontend check-chat-typewriter.mjs wired into npm test.
@konard konard changed the title [WIP] Chat redesign Chat redesign: conversational replies, streaming, completion report Jun 10, 2026
@konard konard marked this pull request as ready for review June 10, 2026 17:54
@konard

konard commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

All three CI checks pass. The work for issue #70 is complete.

Summary

I redesigned the Octra chat to address all four requirements from issue #70, and updated PR #74 (now marked ready for review): #74

1. Normal conversation while still launching tasks — Rewrote buildBossChatReply in apigateway/internal/fetcher/http.go so casual messages (greetings, thanks, how-are-you, identity/help, farewell, fallbacks) get a real conversational answer. A plain привет / hello now replies properly instead of going silent or returning an English-only canned line. A new isRussian() Cyrillic check makes replies language-aware. Task/search detection is untouched, so создай php сервер and research queries still launch the pipeline (research mode keeps working).

2. Streaming typewriter effect — New TypewriterText component reveals boss replies character-by-character with a blinking cursor and auto-scroll, so answers appear typed in real time. Only live boss replies animate; restored history, the user's own messages, and the frequently-updating progress message render instantly (animate flag on ChatMessage).

3. Completion report ("отчитаться") — When a workflow finishes successfully, the boss posts a completion message to the chat via buildCompletionReport/sendCompletionReport: headline in the request's language, task title, the boss's own answer (chatSummary), and a result link (PR/repo/zip). Removed the frontend's duplicate chatSummary posting to avoid double-posting.

Tests — Go table tests (TestBuildBossChatReplyConversational, TestSendCompletionReportContent) plus a frontend check-chat-typewriter.mjs wired into npm test.

Verificationgo test ./..., the full frontend test suite, and vite build all pass locally, and all three CI checks (apigateway, frontend, all Go modules) pass on the PR.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $6.010721

📊 Context and tokens usage:

Claude Opus 4.8: (2 sub-sessions)

  1. 115.1K / 1M (12%) input tokens, 29.7K / 128K (23%) output tokens
  2. 72.4K / 1M (7%) input tokens, 15.2K / 128K (12%) output tokens

Total: (17.1K new + 250.0K cache writes + 6.2M cache reads) input tokens, 50.6K output tokens, $6.010721 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (2877KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@Payel-git-ol

Copy link
Copy Markdown
Owner

Исправь конфликты

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.

Chat redesign

2 participants