fix(web): connect the chat to the daemon end-to-end

- ws auth frame now carries the token top-level (docs §3.3); daemon accepts payload.token too
- entries route accepts workspaceId/sessionFile so disk-only sessions page history
- chat registers session metadata and pages history for non-live sessions
- e2e asserts a real ASSISTANT reply (PONG) and waits up to 180s
- visual.sh: real daemon + pairing + Playwright screenshots of the four pages
This commit is contained in:
yuez committed 2026-10-21 14:23:09 +08:00
1 parent 721661177c
commit 854d6d2997
8 files changed
+148 -17

No files matched your search

+1 -1
View File
@@ -216,7 +216,7 @@ export class PiWsClient {
socket.onopen = () => {
if (this.socket !== socket) return;
this.setState("authenticating");
this.send({ v: 1, type: AUTH_FRAME_TYPE, payload: { token: this.token ?? undefined } });
this.send({ v: 1, type: AUTH_FRAME_TYPE, token: this.token ?? undefined });
this.authTimer = setTimeout(() => {
if (this.state !== "authenticating" || this.socket !== socket) return;
this.handlers.onError?.(new Error("WebSocket auth timed out"));