Repository navigation
WO-08: in-app chat in direct-model mode (stacked on #3) - #4
Merged
Merged
Conversation
… and history on the WO-07 routes; Intelligence-only controls hidden (WO-08) When /api/workspace reports mode direct-model, the chat column renders DirectChat (reusing ChatTranscript, Mascot and the chat-composer layout) and the sidebar uses LocalThreadList instead of the Intelligence thread service. Shows the Dot model (WO-03). Voice, computer, pages and Dot/Space editing are hidden with one plain note. Intelligence mode renders exactly as before.
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.
WO-08: in-app chat panel in direct-model mode
Base: stacked on #3 (head
b31611c), because #1, #2 and #3 weren't merged intodevvy/host-base-timeoutsyet (it was still at61dff53at 02:00 CT). Once they land, rebase ontodevvy/host-base-timeoutsand retarget. The only commit here isf422276.What changes
Intelligence mode is unchanged:
Chat,ThreadListwithuseThreads,CopilotKitProviderand every control render exactly as before. All new branches are guarded byisDirectMode(workspace), which isGET /api/workspace→mode: "direct-model"from #1.In direct-model mode:
src/client/DirectChat.tsxuses the same layout, CSS classes and components asChat.tsx:ChatTranscript(markdown bubbles),Mascot,chat-persona,chat-transcript,thinking,chat-error,chat-composerandsend-button. Only the transport differs:GET /api/conversations/:id/messagesloads on open and on reopen.POST /api/conversations/:id/messages {stream:true}, which shows SSEdeltaevents as they arrive, thendone.src/client/direct-chat.ts):DirectChatSessionis a small store the component reads withuseSyncExternalStore, plusstreamReply(SSE parser) andloadHistory.LocalThreadList, the sameThreadListmarkup with no IntelligenceuseThreads. Creating a thread from the start composer and the New chat buttons usePOST /api/conversations(WO-07: direct-model mode (Dot chat, threads, tasks without Intelligence) #1).dot.modelfrom WO-03: per-Dot model and desk key (stacked on #1) #2, otherwise the server default from/api/workspace).DIRECT MODEL. NoCopilotKitProvideris mounted.WorkspaceStategains optionalmodeandmodel, matching the WO-07: direct-model mode (Dot chat, threads, tasks without Intelligence) #1/api/workspaceresponse.Reused components (cited)
src/client/ChatTranscript.tsxsrc/client/Chat.tsx,style.css(live-chat,chat-persona,chat-composer,thinking,chat-error)src/client/Mascot.tsxsrc/client/ThreadList.tsxThreadListView; the Intelligence path still usesuseThreadssrc/client/api.ts(authHeaders,ApiError)src/server/direct-model/routes.tsDot.modelAcceptance and proof
tests/direct-chat.test.tsxhas 7 tests. The client runs against the real #1 routes (createApp+DirectModel), with a stub model that streams in pieces:sends a message and shows the reply as it streams, then saves it(asserts the intermediate statesHel,Hello,Hello there)loads saved history when a conversation is reopenedshows the server error and restores the conversation when a turn failsparses split SSE chunks and reports a stream error eventrenders history with the existing transcript, shows the model and hides Intelligence-only controlsuseThreadsis mocked to throw)lists local conversations without the Intelligence thread servicedetects direct mode and labels the Dot modelResults:
tscclean,npm run buildOK, eslint has only the base's 10 errors.Screenshot: a real browser run (headless Chromium through Playwright) against the built server (
dist/server/server/index.js) with no Intelligence key andOPENAI_BASE_URLpointed at a local streaming stub. The script started a conversation, waited for the streamed reply, reloaded, reopened the thread and confirmed history loaded. It also checked for the model label and the note, and confirmed there were 0 voice buttons and 0 computer buttons. Saved on the shared box at/workspace/projects/opendots-failover/proof/ui-chat-direct-model.png.Not in this PR
PUT /api/dots/:id, which answers 501 in direct mode. The model can be set withPUT /api/dots/:id/model(WO-03: per-Dot model and desk key (stacked on #1) #2). A follow-up can point the dialog at that route.