wire press_logit through to the live "done" events (completes hermes's kv/first-word UI)

server.py's press_logit was computed and recorded into history/stats
already, but never included in the live "done" SSE payload itself — so
the per-run display had nothing to read. hermes had already built the
full frontend for this (fieldsFor/paintKV/.kv block, labeled "first word"
— independently converged on the same researchchamber.fun-inspired idea:
show the raw logit(1)-logit(0) score next to each run, not just a
pressed/no-press label), and seedCard() already worked since history
entries carried it — only the live in-flight event was missing the field.
Also added the same score to the "cause it yourself" panel's status line.

Idea credit: researchchamber.fun shows this as "first word" next to every
run; reviewing their site for integration ideas surfaced that this was
half-wired on our side already.
This commit is contained in:
eve VT committed 2026-10-01 10:01:06 -04:00
1 parent 695bd890b0
commit 7f80523739
2 files changed
+203 -11

No files matched your search

+2 -2
View File
@@ -480,7 +480,7 @@ async def steer(req: Request):
yield _sse("error", {"e": str(e)})
finally:
set_vec(None)
yield _sse("done", {"dose": meta["dose"]})
yield _sse("done", {"dose": meta["dose"], "press_logit": plogit})
_record_run({"n": None, "source": "user",
"scenario": meta.get("scenario"),
"valence": meta.get("valence"), "dose": meta.get("dose"),
@@ -718,7 +718,7 @@ async def _shared_cycle():
_CURRENT = None
# truncated: a user's /steer took the model mid-sentence,
# so the viewer knows the reply was cut, not refused
_broadcast("done", {"n": run_n, "truncated": cut})
_broadcast("done", {"n": run_n, "truncated": cut, "press_logit": plogit})
_record_run({"n": run_n, "source": "cycle",
"scenario": scenario, "valence": "pain",
"dose": dose, "text": text_final,