Repository navigation
Delete Natural Voice tokens the desktop discards, and never reset the saved voice on a failed read - #1207
Merged
Conversation
… saved voice on a failed read A token an approval delivers but the desktop never keeps (the poll answer lands after a cancel, a Turn off overtakes it, or the save fails) is now deleted at Hosted with the computer's own DELETE /api/voice/token, best effort and never under Nowhere. Turn off reads the token to delete inside the serialized section, so a token it clears mid-save is deleted too. A Turn off whose read failed wrote the defaults back, and standalone's file store rewrites the whole file, so the chosen voice reset. The file store now merges the one changed field into a fresh read (failing rather than resetting), and clearToken never caches defaults it did not read. VS Code's store already writes each field under its own key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
e1ff5bb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3769a29b.mouseterm.pages.dev |
| Branch Preview URL: | https://voice-discarded-tokens.mouseterm.pages.dev |
dormouse-bot
approved these changes
Oct 20, 2026
nedtwigg
requested a deployment
to
hosted-preview
October 20, 2026 00:09 — with
GitHub Actions
Waiting
This branch is waiting to be deployed
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.
Two follow-ups to #1191 on the desktop side of Natural Voice, ported from the superseded #1200 onto #1191's design. Hosted is unchanged: no
revokedAt, no revoke endpoint, no new migration.Tokens the desktop throws away are deleted at Hosted. The host now sends Natural Voice: tokens nobody sees, live until a year idle #1191's own-token delete (
DELETE /api/voice/tokenwith that bearer, via the existingforgetAtHosted) for a token it discards without keeping. That covers three cases:Before this, such a token stayed live at Hosted until a year idle. The delete is best effort and never awaited, and it sends nothing under Nowhere, the same as Turn off.
Turn off also deletes a token it clears mid-save. Turn off used to read the token to delete before queueing its clear. If a save was already queued, that read missed the new token, and the clear then removed it from disk without deleting it at Hosted. The read now happens inside the serialized section, after any save queued first.
A failed read during Turn off never resets the saved voice.
clearTokentreated a failed read as defaults and wrote the whole record. Standalone's file store rewrites the whole file, so a transient lock reset the chosen voice. That broke theManagedVoiceStore.readcontract.writenow merges the one changed field into a fresh read. If that read also fails, the write fails instead of resetting the voice.clearTokenno longer caches defaults it did not read.Spec:
alert.md→ "Managed voice" now says the host deletes every approved token it discards unsaved, not only on Disconnect.Test plan
lib/src/host/managed-voice-host.test.ts: one new test for the mid-save Turn off and one for a Turn off whose reads fail. Three existing tests now assert the delete: a late token after cancel, a Turn off during the saving notification, and a failed save. Each was mutation-checked: removing each fix line makes exactly its own test fail.ManagedVoiceSection.test.tsx,vscode-ext/test/managed-voice.test.tstsc -bin lib;tsc --noEmitin standalone and vscode-ext🤖 Generated with Claude Code