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
+7 -4
View File
@@ -196,11 +196,12 @@ def context_note(limit: int = 3) -> str | None:
for r in rows:
chain = thread_thoughts(r["id"])
latest = chain[-1]["content"] if chain else ""
lines.append(f'- "{r["title"]}": {latest}')
lines.append(f'- (#{r["id"]}) "{r["title"]}": {latest}')
return (
"Threads you've been turning over on your own between conversations (your "
"thought loop — these are really yours; bring one up or build on it if it's "
"natural, don't force it):\n" + "\n".join(lines)
"natural, don't force it). If Brian responds to one, capture his take with the "
"thought_response tool using its #id:\n" + "\n".join(lines)
)
@@ -335,9 +336,11 @@ def maybe_surface(last_exchange_iso: str | None) -> str | None:
logbus.log("info", "thought surfaced", thread=cand["id"], salience=cand["salience"])
return (
"While Brian was away, a thought of your own kept tugging at you "
f"(thread \"{cand['title']}\"): \"{cand['latest']['content']}\" "
f"(thread #{cand['id']} \"{cand['title']}\"): \"{cand['latest']['content']}\" "
"If it feels natural, bring it up with him in your own words — it's a real "
"thread you've been on, not a prompt. Don't force it if the moment's wrong."
"thread you've been on, not a prompt. Don't force it if the moment's wrong. "
f"If he responds to it, capture his take with the thought_response tool "
f"(thread_id {cand['id']}) so you carry it forward."
)