Skip to content

Thread cost in the header, per-event notification switches, and optional cloud voice input - #1732

Merged
currentbits merged 5 commits into
mainfrom
coder/1725-polish-thread-cost-per-event-notifi-988671
Oct 29, 2026
Merged

currentbits merged 5 commits into
mainfrom
coder/1725-polish-thread-cost-per-event-notifi-988671

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #1725.

What changes for users

  1. Thread cost in the header: a compact $1.43 badge next to the context ring, with a tooltip split per model. It reuses the existing cost data and formatter and is hidden when cost is unknown or zero.
  2. Per-event notification switches (Settings › General):
    • Approval needed, turn finished, turn failed and automation finished: all on by default, exactly as before.
    • New CI failed on a watched PR alert, off by default; it needs PR watch on the thread.
    • Same gates as today: window focus, mute/snooze, and the master switch. The switches also decide when the sound plays.
  3. Optional cloud voice input, OpenAI or ElevenLabs:
    • Local stays the default and its recording path is unchanged.
    • With a cloud provider and key set, the audio the composer already streams is uploaded as one WAV when you stop.
    • On a cloud error, the same audio replays through the local model and the transcript carries a visible note.
    • Keys are sealed via secretGroups() (Encrypt stored provider secrets by default (safeStorage is opt-in today) #1715) and reach the renderer only as hasOpenaiKey / hasElevenlabsKey.

Skipped: the "long-running command (>30s)" notification. The runner can't detect it cheaply, so it was left out rather than faked.

Review notes

  • Main is merged in (799c9945). Six conflicts with Start and continue threads from Telegram, with approvals as chat buttons #1728 (Telegram), all two additive blocks: secrets.js groups, mcp.js redactSettings, settings normalize / methods, and two full-settings snapshot tests now carrying telegram, notifyEvents and speech.
  • An explicit test proves old settings produce identical notification decisions.

Testing (on the combined tree)

  • typecheck + IPC preload check, vite build: pass
  • electron 5139/5139, renderer 3235/3235, nothing cancelled
  • New tests:
    • notify.test.js: per-event gate, defaults unchanged, CI failed
    • speech.test.js: provider selection with mocked fetch, fallback to local, key sealed and redacted
    • threadHeader.test.tsx: cost badge
    • settings UI tests

🤖 Generated with Claude Code

Willem and others added 5 commits October 29, 2026 08:41
…rt (#1725)

Approval needed, turn finished, turn failed and automation finished default
on, so stored settings notify exactly as before. CI failed rides PR watch's
new-failing-check detection and is off by default. Long-running command is
skipped: the gate only sees thread status, not tool timing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…back to local (#1725)

Local stays the default and its recording path is unchanged. With a cloud
provider and key set, the PCM the composer already streams is buffered and
uploaded as one WAV on stop. On a cloud error the same audio replays through
the local model and the transcript carries a visible note. Keys are sealed via
secretGroups and reach the renderer only as hasOpenaiKey / hasElevenlabsKey.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ead-cost-per-event-notifi-988671

# Conflicts:
#	electron/mcp.js
#	electron/secrets.js
#	electron/store-normalize.js
#	electron/store-settings-methods.js
#	electron/test/auto-settle-settings.test.js
#	electron/test/budget-spend.test.js
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T08:27:13.200499Z 799c994 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 799c9945de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread electron/speech.js
} catch (err) {
if (cloudActive !== session) return; // cancelled meanwhile
const why = err && err.message ? String(err.message) : "Cloud transcription failed.";
cloudActive = null;

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 Badge Preserve cancellation identity during local speech fallback

When a cloud request fails and local fallback begins, clearing cloudActive loses the session ID held by useComposerSpeech; openSession() then generates a different ID. Cancelling dictation during sidecar startup or local transcription therefore makes cancel() reject with Unknown speech session, while replay continues and subsequent recording attempts remain blocked until it finishes. This is reproducible by pausing sidecar readiness and cancelling with the original cloud session ID. Preserve the caller-visible session identity and cancellation state across the fallback awaits.

Useful? React with 👍 / 👎.

Comment thread electron/notify.js
Comment on lines +160 to +162
if (windowFocused || !thread || thread.muted) return null;
if (settings.notifications === false) return null;
if (!notifyEventEnabled(settings.notifyEvents, "ciFailed")) return null;

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 Badge Apply the snooze gate to CI failure notifications

With CI-failure notifications enabled and the app in the background, a watched thread with an active snooze still produces a desktop alert because this helper checks mute but never calls isEffectivelySnoozed. Neither observePr() nor notifyChecksFailed() applies that gate, whereas the existing thread-transition notification path in main.js explicitly does. Apply the same effective-snooze predicate here so the new event respects the user's notification snooze.

Useful? React with 👍 / 👎.

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.

Small Cline-parity polish: thread cost in header, per-event notifications, voice provider choice

1 participant