Replace 'App:' prompt prefix with natural-language phrasing#333
Merged
Conversation
The 'App: <name>' label in the screen context section was leaking into model outputs, with completions occasionally echoing 'App: ...' as if it were continuation text. Rewriting it as 'User is on <name>.' removes the label-style cue without losing the signal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The 'App: ' label in the screen-context block was leaking into model outputs, with completions occasionally emitting 'App: ...' as if it were continuation text. Rewriting it as 'User is on .' keeps the signal but removes the label-style cue that encourages the bad pattern.
Validation
Linked issues
None.
Risk / rollout notes
Prompt-only change. Affects both the llama.cpp and Foundation Models renderers, so suggestion phrasing may shift slightly even for completions that previously behaved well.
Greptile Summary
This PR replaces the label-style
App: <name>line in the screen-context block with the natural-language sentenceUser is on <name>.across both the llama.cpp and Foundation Models prompt renderers, addressing a model-output artifact where the old key-value phrasing occasionally leaked into completions.LlamaPromptRendererandFoundationModelPromptRendererreceive the identical one-line wording change, keeping the two engines in sync.LlamaPromptRendererTestsandPromptPolicyTestsare updated to assert the new string, preserving full deterministic coverage of the prompt-rendering contract.Confidence Score: 5/5
Prompt-only, two-line change with no logic modifications; safe to merge.
The change is purely textual — one string literal replaced consistently in both renderers and both test files. No control flow, data model, or API surface is touched, and the existing deterministic tests continue to cover the exact output contract.
No files require special attention.
Important Files Changed
App: <name>→User is on <name>.in the screen-context block of the request prompt.App: SlacktoUser is on Slack.to match the new renderer output; no other test logic changed.App: TestApptoUser is on TestApp.to match the new Foundation Models renderer output; no other test logic changed.Sequence Diagram
sequenceDiagram participant SC as SuggestionCoordinator participant LPR as LlamaPromptRenderer participant FMPR as FoundationModelPromptRenderer participant M as Model (llama / Foundation) SC->>LPR: prompt(prefixText, applicationName, ...) LPR-->>SC: "Screen context:\nUser is on <name>.\n..." SC->>M: infer(prompt) SC->>FMPR: prompt(for: request) FMPR-->>SC: "Screen context:\nUser is on <name>.\n..." SC->>M: generate(instructions, prompt)Reviews (1): Last reviewed commit: "Replace 'App:' prompt prefix with natura..." | Re-trigger Greptile