feat: command system, stable session switch, streaming, and UI polish#58
Open
gzjggg wants to merge 25 commits into
Open
feat: command system, stable session switch, streaming, and UI polish#58gzjggg wants to merge 25 commits into
gzjggg wants to merge 25 commits into
Conversation
Add slash completion, Command Center, Hephaestus-style session cover, Pi switchSession sidebar switching, browser-close shutdown, port 38471 defaults, and UI polish. Brand mark black body is 34x36. Dual English and Simplified Chinese READMEs for the gzjggg/tau public fork.
Removed reference to session cover inspired by pi-ui-hephaestus.
Removed a reference to the inspiration for the session cover.
Live Pi switch is limited to sessions under the current working directory so the GUI never waits on TUI cwd-missing confirmation. Other-directory sessions open read-only and render grey/compact with an RO tag. Code blocks and tool cards shrink-wrap to content width.
session_shutdown no longer stops HTTP/WS (that fired on every switch and dropped browser clients). session_start rebinds and broadcasts when already running. Tab-close shutdown is suppressed during switch ops and ignores bfcache pagehide.
After switchSession, broadcast snapshot and recover if TUI already moved. Browser close only stops the mirror (exitProcess opt-in). Tool/thinking/code cards use unified width with right gutter.
Sidebar only opens history read-only; never calls switchSession (that path reloaded memctx and tore down the process). Remove pagehide/beacon/process.exit. Live session follows TUI /resume.
Same-cwd sidebar clicks call /api/sessions/resume which runs the same handleResumeSession path as picking a session after /resume, with cwd preflight and process.exit blocked. Other dirs stay history-only. Tool/thinking/code cards share a max width and right gutter.
Load session history via /api/sessions/by-path to avoid Windows dir encoding failures. Soft-succeed resume when live file already matches. Force tool/thinking/code min-width so thinking no longer collapses. Cache-bust static assets v1.1.3.
Root cause of resume failure: closed-over ExtensionCommandContext became invalid after switch (Pi stale-ctx error). Capture interactive handleResumeSession instead, pass withSession to update latestCtx, treat stale errors as soft success, never notify/snapshot via old ctx.
After browsing a foreign-dir session, re-selecting a same-cwd session cleared the chat and waited on mirror_sync which could arrive empty and show a blank UI. Always load by-path history first, then overlay live sync; empty snapshots no longer wipe existing content.
Prompts no longer call stale latestCtx.isIdle (which swallowed sends). Use session.prompt / sendUserMessage via rebinding path. Wire GUI new session to interactive newSession. Re-enable pagehide exit with exitProcess, suppressed only during resume/new ops.
Auto-open / leftover Tau tabs sent pagehide exit beacons that killed Pi immediately after switchSession was captured. Block process.exit and stopServer for 25s after listen; client skips exit until page is 8s old and had a live WebSocket; skip exit if other clients remain.
Startup 秒退 was leftover Tau tabs sending exit beacons. Disable exitOnBrowserClose unless settings explicitly set true. Ignore all shutdown beacons during 60s grace. Stop auto pagehide exit client-side.
Intercept process.exit and process.kill(self) so leftover browser beacons cannot 秒退 Pi. Log tau-2026-07-14-no-exit-v3 on load so users can verify the new extension is actually running.
ReferenceError barePath is not defined when /api/shutdown hit on startup from leftover browser tabs. Define barePath at top of handleApiRoute and use it consistently.
Stop intercepting process.kill — signal 0 is used by getRunningInstances and was spamming TUI. Prefer pi.sendUserMessage for prompts so mirror events fire; put eventType last when spreading event payloads.
Slim high-frequency event payloads and circular-safe JSON.stringify so message_update reaches browsers. Create streaming bubble if message_start was missed. Stop blocking kill(pid,0) noise.
Pi re-invokes the extension factory on every session switch. Local clients Set was empty after rebind so message_update never reached browsers. Hoist server/clients/latestCtx to module scope.
HTTP handlers started by the first factory closed over a stale ExtensionAPI after switchSession. Keep module-level activePi updated on every factory invoke; cycle/set thinking and model use getApi().
Use getApi() in buildStateSnapshot/session cover/auto-title so they do not touch a stale factory pi. Broadcast thinking_level_changed. Show GUI error if cycle thinking fails. Stop intercepting process.exit so Pi /quit works again.
Active model highlight uses provider and id so the same model on deepseek vs bailian is not double-selected. Header shows provider when ids collide. Gate routine Mirror/Tau console output behind TAU_DEBUG=1 and shrink startup notify/status line.
Personal-tool policy B: listen on 127.0.0.1 by default; enable LAN with TAU_REMOTE=1 or tau.remote=true (non-loopback host still works). Restrict session delete to sessions dir and file APIs to workspace; sanitize markdown URLs and escape plain text; safe file-browser names.
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.
Summary
Upstream-oriented subset of work that originated in gzjggg/gzTau (product line; formerly
gzjggg/tau). This PR is opened from gzjggg/tau-pr (fork of deflating/tau) and is not the primary product tree.Product (full stack, including Desktop): https://github.com/gzjggg/gzTau
This PR: contribution slice for upstream review (web/command/session fixes; no Tauri desktop packaging).
Highlights (in this PR)
/resumepath; other-directory sessions are read-only historyactivePi+ shared WebSocketclientssingleton so prompts, thinking level, model, and streaming survive session replacementbarePathReferenceErroron/api/shutdownprovider + idso the same model on multiple providers is not double-highlightedTAU_DEBUG=138471Not in this PR (stays on gzTau only)
gzTau)Test plan
pistart loads Tau without crash; browser connectsTAU_DEBUG=1)Notes