Skip to content

Hidden facets: platform-scoped, always-on system-prompt injection#796

Open
bdart wants to merge 2 commits into
mainfrom
feature/ermain-422-hidden-facets
Open

Hidden facets: platform-scoped, always-on system-prompt injection#796
bdart wants to merge 2 commits into
mainfrom
feature/ermain-422-hidden-facets

Conversation

@bdart

@bdart bdart commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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.

[hidden_facets.facets.outlook_baseline]
platform = "outlook"                 # optional; omit = applies on all platforms
additional_system_prompt = ""       # static or Langfuse, like regular facets

How

  • Injected as a System prompt for requests whose platform matches X-Erato-Platform (GenerationRequestContext.platform), or for a facet declaring no platform.
  • Injected once at conversation start, under the same gate as the base system prompt (should_add_system_prompts), then persists in generation_input_messages and 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.
  • Distinct AbstractChatSequencePart::HiddenFacetSystemPrompt variant (mirrors FacetAdditionalSystemPrompt); deterministic (id-sorted) order.
  • Threaded platform + hidden_facets into compose_prompt_messages / build_abstract_sequence_with_facet_tool_expansions.
  • Not added to the /facets response — never selectable.

Open decisions for (originated from — flagged in ERMAIN-422)

  1. Single-injection-at-start (implemented) vs re-inject every turn. Implemented matches the call note + the base-system-prompt pattern.
  2. 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 warnings clean; 45 prompt_composition tests pass; config-reference regenerated; OpenAPI unchanged. Inert until a [hidden_facets] entry is configured.

bdart added 2 commits July 3, 2026 13:27
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 hobofan self-requested a review July 6, 2026 07:35

@hobofan hobofan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

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.

2 participants