feat: chat-side feedback — reactions in conversation thread back to her thoughts

Closes the last loop gap: when she raised a thought in chat and Brian replied in
the conversation (not the feed), it was a dead end. Now she has a thought_response
tool — when he reacts to a thought she surfaced, she captures his take and it folds
back into that thread (next dream pass she reacts, like a feed reply).

- tools: _thought_response(thread_id, brian_said) -> thoughts.record_response.
- modes: thought_response added to _BASE (all modes).
- surfaced-note + context_note now expose each thread's #id and instruct her to use
  the tool when he engages, so she has what she needs to call it.
- test for the tool (threads reply back + bad-id handling). Suite 81, ruff clean.

Feedback now closes from both surfaces: the /thoughts feed AND live conversation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-22 23:26:40 +00:00
parent 149e9a6dd5
commit ea30c3dd67
4 changed files with 48 additions and 6 deletions
+24
View File
@@ -52,6 +52,21 @@ def _think_about(args: dict, ctx: dict) -> str:
"I'll come back to it on my own between our conversations.")
def _thought_response(args: dict, ctx: dict) -> str:
try:
tid = int(args.get("thread_id"))
except (TypeError, ValueError):
return "Tell me which thought — I need its thread id (the #number you were given)."
said = (args.get("brian_said") or "").strip()
if not said:
return "Nothing to record yet — what did Brian say about it?"
if not thoughts.record_response(tid, said):
return f"(couldn't find thought thread #{tid})"
logbus.log("info", "Brian reacted to a thought in chat (tool)", thread=tid)
return (f"Folded Brian's take into thread #{tid} — I'll pick it back up and react "
"next time I'm thinking.")
# name -> {spec (OpenAI function tool), handler}
TOOLS: dict[str, dict] = {
"journal_write": {
@@ -437,6 +452,15 @@ _S = {"type": "string"}
_N = {"type": "number"}
TOOLS.update({
"thought_response": {"handler": _thought_response, "spec": _f(
"thought_response",
"When you've brought one of your own thoughts/threads to Brian and he responds to "
"it in the conversation, capture his reaction here so it folds back into that "
"thread — you'll carry it forward on your own next time you think. Use the thread "
"id (#number) you were given for that thought.",
{"thread_id": {**_N, "description": "The thread id (#number) of the thought he reacted to."},
"brian_said": {**_S, "description": "What Brian said / his take, in your words."}},
["thread_id", "brian_said"])},
"start_session": {"handler": _start_session, "spec": _f(
"start_session",
"Begin a live poker session. Call when Brian sits down to play.",