Skip to content

feat: add toggle to send only the user's dictation prompt without the forced base prompt#464

Open
mvanhorn wants to merge 1 commit into
altic-dev:mainfrom
mvanhorn:fix/307-dictation-prompt-override-toggle
Open

feat: add toggle to send only the user's dictation prompt without the forced base prompt#464
mvanhorn wants to merge 1 commit into
altic-dev:mainfrom
mvanhorn:fix/307-dictation-prompt-override-toggle

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jun 28, 2026

Copy link
Copy Markdown

Description

Adds a sendCustomPromptOnly toggle so AI Enhancement sends only the user's custom dictation prompt, without the forced base prompt prepended. This matches the "yolo toggle" approach @grohith327 endorsed on the issue: the resolution point is SettingsStore's prompt composition, routed through a new systemPrompt(forCustomProfileBody:mode:) helper. Default behavior is unchanged; the base prompt is only dropped when the toggle is on.

Adds request-body tests covering both toggle states.

Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Closes #307

Testing

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS version: 26.3
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources (0 violations)
  • Ran formatter locally: swiftformat --config .swiftformat Sources (files touched by this PR are clean; remaining repo-wide drift is pre-existing)
  • Ran tests locally: request-body tests for both toggle states are included in the PR; the suite runs in CI

Screenshots / Video

The new toggle in AI Enhancement > Advanced Prompts:

Off (default, unchanged behavior):

Send Custom Prompt Only - off

On:

Send Custom Prompt Only - on

Notes

The toggle only affects custom Dictate prompts; the built-in default prompt path is untouched. Built and ran this branch locally on Apple Silicon to capture the screenshots above.

@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

if enabled {
let combined = self.viewModel.combinedDraftPrompt(self.viewModel.draftPromptText, mode: self.viewModel.draftPromptMode)
self.promptTest.activate(draftPromptText: combined)

P2 Badge Apply the custom-only toggle in prompt test mode

When test mode is enabled from a Dictate prompt editor, the draft prompt is still passed through combinedDraftPrompt, which always prepends the built-in base prompt and does not consult sendCustomPromptOnly. With the new toggle on, the test request therefore exercises a different prompt than the one this setting is meant to send, so users can get misleading test output before saving or using the prompt.

ℹ️ 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 on lines +1202 to +1203
if normalizedMode == .dictate, self.sendCustomPromptOnly {
return trimmedBody

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 Badge Honor custom-only prompts on the recording path

When a user enables this toggle and selects a custom Dictate prompt for the primary or secondary shortcut, the live recording path never reaches this new helper: applyDictationShortcutSelectionContext builds promptModeOverrideText with SettingsStore.combineBasePrompt(...) (ContentView.swift:3399-3402), and processTextWithAI prefers that non-empty overrideSystemPrompt before calling buildSystemPrompt (ContentView.swift:1819-1822). In that common selected-profile scenario, the built-in base prompt is still prepended even though sendCustomPromptOnly is true, so the advertised feature only works for paths that resolve through SettingsStore directly, such as app-bound profiles.

Useful? React with 👍 / 👎.

Comment on lines +342 to +346
var sendCustomPromptOnly: Bool {
get { self.defaults.bool(forKey: Keys.sendCustomPromptOnly) }
set {
objectWillChange.send()
self.defaults.set(newValue, forKey: Keys.sendCustomPromptOnly)

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 custom-only prompt setting in backups

This new persisted setting is not included in SettingsBackupPayload/settingsBackupPayload() and restore(from:) never reads it back, so exporting and importing a backup silently resets the toggle to the default false. For users who rely on custom-only Dictate prompts, a restored machine will start prepending the built-in base prompt again even though their prompt profiles and selections were restored.

Useful? React with 👍 / 👎.

@grohith327

Copy link
Copy Markdown
Collaborator

@mvanhorn Can you update the PR description in the new template and also add screenshots/video for testing

@mvanhorn

Copy link
Copy Markdown
Author

Done - the description now follows the PR template, and I added before/after screenshots of the new Send Custom Prompt Only toggle in the AI Enhancement > Advanced Prompts pane (built and ran the branch locally on macOS 26.3 to capture them).

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.

[🐞 BUG] Static dictation prompt for AI Enhancements sent with user's added prompt

2 participants