fix: keep embedded session controls visible and handle empty memory
Publish documentation / publish (push) Successful in 34s

Cap the embedded shell at its portal container height so steering and stop controls remain accessible. Skip vector retrieval for an empty authoritative Memory archive and compute SQL-rule embeddings lazily.

Validated with 54 Memory tests, 90 frontend tests, five browser scenarios, frontend and Docker builds, and a read-only comparison against the real empty Memory archive.
This commit is contained in:
User
2026-09-14 17:15:00 +02:00
parent 49333a2d35
commit d6cdffea62
8 changed files with 241 additions and 4 deletions
+3 -2
View File
@@ -296,6 +296,7 @@ def rules_cmd(question: str, session: str = typer.Option(..., "--session"),
filters: str = typer.Option("{}", "--filters"),
json_out: bool = typer.Option(False, "--json"), config: Path = CONFIG_OPT):
"""Consult SQL rules and explained errors in schema linking and SQL construction."""
from functools import cache
from types import SimpleNamespace
from tht.cli.vector_cmd import make_embedder, open_searcher
@@ -307,8 +308,8 @@ def rules_cmd(question: str, session: str = typer.Option(..., "--session"),
if current_phase(snapshot) not in {4, 6, 7}:
raise ValueError("Memory rules are consulted in schema linking or SQL construction")
scope = _recall_scope(cfg, filters)
vector = make_embedder(cfg.embeddings).embed_query(question)
embedder = SimpleNamespace(embed_query=lambda _: vector)
# Share one vector across both families, but only when the archive has cards.
embedder = SimpleNamespace(embed_query=cache(make_embedder(cfg.embeddings).embed_query))
searcher = open_searcher(cfg)
candidates = []
for family in ("sql_rule", "explained_error"):