Unify guest + assistant into one inline streaming chat#646
Merged
Conversation
The landing page (`/` logged out) redirected the query box to the heavy `/agent` flow page, while the logged-in assistant (`/`) used a separate inline chat that kept no server-side memory, and the `/agent` page used a third "continue=flow" model. Guest follow-ups lost all context because guest flows are never persisted, so the continue lookup found nothing. Collapse the two `/` surfaces onto one shared inline streaming chat: - home/chat.go: new self-contained `chatComponent(guest)` — streams the SSE response from POST /agent inline, keeps the thread in the DOM + sessionStorage, threads recent turns back to the server for context, and shows an inline sign-up CTA when a guest hits the free limit. - home/landing.go: guest `/` now uses the inline chat in its branded hero instead of redirecting to /agent; accepts ?q= and ?prompt= prefill. - home/assistant.go: logged-in `/` uses the same component. - agent/agent.go: handleQuery accepts an optional client-supplied `history` array, giving multi-turn memory to guests and the inline chat without server-side persistence. Also accept ?q= as a prompt alias on the /agent page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdcPjN9ndJwMGKQSRrAGPE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The landing page (
/logged out) redirected the query box to the heavy/agentflow page, while the logged-in assistant (/) used a separate inline chat that kept no server-side memory, and the/agentpage used a third "continue=flow" model. Guest follow-ups lost all context because guest flows are never persisted, so the continue lookup found nothing.Collapse the two
/surfaces onto one shared inline streaming chat:chatComponent(guest)— streams the SSE response from POST /agent inline, keeps the thread in the DOM + sessionStorage, threads recent turns back to the server for context, and shows an inline sign-up CTA when a guest hits the free limit./now uses the inline chat in its branded hero instead of redirecting to /agent; accepts ?q= and ?prompt= prefill./uses the same component.historyarray, giving multi-turn memory to guests and the inline chat without server-side persistence. Also accept ?q= as a prompt alias on the /agent page.Claude-Session: https://claude.ai/code/session_01KdcPjN9ndJwMGKQSRrAGPE