Chat Feature Flags

Status: Phases 1–3 shipped (2026-04-30) · Phase 3.5 (Feature Settings modal + user defaults) shipped (2026-09-04) · Phase 4 blocked on Echo charging infrastructure Related: Mode-Specific Lorebook Injection, Model Profile Base Prompts & Flavors, Design Principles

Shipped state (2026-04-30): smart-skip on the embedding step, pre-send composer indicator, HowDrawer feature surface (Behavior / Active Features / Coming Soon) with real toggleable rows, Features.* keys with provider-level pipeline gating + Memories→Summaries cascade, embedding readiness pill on the WhoDrawer "World Knowledge" lorebook cards with owner-conditional reindex action, ChatInfoModal rebranded to "How Chat Works" with expanded help content. Phase 4 (Echo cost number on the indicator) is blocked on the allocate / commit / release ledger functions for feature spend — see the Phase 4 punch list at the bottom.

Overview

Modes are built from content providers — modular pieces that supply different sections of the LLM prompt. Not every mode needs every provider. A simple assistant mode has no use for lorebooks. A quick-chat mode doesn't need recalled memories. A creative writing mode might skip scenario injection entirely.

The pipeline already only runs providers a mode's sub-prompts reference — but it doesn't take this further. There is no single place in the UI where the user can see, per conversation, what the mode supports, what they have turned on, and what that will cost in Echoes before they hit send. Embeddings in particular cost real money once Echo accounting lands, so the user needs to see — before sending — whether this message will generate one.

This feature delivers:

  1. Feature toggles folded into the existing HowDrawer, the canonical "how this chat operates" surface — no parallel modal entry point. Every per-conversation lever (model, mode, streaming, the new feature toggles) lives in one place.
  2. A two-value resolution model — mode declares supported, user declares wanted — with explicit dependency rules.
  3. Embedding usage as derived, visible state — shown next to the message composer so the user knows whether sending this message will spend embedding Echoes.
  4. A "Coming Soon" surface for features that are designed but not yet shipped (greyed-out toggle rows in HowDrawer).

Problem

No single place to see / set chat features

Today, settings are scattered: streaming lives in HowDrawer ungrouped, semantic-search granularity lives in deep settings, lorebook config in another surface, and there are no provider-level on/off toggles at all. There is no consolidated view in HowDrawer that says "here is everything that affects how this chat behaves, and here is what you've chosen."

Mode capabilities aren't surfaced to users

A mode's sub-prompts already define which providers it uses. But the UI doesn't surface this. Users tweak settings that have zero effect on the current mode and have no upfront signal of what their mode actually does.

Embeddings cost Echoes — and it's invisible

Once Echo accounting is wired into the pipeline, embedding generation will cost the user every message. Today the user has no way to know whether the next message will trigger an embedding call. They find out by watching their balance tick down. The user must see the embedding state before sending.

Users can't opt out of expensive features cleanly

The only way to disable vector search today is via granular settings (Knowledge.EnableVectorSearch, Memory.EnableVectorSearch). There is no clean per-feature toggle, and no enforced dependency rules between related features (e.g., memories require summaries).


Proposed Design

Home: the existing HowDrawer

The feature toggles live inside the existing chat-v2 HowDrawer (clientConsole/src/pages/chat-v2/components/HowDrawer.tsx), not in a separate modal. HowDrawer is already the canonical "how this chat works" surface: model, preset, mode, context budget, streaming. Adding feature toggles fits naturally — it keeps every per-conversation operational lever in one place, reuses the streaming toggle exactly where it already is, and avoids a parallel entry point next to WHO/HOW that would force users to learn a new affordance.

New sections added to HowDrawer (collapsible):

  1. Behavior — streaming (already there) and other UX-level toggles that don't touch the prompt pipeline.
  2. Active Features — the prompt-pipeline toggles described below.
  3. Coming Soon — designed-but-not-shipped features, greyed out, with a one-line description.

Each toggle row shows three things:

The existing HowDrawer content (model picker, preset, mode, context budget) stays in its current section above these. Streaming moves out of its own ungrouped row and into the new Behavior section.

Section visual pattern (Active Features)

Each Active Features section in HowDrawer (Summaries / Memories / Lorebook, plus the Coming Soon rows) follows a consistent shape:

Example off-state copy (Memories):

Memory recall is off. When on, the assistant searches past summaries for content relevant to your current message and adds it to the prompt — this is what lets the character "remember" things you discussed many turns ago, even after older messages roll out of the context window. Turning it off means the assistant only sees the recent context window and your current summaries.

Example off-state copy (Lorebook):

Lorebook search is off. When on, the assistant scans your bound lorebooks for entries relevant to the current message and adds matching entries to the prompt. Without it, characters / settings / facts defined only in lorebooks won't be available to the model unless they happen to appear in recent messages.

Why always-expanded: an empty/collapsed off-state is a missed opportunity. Off is the state where the user is most likely to be unsure what they're missing — that's exactly when the explanation needs to be visible. Coming Soon is the same logic taken further.

Behavior section is shape-different. Streaming and other UX-level toggles have no meaningful "configure when on" content. The Behavior section renders flat — toggle + description, no expanded panel per row. This is intentional: Behavior is a list of independent UX preferences, not a list of feature configurators.

Renaming ChatInfoModal

The existing ChatInfoModal.tsx (clientConsole/src/pages/chat-v2/components/ChatInfoModal.tsx) currently uses the title "Chat Features" for what is actually a help/explanation modal (WHO/HOW drawer descriptions, keyboard shortcuts). Two changes:

  1. Rename the header to "How Chat Works" so the "Chat Features" name doesn't carry semantic conflict with the new toggle home in HowDrawer.
  2. Expand the content with substantive help: explain the WHO drawer (character / persona / lorebooks / custom instructions), the HOW drawer including the new feature toggles and what each one does, the composer's pre-send embedding indicator, lorebook embedding-readiness pills, the mid-conversation-change caveat, and keyboard shortcuts. The renamed modal becomes the canonical "I'm new — what does any of this mean?" surface for chat — much higher information value than today's four bullet points per drawer.

Two-Value Resolution

For every prompt-pipeline feature there are two independent values:

Value Source Meaning
effectivePromptPlan.supports(feature) Derived by canonical introspection from the resolved Base + enabled Flavors (Base only on unsupported doors) Does the exact next-message plan include the provider?
user.wants(feature) Conversation setting (with user-default fallback) Does the user want this feature on for this chat?

Effective state: active = effectivePromptPlan.supports(feature) && user.wants(feature)

A user can disable what the prompt plan supports. A user cannot enable what the current plan does not support. Older examples/code sketches below that say mode.supports are shorthand for this canonical plan-aware result; they must not be implemented as a Base-only SQL shortcut. When the plan does not support a feature, the toggle is shown locked with a "not in this prompt plan" label.

The Active Features list

Shipped, real toggles:

Feature Depends on Notes
Summaries — Conversation summary generation/injection.
Memories Summaries (must be on) Recalled memories. Toggle is disabled while Summaries is off. Turning Summaries off auto-disables Memories.
Lorebook — Lorebook search and injection.

Per-feature semantic search (embeddings)

Memory and Lorebook each have their own semantic search toggle, mirroring today's Memory.EnableVectorSearch / Knowledge.EnableVectorSearch settings. They are independent:

When a user manually turns one of these off while the parent feature is on, a per-feature warning appears in that row:

Semantic recall: OFF — Memory recall will degrade to keyword/FTS only. Turn it back on for full semantic matching.

Semantic search: OFF — Lorebook search will degrade to keyword/FTS only. Turn it back on for full semantic matching.

The wording is deliberate — "degrades" rather than "disables" — because providers handle embedding = null by falling back to FTS and keyword. The chat keeps working, just with shallower recall.

One embedding per message, shared between features

Critical cost point: the user's message embedding is generated at most once per message and shared between memory recall and lorebook search. The pipeline already lazy-loads it via PipelineContextBase.GetCurrentMessageEmbeddingAsync() and caches the result for the rest of the pipeline run.

Implications for the user's mental model — and for the pre-send indicator:

So even though the toggles are independent at the feature level, the cost is a single OR across the two. The composer indicator reflects this: it says "this message will use embeddings" (single line, single cost) when at least one semantic toggle is on AND the conversation has something to search.

Lorebook embedding readiness

Bound lorebooks may not be fully embedded — embeddings are generated as a background job, and a freshly-imported or recently-edited lorebook can have entries that aren't searchable yet. Semantic search silently misses those entries.

Rather than reinventing this in the HowDrawer feature sections, the embedding-readiness pill lives on the lorebook card itself as a shared piece of UI. Anywhere a lorebook is rendered — browse, vault, chat sidebar, the modal's expanded Lorebook row — the card shows the same pill:

Actions on the card depend on ownership:

Putting the pill on the card means the HowDrawer feature sections gets readiness for free when the user expands the Lorebook row — it just renders the lorebook cards.

Memories get an aggregate readiness pill on the Memories row of the modal (12/12 memories embedded). Memories are normally embedded on archival, so this is usually complete — but exposing it gives a way to spot stuck jobs and reinforces parity with Lorebook.

Pre-send embedding indicator

The composer area shows a small indicator: "Next message will use embeddings (≈X Echoes)" or "No embedding will be generated for this message." This reflects the actual runtime check that the pipeline already performs (mode-uses-vector-providers? AND has-lorebook-entries? AND has-memories?). It is not a setting — it is a live preview of what the pipeline will do.

This means the user sees the same logic the backend will execute, before paying for it.

Coming Soon (shown, greyed out)

These features will appear in HowDrawer's Coming Soon section as greyed-out rows, with their description and a "Coming soon" label. They are not toggleable yet and have no backing setting.

Coming-soon rows are non-interactive — clicks do nothing. They exist to set expectations and give a single coherent picture of where chat is going. When each ships, the row flips from greyed to live without changing the modal's structure.


Phase 3.5 — Feature Settings modal + account-wide defaults (shipped 2026-09-04)

The toggles moved out of the drawer body and into a modal, and gained a user-level default, in response to a request for the feature switches to be settable once for the whole account.

Chat (conversation scope). The How drawer's Active Features section is now a compact summary — one line per feature with an On / Off / Not in this mode / Requires X badge, a "Conversation" pill on any row set for this chat, and a Feature settings link — the same shape as Context Budget → Context settings. The link opens the Feature Settings modal carrying the full rows (toggle, always-on explanation, mode/dependency locks) plus, per row:

Toggles still write immediately (optimistic) to PUT /api/settings/conversation/{id}/{key}; reset is DELETE on the same route and is not optimistic (the client doesn't know the inherited value until the envelope refetch lands). The envelope carries featureSources next to featureToggles — both read off the SAME settings snapshot in WebChatFeatureStateService (DictionarySettingsProvider now carries the source column of fn_get_web_settings via ISettingSourceProvider), so value and provenance can't disagree.

Settings → Features (user scope). A new Settings tab renders the same six rows through the same FeatureSettingsList against /api/settings/user?view=features (value + source per key). There is no mode at user scope, so nothing is mode-locked there — modeSupports absent means "no mode context", never "supports nothing" — while the dependency locks still apply (a Memories default is locked by a Summaries=off default, Picture entries by Lorebook=off). Every conversation without its own value follows these; a conversation that set its own keeps it.

The tab is a staged form, not a row of live switches: it is a Settings page, so it follows the repo's Save/Cancel pattern rather than the chat modal's write-on-click. Toggling stages into a draft, one always-visible Save/Cancel pair commits or discards the lot, and Save is surgical — only the keys that actually changed are sent. The blast radius is what decides it: a click here moves every future conversation, so it gets a confirmation step; a click in the chat modal moves one conversation and lands immediately. A staged row keeps reporting the source of its committed value and adds a Modified marker — badging it "User" before Save would claim an account setting that Cancel is still free to discard. Reset to inherited stays immediate in both surfaces (it is a delete, not a value edit) — the same split DynamicSettingsSection already uses.

Resolution is unchanged — conversation → user → default via fn_get_web_settings — the user leg simply has a UI now. Nothing changes in the pipeline.

Files: shared/src/components/features/{FeatureRow,FeatureSettingsList,featureRows,featureRowContent,featureKeys}, shared/src/chat/settings/FeatureTogglesSection.tsx (summary + modal; the writing client's How drawer and the chat console's Story settings both render it), clientConsole/src/pages/settings/FeatureDefaultsTab.tsx + hooks/useFeatureDefaults.ts, shared/src/components/settings/SettingSourceBadge.tsx; server Core/Pipeline/Interfaces/ISettingSourceProvider.cs, WebChat/Services/IWebChatFeatureStateService.cs (FeatureToggleSources), FeatureSourcesDto on the conversation detail, SettingsViewConfig["features"].

Acceptance Criteria (Phase 3.5)

The feature is not done until every box below is verified ✅ against the running product.

User use cases — satisfiable + accessible (verify by driving the UI, not the code):

Behavior:

Invariants that must stay true:

Edges:

Resolution Order

For each feature in (Summaries, Memories, Lorebook):
    if not mode.supports(feature):
        active = false
        ui_state = "locked: not in this mode"
        continue

    if feature == Memories and not active(Summaries):
        active = false
        ui_state = "locked: requires Summaries"
        continue

    active = user.wants(feature)   // conversation setting → user default → true
    ui_state = active ? "on" : "off (user disabled)"

// Per-feature semantic toggles (independent, map to existing settings):
Memories.semantic.active = active(Memories) and user.wants(Memory.EnableVectorSearch)
Lorebook.semantic.active = active(Lorebook) and user.wants(Knowledge.EnableVectorSearch)

// Single shared embedding decision (one generation per message, used by both):
embedding_will_generate =
    (Memories.semantic.active and HasArchivedMemories) or
    (Lorebook.semantic.active and HasLorebookEntries)

Pipeline Changes

PromptContextManager (user preference + dependency check)

PromptContextManager already only calls providers whose key matches a mode section. The new behavior adds two layered checks before running a provider:

  1. Dependency check. If the provider is recalled_memory and Summaries is off, skip — regardless of the user's Memories toggle.
  2. User preference check. If the user has the corresponding Features.* toggle off, skip.

Smart skip for the shared message embedding

The shared per-message embedding (lazy-loaded in PipelineContextBase.GetCurrentMessageEmbeddingAsync()) should not be generated when there's nothing for it to match. Two precomputed flags on the pipeline context drive this:

Combined with the per-feature semantic toggles, the embedding generates iff: (Memory.EnableVectorSearch && HasArchivedMemories) || (Knowledge.EnableVectorSearch && HasLorebookEntries)

When both clauses are false, return null — providers already handle null by falling back to FTS / keyword.

Exposing the embedding decision to the client

embeddingPreview is added to the existing per-conversation metadata payload that chat-v2 already loads when the conversation header initializes — no new endpoint, no extra round-trip. The implementer extends that response with a small object computed from the same code path the pipeline uses. Refresh triggers (lorebook bind/unbind, memory archived, Base/Entry/Flavor plan change, feature toggle change) bust the same cache that backs the conversation-header load.


Data Model

No schema changes.

Reads use ISettingsProvider (read-only — GetBool / GetSetting). Writes use the existing conversation-settings update API.


UI Considerations

HowDrawer additions (the toggle home)

Message-box indicator

Small line above or below the composer:

When Echo costs land, the indicator includes the cost: "≈3 Echoes (embedding)".

Mode Editor (Creator's Forge)

Read-only "Features used" summary derived from the mode's sub-prompt provider keys, so creators see at a glance what their mode supports.

Settings panel filtering

When a mode doesn't support a feature, the settings panel hides that feature's deeper configuration (thresholds, max entries, etc.). HowDrawer still shows the locked row for transparency, but advanced sub-settings are hidden.


Examples

Example 1: Casual chat, no semantic features

Mode: "Casual Chat"
  Sub-prompts: character, persona, summary
  → Mode supports: Summaries
  → Mode does NOT support: Memories, Lorebook

HowDrawer / Active Features:
  Summaries:  [ON]
    └─ (feature details — summary count, window size, etc.)
  Memories:   [LOCKED]  not in this mode
    └─ "Memory recall isn't included in this mode. Switch to a
        mode that includes recalled_memory to use it."
  Lorebook:   [LOCKED]  not in this mode
    └─ "Lorebook search isn't included in this mode. Switch to a
        mode that includes lorebook to use it."

Message box: "No embedding will be generated for this message."

Example 2: Full RP mode, user opts out of memories

Mode: "Epic Roleplay"
  Sub-prompts: character, persona, lorebook, recalled_memory, summary, scenario
  → Mode supports: Summaries, Memories, Lorebook

User toggles:
  Summaries: ON
  Memories:  OFF   ← user choice
  Lorebook:  ON
    Semantic search: ON

HowDrawer / Active Features:
  Summaries:  [ON]
    └─ (summary details)
  Memories:   [OFF]
    └─ "Memory recall is off. When on, the assistant searches
        past summaries for content relevant to your current
        message... [full explanation]"
  Lorebook:   [ON]
    └─ Semantic search [ON]
    └─ Bound lorebooks (with readiness pills)

Message box: "Next message will use embeddings (≈3 Echoes)."
         (Lorebook semantic on + entries exist → one embedding.)

Example 3: User turns off Summaries — Memories cascades

User flips Summaries: ON → OFF

Effect:
  Summaries:  [OFF]
    └─ "Conversation summaries are off. When on, older messages
        get rolled into condensed summaries..."
  Memories:   [LOCKED]  requires Summaries
    └─ "Memory recall depends on summaries — turn Summaries on
        to enable Memories."
  Lorebook:   [ON]   unchanged
    └─ Semantic search [ON]

Message box: "Next message will use embeddings (≈3 Echoes)."
         (Lorebook semantic still drives the embedding.)

Example 4: Both Lorebook and Memories off → no embedding

User toggles:
  Summaries: ON
  Memories:  OFF
  Lorebook:  OFF

Modal:
  Summaries:  [ON]
  Memories:   [OFF]  user disabled
  Lorebook:   [OFF]  user disabled

Message box: "No embedding will be generated for this message."

Example 4b: User disables semantic recall on Memories only → warning on that row

User toggles:
  Summaries:        ON
  Memories:         ON
    Semantic recall: OFF   ← manual
  Lorebook:         ON
    Semantic search: ON

Modal:
  Summaries:  [ON]
  Memories:   [ON]
    └─ Semantic recall [OFF]  Memory recall will degrade to
                              keyword/FTS only.
  Lorebook:   [ON]
    └─ Semantic search [ON]
    └─ MyLore  47/47 embedded ✓
    └─ Setting 23/47 embedded — 24 entries will be missed
       [Generate missing embeddings]   (user owns it)

Message box: "Next message will use embeddings (≈3 Echoes)."
         (Lorebook semantic is still on → one embedding,
          shared and used by lorebook search only.)

Example 4c: User disables semantic on both → no embedding, two warnings

User toggles:
  Memories:         ON
    Semantic recall: OFF
  Lorebook:         ON
    Semantic search: OFF

Modal:
  Memories:   [ON]
    └─ Semantic recall [OFF]  Memory recall will degrade to
                              keyword/FTS only.
  Lorebook:   [ON]
    └─ Semantic search [OFF]  Lorebook search will degrade to
                              keyword/FTS only.

Message box: "No embedding will be generated for this message."

Example 5: Smart skip even with features on

Mode: "Detailed RP" — supports everything, all user toggles ON

Conversation state:
  → 0 lorebooks bound, 0 memories archived

Pipeline:
  → No data to search → embedding skipped at runtime
Message box: "No embedding will be generated for this message."

After first summarization archives a memory:
Message box: "Next message will use embeddings (≈3 Echoes)."

Changing Features Mid-Conversation

These toggles are designed to be set before a chat starts or between chats. Flipping them mid-flow is allowed but can produce visible discontinuities, and the user should be warned in HowDrawer:

HowDrawer should show a small Changes apply to the next message note near the toggles. We do not need a confirm dialog — the cost of a "wrong toggle" is recoverable (flip it back) — but the note manages expectation.


Interaction with Other Features

Echoes / cost transparency

Embedding generation is the first chat operation that will charge Echoes. The composer indicator is the user's only pre-send signal of cost. It must reflect the exact runtime decision.

Mode-Specific Lorebook Injection

Mode-specific lorebook injection controls which lorebooks are searched and where content lands. Feature flags control whether lorebook search runs at all. Complementary, not overlapping.

Model Profile Base Prompts & Flavors

Model Profile Base Prompts & Flavors keeps the Base as an ordinary Mode selected by the winning Profile Entry and layers optional Profile-owned Flavors in Web Classic. Feature support is derived from the exact effective Base + enabled-Flavor plan: for example, a genuinely optional “Lore-Enhanced” Flavor can add a conditional {{knowledge}} dependency to a Base that otherwise omits it. The How drawer reflects that expanded support automatically. Base-only Direct/Discord/Hybrid projections never claim Flavor-added support.

Subscription Tiers

A free tier could force Features.EnableLorebook and Features.EnableMemories off at the platform level, eliminating embedding spend for free users. Pro users get the full feature set. Enforced via the settings hierarchy at the platform layer.


Migration Path

Phase 0: Extract a chat-specific LorebookCard (prep) — ✅ shipped, then ↩️ reversed

Originally planned as a chat-local component to render bound lorebooks inside the Lorebook feature row. Built in a4d7d778, then deleted in 75063504 in favor of putting the embedding pill on the existing WhoDrawer "World Knowledge" cards. The reasoning: lorebooks already had a canonical surface in chat (Who drawer); a parallel chat-specific card surface in HowDrawer was duplicate work and ran against the design doc's own decision that "the pill lives on the lorebook card itself, anywhere a lorebook is rendered." HowDrawer's Lorebook row body now references "Who → World Knowledge" instead of rendering its own list.

What survived from this phase: the LorebookEmbeddingPill component (slim "X/Y embedded" badge with state color). It renders on WhoDrawer cards today and is reusable for any future lorebook card surface that wants it.

Phase 1: Smart embedding skip + composer indicator — ✅ shipped (9385fc95)

Phase 2: HowDrawer extension + ChatInfoModal rename — ✅ shipped (8bd9a0f8)

Phase 2 Pass 2: lorebook readiness — ✅ shipped on the Who drawer (75063504)

Originally drafted to render chat-specific lorebook cards inside HowDrawer; reversed mid-build (see Phase 0 above) to consolidate on the existing Who drawer surface.

Phase 3: User feature toggles + cascade — ✅ shipped (75063504)

Phase 4: Echo cost in the composer indicator — ⏸️ blocked

The indicator's EchoCost? slot is reserved but inert. Echo charging on the embedding step requires the allocate / commit / release ledger functions for feature spend, which are explicitly WIP per the Echo subsystem in root CLAUDE.md. See the Phase 4 punch list below.


Open Questions

(none currently blocking — see Decisions below.)

Decisions


Codebase Validation (2026-04-29)

This plan was validated against the current codebase. Several pieces already exist and the migration path can be tightened accordingly.

Already wired — the doc was overclaiming work

Tensions / clarifications needed

Reusable shared components for the modal

The HowDrawer feature sections can be assembled almost entirely from existing shared components — no new primitives needed.

Need Existing component
Modal shell Modal
Section grouping (Behavior / Active / Coming Soon) Section (variant info) — or a flat layout with headings
Per-feature on/off toggle Toggle
Per-feature semantic-search sub-toggle Toggle (nested)
Mode-support state ("not in this mode", "requires Summaries") Badge (variant subdued / locked)
Per-feature semantic-off warning WarningSection (from Section) — one per affected row
Coming-soon rows Card (variant subdued) + Badge "Coming soon"
Message-box pre-send indicator Badge + LoadingSpinner for the live recompute state
"Save as user default" affordance Checkbox + Button
Mid-conversation change note InfoSection

New small component needed: LorebookEmbeddingPill. EmbeddingStatsPanel is too heavy for a card-corner pill — it's a full panel with the reindex button and stale indicator. We want a slim variant that shows just indexed/total + a state color (✓ complete / ⚠ partial), with the panel-style affordances (Reindex / "Ask the creator") hidden behind a click-through. Either: (a) extract the badge-only render path out of EmbeddingStatsPanel into a sibling LorebookEmbeddingPill, sharing the same EmbeddingStats type, or (b) add a compact prop to the existing panel that hides the reindex button and shrinks the layout. Prefer (a) — keeps the panel honest as a panel, and the pill picks up an obvious shared component slot.

Form components (Toggle, Checkbox) already accept label / description / mandatory props — do not wrap them in custom label divs (per project convention).

Updated migration path

Phase 0 (chat-specific LorebookCard extraction) is added as a small prep step — see the Migration Path section above. It's marked chat-specific deliberately to avoid sprawling into a full lorebook-card-surface unification.

Phase 1 narrows to a pure-backend slice that's smaller than originally written:

Phase 2 (modal shell + streaming toggle move) and Phase 3 (Features.* keys + pipeline gating) stay as written, with the correction above: the modal renders per-feature semantic sub-toggles wired to the existing Memory.EnableVectorSearch and Knowledge.EnableVectorSearch settings — independent rows, independent warnings, no umbrella key.


Implementation Readiness — Second Validation Pass

Verdict: ready to implement. All four blocking decisions resolved.

1. ChatInfoModal collision — RESOLVED

ChatInfoModal.tsx keeps its file and component name. Header renames from "Chat Features" → "How Chat Works". Content gets expanded into a substantive help surface covering the new HowDrawer sections, composer indicator, lorebook readiness pills, and mid-conversation caveat. Folded into Phase 2.

2. HOW drawer overlap — RESOLVED

Feature toggles fold into HowDrawer as three new collapsible sections (Behavior / Active Features / Coming Soon). No parallel modal entry point. Streaming moves out of its current ungrouped row into the new Behavior section. Existing HowDrawer content (model, preset, mode, context budget) stays in place above the new sections.

3. embeddingPreview attachment point — RESOLVED

No new endpoint. embeddingPreview is added to whatever payload chat-v2 already loads when the conversation header initializes — the existing per-conversation metadata fetch. Implementer locates that endpoint (likely in clientConsole/src/api/conversations.ts and the corresponding ServerAPI ConversationsEndpoints handler) and extends its response with the new field. Cache invalidation triggers (lorebook bind/unbind, memory archived, mode change, feature toggle change) bust the same cache that backs the conversation-header load.

4. Discord parity — RESOLVED (web-only for now)

Finding from second-pass code read: server/EchoOfDreams.DiscordChat/Chat/DiscordChatEntryPoint.cs:76, 197 constructs DiscordChatContext with embeddingClient: null in every path. DiscordChat does not generate embeddings today, so there is nothing to smart-skip on the Discord side. The earlier "mirror in DiscordChat" decision was based on an assumption that's not true in code.

Phase 1 is web-only. When/if DiscordChat adopts an embedding client, the same precompute one-liner applies — pattern is documented here. No action on the Discord entry point in this scope.

Smaller validation notes (not blocking, but worth noting)

Stale claims cleaned up in this pass

Ready to implement

All four blocking decisions are resolved. Remaining work is mechanical:

Tests per phase

Use the dotnet-blackbox-tests skill before writing any new test. Avoid EchoOfDreams.Database.Tests (40+ min, dev runs manually) — keep new tests in the fast unit projects.

Phase 0 — LorebookCard + LorebookEmbeddingPill + chat-scoped stats endpoint.

Phase 1 — Smart-skip + composer indicator.

Phase 2 — HowDrawer extension + ChatInfoModal rename.

Phase 3 — Features.* keys + pipeline gating.

Phase 4 — Echo cost in the indicator.

Cross-phase regression checks.


Phase 4 punch list (blocked)

The composer indicator's EchoCost? slot is reserved but inert. Wiring real cost requires Echo charging at the embedding step, which depends on allocate / commit / release ledger functions that aren't built yet. Per root CLAUDE.md: "Allocate/commit/release for feature spend is WIP."

What's already in place:

What's missing, in dependency order:

1. Product decisions (no code)

2. Echo ledger write functions (SQL + AuthService)

The two-phase pattern the Echoes subsystem doc gestures at:

UTC boundary, partitioning, and advisory-lock rules from 41a_echo_ledger_functions.sql carry over (any new function that joins echo_transactions, daily_*, or ai_task_runs must SET LOCAL timezone = 'UTC').

Plus internal AuthService endpoints (POST /api/internal/echoes/allocate / /commit / /release, gated by INTERNAL_API_SECRET like the existing chat-progress one), so ServerAPI/WebChat can call without touching the ledger directly.

3. Cost config

New SettingsKeys.Echoes.EmbeddingCost (admin-controlled, not per-user) holding the per-call price. Single source of truth — preview reads it, runtime charges it. Hardcoded constant for v1 is fine; promote to a setting once you have product certainty.

4. Chat-side decorator

New EchoChargingEmbeddingClient (or extend BudgetAwareEmbeddingClient) — wraps _inner.GetEmbeddingAsync with allocate → generate → commit/release:

hold = await _ledger.AllocateAsync(userId, "embedding", cost)
try {
    var vec = await _inner.GetEmbeddingAsync(text)
    await _ledger.CommitAsync(hold, cost)
    return vec
} catch (anything) {
    await _ledger.ReleaseAsync(hold)
    throw
}

Pricing for batch (GetEmbeddingsAsync(texts)): allocate cost × N upfront, commit cost × actualSucceeded on completion, release the difference.

Insufficient-balance path: AllocateAsync throws → bubbles as a typed exception (EchoBalanceExceededException analog of the existing EmbeddingBudgetExceededException) → handled by the pipeline's existing exception-to-HTTP mapping.

5. Surface the cost on the preview

6. Loop-closing test

The single test that earns the most: assert that the cost the indicator showed equals the actual_amount committed to the ledger. Closes the trust loop between preview and spend.

7. Free tier policy enforcement (if "free = FTS only")

Features.EnableLorebook / EnableMemories forced to false for the free tier at the platform setting layer (existing settings hierarchy supports this via the user-default fallback). Alternative: keep the toggles but EmbeddingCost setting includes a "free" override of 0, and the budget gate is what stops abuse.

Suggested attack order

  1. Pricing decisions + free-tier policy (no code, just settle).
  2. SQL functions for allocate / commit / release — testable in isolation against Database.Tests.
  3. AuthService internal endpoints wrapping the SQL functions, with INTERNAL_API_SECRET gating, mirroring the existing chat-progress endpoint shape.
  4. IEchoLedgerClient interface in Core + HTTP impl in Database, registered in DI.
  5. EchoChargingEmbeddingClient decorator, wraps BudgetAwareEmbeddingClient, registered as the outermost layer.
  6. EmbeddingCost setting + EmbeddingPreviewDto.EchoCost + EmbeddingIndicator cost rendering — one commit, the user-visible payoff lands.
  7. Loop-closing test + insufficient-balance UX.

The single biggest decision is #1 — graceful degrade vs. hard fail on insufficient balance. The plumbing is roughly the same either way; the failure path is what changes.