Hidden facets: platform-scoped, always-on system-prompt injection#796
Open
bdart wants to merge 2 commits into
Open
Hidden facets: platform-scoped, always-on system-prompt injection#796bdart wants to merge 2 commits into
bdart wants to merge 2 commits into
Conversation
New [hidden_facets.facets.<id>] config (ERMAIN-422): baseline system prompts that are always-on, not user-selectable, and never in the facet pool. Injected once at conversation start (same gate as the base system prompt) for requests whose platform matches X-Erato-Platform, or for a facet with no platform; then persists in history. Threaded platform + hidden_facets into compose_prompt_messages.
hobofan
requested changes
Jul 6, 2026
hobofan
left a comment
Contributor
There was a problem hiding this comment.
I think it makes more sense to instead base this on subkeys on [facets.facets.<facet_id>], like hidden = true and hidden_always_active_for_plaftorm = "outlook".
This way we are not creating another full variant of facets that themselves are special in terms of prompt composition, etc. By re-using the same mainline facet mechanism, we can re-use all of the existing functionality (e.g. also model settings control, etc.)
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.
Closes ERMAIN-422. Off
main, independent of the client_tools PRs.What
A new
[hidden_facets.facets.<id>]config: baseline system prompts that are always-on, not user-selectable, and never appear in the facet pool — for platform-specific behavior that should wrap the experience as a baseline.How
platformmatchesX-Erato-Platform(GenerationRequestContext.platform), or for a facet declaring no platform.should_add_system_prompts), then persists ingeneration_input_messagesand replays on later turns. This matches the call's "single injection at the start, not per-turn" conclusion and avoids the accumulation regular facets guard against with toggle detection.AbstractChatSequencePart::HiddenFacetSystemPromptvariant (mirrorsFacetAdditionalSystemPrompt); deterministic (id-sorted) order.platform+hidden_facetsintocompose_prompt_messages/build_abstract_sequence_with_facet_tool_expansions./facetsresponse — never selectable.Open decisions for (originated from — flagged in ERMAIN-422)
platform: Option(None = all platforms, implemented) vs required.Verification
New test
test_hidden_facets_injected_for_matching_platform_only(platform match + all-platforms + non-match).clippy --all-targets --locked -D warningsclean; 45 prompt_composition tests pass; config-reference regenerated; OpenAPI unchanged. Inert until a[hidden_facets]entry is configured.