feat(chat): cancel + block_id routing + replay + tests (0.8.0)#35
Merged
feat(chat): cancel + block_id routing + replay + tests (0.8.0)#35
Conversation
PR-2 of the chat-system completeness work. Adds four properties to the chat surface in the VS Code extension. Co-Authored-By: Oz <oz-agent@warp.dev>
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
PR-2 of the three-PR chat-system completeness work. This adds four properties to the chat surface so the extension can power real multi-turn / multi-session work end-to-end:
specsmith chatprocesses.block_id-keyed decision routing via the newChatSessionRegistry— sessions are indexed by id and everytool_request/block_start kind=diffblock_id is tagged with the session that emitted it. Decisions arriving from the panel route deterministically to the child that actually owns that block_id, so concurrent sessions no longer clobber each other's stdin.ChatHistorymodule — every header / event / exit record is appended as JSONL to<projectDir>/.specsmith/sessions/<id>/events.jsonl. The first time the panel is opened against a project that has prior sessions, the most-recent one is replayed under areplay: <id>divider. Empty-utterance invocations ofspecsmith.openChatreuse this path to surface history without starting a new turn.src/test/chat-session-registry.test.ts(routing semantics, observe/forget, fallback rules) andsrc/test/chat-history.test.ts(round-trip persistence, JSONL parsing, session listing).The README also gets a new "Voice input (Web Speech API)" section explaining mic-permission expectations and the graceful fallback to text input when the API is unavailable.
Files
src/ChatSessionRegistry.ts(new) — pure routing logic; novscode/child_processimports.src/ChatHistory.ts(new) — JSONL append / read / list; pure stdlib.src/ChatPanel.ts— Cancel button,replay(),setRunning(), programmaticdispose(),replay-dividerstyle andrunning/replay_dividerinbound messages.src/ChatStreamConsumer.ts— rewritten around the registry + history modules; legacy_running: Map<projectDir, RunningSession>removed.src/test/chat-session-registry.test.ts(new),src/test/chat-history.test.ts(new).package.json— version bump to 0.8.0.package-lock.json— synced to 0.8.0 / engines^1.116.0.CHANGELOG.md,README.md— entries for the new behaviour and the voice-input docs.Verification
npm run lint(tsc --noEmit): clean.npm run build(esbuild): 241.7kb bundle.npm test: 41 passing (was 23 before the new tests).Artifacts
Co-Authored-By: Oz oz-agent@warp.dev