Skip to content

feat(nova): run spoken island requests as Nova threads - #374

Merged
yashdev9274 merged 1 commit into
mainfrom
supercli-nova-island-voice
Nov 26, 2026
Merged

yashdev9274 merged 1 commit into
mainfrom
supercli-nova-island-voice

Conversation

@yashdev9274

Copy link
Copy Markdown
Owner

The dynamic island signs in with the CLI device-code flow and sends each utterance to a Nova voice route, which runs it as a web thread and returns a two-sentence summary for Sarvam to speak. A shared voice link lets Nova show the code the island joins with.
EOF

Description

Please include a summary of the change and which issue is fixed.

Fixes #(issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • bun test passes
  • bun run typecheck passes
  • bun run lint passes (if applicable)

Checklist:

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

The dynamic island signs in with the CLI device-code flow and sends each
utterance to a Nova voice route, which runs it as a web thread and returns
a two-sentence summary for Sarvam to speak. A shared voice link lets Nova
show the code the island joins with.
EOF

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nova-agent Ready Ready Preview Nov 26, 2026 5:28am UTC
nova-agent-2eiu Error Error Nov 26, 2026 5:28am UTC
supercli Ready Ready Preview Nov 26, 2026 5:28am UTC
supercli-client Ready Ready Preview Nov 26, 2026 5:28am UTC
supercli-docs Ready Ready Preview Nov 26, 2026 5:28am UTC
vercel-supercodeai-integration Ready Ready Preview Nov 26, 2026 5:28am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

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.

Share

@yashdev9274
yashdev9274 merged commit aedac83 into main Nov 26, 2026
8 of 13 checks passed
@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Confidence Score: 1/5 · Fix voice authentication, the default address, shared turns, and approval responses before merging.RetriggerView in GreptileConfidence Score: 1/5 Tier: plus

[Medium impact] The change reaches the Jarvis voice workflow and its Nova web and CLI link services.

Fix voice authentication, the default address, shared turns, and approval responses before merging.

Findings

  1. P1 CLI tokens are rejected ▶
  2. P1 Voice requests use wrong port ▶
  3. P1 Connected links never receive turns ▶
  4. P1 Unfinished actions sound complete ▶
  5. P2 Shared messages stop arriving ▶
  6. P2 Expired codes stay on screen ▶
  7. P2 Spoken answers lose their ending ▶
  8. P2 Sign-in controls stay stale ▶
  9. P2 Retries lose the saved thread ▶

Summary

Adds device sign-in for the island, sends spoken requests through Nova threads, and returns short answers for speech. It also adds a shared link and a sidebar connection button.

  • Jarvis runs spoken requests as Nova threads and speaks a short summary.
  • Jarvis joins a Nova voice link using a sign-in token and short code.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Island[Jarvis island] --> Device[CLI device sign-in]
  Device --> Token[Terminal session token]
  Token --> Voice[POST /api/nova/voice/turn]
  Voice --> Auth[Web auth checks token]
  Auth --> Rejected[CLI token is rejected]
  Voice -. intended after auth succeeds .-> Turn[runWebTurn]
  Turn --> Summary[spokenSummary]
  Summary --> Speech[Island speaks answer]
  Nova[Nova sidebar] --> Link[CLI voice link]
  Island --> Join[Join and poll link]
  Join --> Link
  Link --> Presence[Connection status]
Loading

Reviews (1) · Last reviewed commit: "feat(nova): run spoken island requests a..." · Reviewed by Greptile

Comment on lines +29 to +31
const session = await auth.api.getSession({ headers: new Headers({ Authorization: `Bearer ${token}` }) })
if (!session?.user?.id || !session.user.email) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 CLI tokens are rejected

NovaSignIn gets a CLI session token, but this route passes it to the web app's auth.api.getSession. CLI sessions live in DATABASE_URL_TERMINAL; web auth uses DATABASE_URL and has no bearer plugin configured. Users can finish device sign-in but still get rejected here.

Check the token against the terminal session store, then map that user to the web account before creating the thread.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

/// Where Nova web runs. Spoken requests become threads here, so the
/// browser does not have to be open.
static var novaWebURL: String {
defaults.string(forKey: "nova_web_url") ?? "http://localhost:3000"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Voice requests use wrong port

novaWebURL defaults to port 3000, but the web app's dev:web and start commands both serve port 3003. Nothing else in Jarvis sets this new value, and Settings has no address field. With the normal local setup, spoken requests go to the wrong port.

Use the web app's actual address or expose a way to set it.

Suggested change
defaults.string(forKey: "nova_web_url") ?? "http://localhost:3000"
defaults.string(forKey: "nova_web_url") ?? "http://localhost:3003"

Comment on lines +326 to +330
let turn = try await novaService.run(content: text, sessionId: novaSessionId)
novaSessionId = turn.sessionId
response = turn.summary
state = .speaking
await ttsService.speak(turn.summary, apiKey: ttsAPIKey)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Connected links never receive turns

runNovaTurn never calls IslandLinkService.post. The only calls to the link service start the connection, and neither web route forwards turns into it. Even after the sidebar says “Island connected,” its turns stays empty.

Post the user's text and Nova's answer through the link when the turn runs.

Comment on lines +93 to +95
return NextResponse.json({
sessionId,
summary: spokenSummary(answer),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unfinished actions sound complete

Connected tools that need approval make runWebTurn finish with reason: "awaiting_input", without an error event. This route treats that as a completed answer. If no text came first, the island says “Done” even though the action has not run.

Check the finish reason and tell the user that Nova needs an answer or approval, including where to provide it.

Comment on lines +138 to +142
link.turns.push({ role, content: text, at: Date.now() })
if (link.turns.length > MAX_TURNS) link.turns.splice(0, link.turns.length - MAX_TURNS)
link.lastSeenAt = Date.now()
link.expiresAt = Date.now() + LIVE_TTL_MS
return { ok: true, cursor: link.turns.length }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Shared messages stop arriving

cursor is the retained array's length, but that length stops growing at MAX_TURNS. Once a reader reaches cursor 40, every later post removes an old turn and leaves the length at 40. Reading with since=40 then always returns an empty array.

Use a growing turn number and account for removed turns when reading.

Comment on lines +32 to +33
} catch {
// A dropped poll retries on the next tick; the link stays open.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Expired codes stay on screen

The polling loop retries every failure without clearing link. Waiting codes expire after ten minutes, and the server returns 404 rather than a closed view. The page therefore keeps showing the expired code; an expired live link likewise keeps saying it is connected.

Handle 404 as a closed link and let the user request a new code.

.trim()
.replace(/\s+([.!?])/g, "$1")
if (!clean) return "Done. I left the full result in your Nova thread."
const sentences = clean.match(/[^.!?]+[.!?]+/g) ?? [clean]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Spoken answers lose their ending

match drops a final sentence without punctuation whenever an earlier sentence has punctuation. For example, Found two options. Which one do you want becomes only Found two options. This can remove the question the voice user needs to answer.

Keep the remaining text as a sentence before taking the first two.

Suggested change
const sentences = clean.match(/[^.!?]+[.!?]+/g) ?? [clean]
const sentences = clean.match(/[^.!?]+(?:[.!?]+|$)/g) ?? [clean]

@State private var sarvamAPIKey: String = VoiceConfig.sarvamAPIKey
@State private var sarvamTTSSpeaker: String = VoiceConfig.sarvamTTSSpeaker
@State private var islandLinkCode: String = VoiceConfig.islandLinkCode
@State private var authToken: String = VoiceConfig.authToken

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Sign-in controls stay stale

authToken is a one-time @State copy of VoiceConfig.authToken. Device sign-in updates VoiceConfig, not this state, so the open Settings view still shows “Sign in to Nova” and an empty token field after success.

Observe the stored value or update this state when sign-in completes.

Comment on lines +44 to +46
guard let http = response as? HTTPURLResponse, http.statusCode == 200 else {
let message = json?["error"] as? String ?? "Nova could not run that."
throw NovaError.unavailable(message)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Retries lose the saved thread

The server includes sessionId when a turn fails after creating a thread, but this branch discards it. Because novaSessionId is saved only on success, a failed first turn makes the next utterance create another thread instead of continuing the saved request.

Carry the returned thread ID through the error and retain it for follow-ups.

This branch was successfully deployed

4 active deployments
Preview – supercli — ddf8c047 Deployed Nov 26, 2026 by vercel[bot]
Preview – vercel-supercodeai-integration — ddf8c047 Deployed Nov 26, 2026 by vercel[bot]
Preview – supercli-docs — ddf8c047 Deployed Nov 26, 2026 by vercel[bot]
Preview – supercli-client — ddf8c047 Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant