Fix dictation prompt role separation#392
Conversation
0e90bff to
b9b0ba5
Compare
|
Rebased onto current \ and resolved the conflict in \ by preserving the newer package pins alongside this change. Force-pushed the updated branch. I attempted , but this machine is currently blocked by a local Swift toolchain/SDK mismatch plus cache permission errors, so I couldn’t complete runtime verification here. |
Greptile SummaryUpdates dictation prompt composition while preserving legacy transcript templates.
|
| func testDictationUserMessageWrapsTranscriptWithoutPromptInstructions() { | ||
| let userMessage = SettingsStore.renderDictationUserMessage( | ||
| promptText: "Clean up this transcript and output only the edited text.", | ||
| transcript: "hello fluid voice" | ||
| ) | ||
|
|
||
| XCTAssertEqual(userMessage, "<transcript>\nhello fluid voice\n</transcript>") | ||
| XCTAssertFalse(userMessage.contains("Clean up this transcript")) | ||
| } | ||
|
|
There was a problem hiding this comment.
Cover complete message composition
This test exercises only renderDictationUserMessage, so it does not verify that ordinary prompts become system messages or that ${transcript} templates continue to omit the system role. Add coverage for the complete message array in both cases to protect the role-separation behavior this change introduces.
Knowledge Base Used: AI Enhancement Pipeline
Prompt To Fix With AI
This is a comment left during a code review.
Path: Tests/FluidDictationIntegrationTests/DictationE2ETests.swift
Line: 1468-1477
Comment:
**Cover complete message composition**
This test exercises only `renderDictationUserMessage`, so it does not verify that ordinary prompts become system messages or that `${transcript}` templates continue to omit the system role. Add coverage for the complete message array in both cases to protect the role-separation behavior this change introduces.
**Knowledge Base Used:** [AI Enhancement Pipeline](https://app.greptile.com/altic/-/custom-context/knowledge-base/altic-dev/fluidvoice/-/docs/ai-enhancement.md)
How can I resolve this? If you propose a fix, please make it concise.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!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9b0ba5974
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let trimmedPrompt = promptText.trimmingCharacters(in: .whitespacesAndNewlines) | ||
| if trimmedPrompt.isEmpty { return transcript } | ||
| return promptText + "\n\n" + transcript | ||
| return "<transcript>\n\(transcript)\n</transcript>" |
There was a problem hiding this comment.
Update the custom-prompt request-body test for separated roles
For every non-placeholder custom prompt, this return value no longer contains promptText, but testCustomPromptOnly_omitsBasePromptFromEffectivePromptAndRequestBody in LLMClientRequestBodyTests.swift still constructs a request containing only this user message and then asserts that the message contents include profile.prompt. That test is part of the FluidDictationIntegrationTests target and will now fail deterministically; update it to construct the new system-plus-user message layout.
Useful? React with 👍 / 👎.
Description
Fixes dictation post-processing prompt composition so cleanup instructions are sent as the system message and the transcript is sent separately as tagged user content. Legacy custom prompts that still use
${transcript}continue to render with replacement behavior.Type of Change
Related Issues
Testing
swiftlint --strict --config .swiftlint.yml Sourcesswiftformat --config .swiftformat Sourcessh build_incremental.shAdditional validation run locally:
xcodebuild clean build -project Fluid.xcodeproj -scheme Fluid -destination platform=macOS,arch=arm64 -derivedDataPath /private/tmp/FluidVoiceDerivedData CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -quietxcodebuild test -project Fluid.xcodeproj -scheme Fluid -destination platform=macOS,arch=arm64 -derivedDataPath /private/tmp/FluidVoiceDerivedData CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -quietgit diff --checkNotes
modelcontextprotocol/swift-sdkto 0.12.1 because the previously pinned 0.10.2 fails to compile under Xcode 26.5 / Swift 6 strict-concurrency checking.sh build_incremental.shcurrently fails in this checkout because it referencesbuild_dev.sh, which is not present in the repository. Directxcodebuildbuild and test commands passed instead.swiftformat --config .swiftformat Sourceswas not committed because it rewrites broad pre-existing formatting drift outside this focused bugfix.Screenshots / Video
N/A - no UI changes.