fix(foreground-fallback): make replay notification self-explanatory to the model - #1073
Merged
Merged
Conversation
Contributor
Greptile SummaryUpdates the foreground-fallback replay notification so fallback models receive a clear internal instruction instead of an ambiguous terse marker.
Confidence Score: 5/5The PR appears safe to merge, with no actionable regression identified in the changed replay notification. The new static reminder accurately describes every foreground-fallback trigger, follows the repository’s existing internal-reminder format, and preserves the original replay payload ordering and request shape. Important Files Changed
Reviews (1): Last reviewed commit: "fix(foreground-fallback): make replay no..." | Re-trigger Greptile |
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.
Fixes #1072
What problem are you solving?
The foreground-fallback hook replays the last user message with a fallback model and appends an internal synthetic part whose text is the terse string
Foreground fallback replay.(plus the<!-- SLIM_INTERNAL_INITIATOR -->marker). This part is sent to the model (intended — synthetic parts are hidden from the UI but reach the model), but the text is ambiguous: the model does not recognize it as an internal system instruction, treats it as a leak, and does not know how to handle it.What does this change?
Replaces the terse
Foreground fallback replay.text with a self-explanatory<system-reminder>block that tells the model the previous request failed, is being retried with a fallback model, to continue processing the user's original request, and not to respond to the reminder.Why this approach?
The
orchestrator-wakehook already uses the<system-reminder>wrapper pattern for internal initiators (ORCHESTRATOR_WAKE_TEXT/ORCHESTRATOR_STOPPED_JOB_WAKE_TEXT), which the model understands as an internal notification. The foreground-fallback replay is the same kind of system-level notification, so matching that pattern is the consistent choice. No other alternatives were considered — this is the established pattern for internal initiators in this repo.Related work
AI assistance
syntheticand to inspect TUI rendering.Checklist
bun run typecheckandbun testpass;bun run check:cihas pre-existing unrelated failures in other files (tracked by fix: resolve pre-existing check:ci failures (tui.ts + format) #1067) — this change's file passes Biome cleanlymasterbranch