Repository navigation
feat(speech): set the OpenAI dictation key on a headless host - #31230
Merged
Merged
Conversation
…peech openai-key)
Cloud dictation needs an OpenAI key on the host that transcribes, and
desktop Settings was the only way to save one. A headless orca serve or
managed server had none. speech.openAiKey.{status,set,clear} save it
through the host's existing key store and secret sealing; the CLI reads
the key from stdin so it never lands in shell history.
…ethods; one key length cap; PowerShell example (Opus review)
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
ELI5
Cloud voice dictation, which uses OpenAI's models, needs an OpenAI key saved on the machine that does the transcribing. Until now the only way to save one was desktop Settings, so a headless server had no way to use cloud dictation at all. This PR adds a small command that saves the key on the server:
What Changed
Before: on a headless
orca servehost, or a managed SSH or WSL server, there was no way to save an OpenAI key there. A key saved through the desktop can't be read by the headless server, so cloud dictation stayed unavailable.After:
orca speech openai-key status | set | clearmanages the key on whichever host the CLI targets: the local one, or a paired remote one with--host. Once the key is saved, the cloud models show as ready on the phone.How it works:
speech.openAiKey.status(workspacepermission) reports{configured, protection}.speech.openAiKey.setandspeech.openAiKey.clear(settings-writepermission) save and remove the key through the existingopenai-api-key-store.method_not_found.Why
The key belongs on the host that transcribes. On a headless host, the RPC is the only way in. This reuses the existing key store, which keeps one storage format and one sealing path, and the desktop path is unchanged.
Alternatives I rejected:
settings.update. A secret doesn't belong in a general settings write that echoes settings back.speech.dictation.setup. An older host would silently drop it, and the client would believe the key was saved.Linked Issue
Refs #31174. Follow-up to #31217, reported by @delorean2020.
Visual Proof
N/A. This is a CLI and RPC addition; the command output is plain text, for example "OpenAI key saved on this host."
Testing
Tests:
src/cli/handlers/speech.test.ts:method_not_foundto the update messagesrc/main/runtime/runtime-mobile-speech-openai-key.test.ts: save, status and clear go through the key store, and the parameter schema trims input and rejects an empty key.Not verified live: the packaged orcad build fails its own smoke step on this machine right now (the bundled file watcher times out under load; this has nothing to do with this change), so I didn't run the command against a live server.
Review
gpt-6.1-sol, high), round 1: no findings. Round 2: see the follow-up comment.Agent skill upstream boundary
Notes
speechcommand family was already marked as host-owned.trim()drops\r\nand a byte-order mark, so a key piped from PowerShell or cmd works.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)