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

Copy link
Copy Markdown

Summary

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.

Fixes #307

@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 👍 / 👎.

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

1 participant