fix(session_search): hidden-lineage note recommends a plain read, not a rejected scroll

Greptile: Recovery advice leads to rejection. _scroll rejects anchors in the
current lineage (the exact sessions disclosed) and the note gave no anchor; a
session_id-only read works, and the test now follows the advice.
This commit is contained in:
Teknium
2026-11-14 03:12:30 -08:00
parent 09cf9c2f9d
commit 52feffdc8f
2 changed files with 8 additions and 2 deletions

View File

@@ -1268,6 +1268,12 @@ class TestSameLineageHiddenDisclosure:
assert "s_lost" in sessions
lost = next(s for s in hidden["sessions"] if s["session_id"] == "s_lost")
assert lost["end_reason"] is None # the tell-tale of the lost end-write
# The recovery the note recommends must work: a plain read of the disclosed id
# (scroll rejects anchors in the current lineage, so the note must not suggest it).
assert "around_message_id" not in hidden["note"]
read = json.loads(session_search(session_id="s_lost", db=db, current_session_id="s_cur"))
assert read["success"] is True and read["mode"] == "read"
assert any("zephyrwidgets" in m["content"] for m in read["messages"])
def test_current_session_live_rows_not_disclosed_as_hidden(self, db):
"""The current session's own live rows are already in context —

View File

@@ -447,8 +447,8 @@ def _discover(db, query: str, role_filter: Optional[list[str]], limit: int, sort
**({"hidden_same_lineage": {"count": hidden_rows, "sessions": list(hidden_sessions.values()),
"note": f"{hidden_rows} matching message(s) in {len(hidden_sessions)} same-lineage session(s) "
"were hidden because they are still treated as live context (unended). This can be a gateway "
"session whose end-write was lost. To read one anyway, scroll it directly: "
"session_search(session_id=..., around_message_id=...)."}} if hidden_rows else {}),
"session whose end-write was lost. To read one anyway, pass only its session_id: "
"session_search(session_id=...)."}} if hidden_rows else {}),
link_hint=(
"When referring the user to a session, write its `link` value "
"verbatim inline mid-sentence (it renders as a titled link) — never "