If they're over, like, um... Once they head over a certain number of messages in the day…
- User
If they're over, like, um... Once they head over a certain number of messages in the day or that period you could also just suggest, um... That maybe we just offer them to end their conversation so they don't feel like I ask the court forever, you know? So for example, if this is a natural conversation today, you should be willing to kind of end it. But just not for a spot, but just subtly nudge towards that and say, like for example, say we've spoken a lot today. If you want to reflect on it, we can catch up whenever or we can keep speaking.
- Assistant
I’ll look through the app to find where conversation pacing or assistant nudges are handled, then I’ll wire this into the existing pattern if there is one.
- Assistant
I found this is a Python FastAPI WhatsApp/Discord assistant. The behavior is most likely prompt-driven, but I’m checking whether there’s already a daily activity summary available so the nudge can be grounded instead of just vague instruction.
- Assistant
The current prompt already tells the assistant not to become a substitute for direct conversation, but it has no explicit signal for “we’ve talked a lot today.” I’m going to add a lightweight per-user daily activity count to hot context and a prompt rule that uses it as a soft opt-out / reflection nudge.
- Assistant
I’m making this as context plus behavioral guidance rather than a hard-coded forced message. That keeps it subtle: the model can use the nudge when the conversation naturally winds down, and skip it during crisis or clearly active support.
- Assistant
The first pass is in place. I caught one SQL detail while reviewing it: the daily count needs to count message rows, not the left-join placeholder row when there are no messages, so I corrected that before running tests.
- Assistant
The default
pytestresolved to Python 3.8, but this project importsdatetime.UTC, so it needs Python 3.11+. I’ll rerun through the project toolchain and check the diff without relying on Git from this directory. - Assistant
The checked-in
.venvhas Python 3.11 but no pytest installed; the shell default has pytest but Python 3.8. I’m going to askuvfor a Python 3.11 dev run explicitly so the interpreter and test deps line up. - Assistant
The focused tests exposed a budget edge case: adding a non-droppable context section can break the tight hot-context budget test. I’m adjusting the renderer so the new conversation-load section is preserved normally but can be dropped under extreme token pressure, after the higher-priority context is protected.
- Assistant
Implemented the soft “we’ve talked a lot today” off-ramp.
Changed:
- hot_context.py: adds per-user same-day message counts using the user’s timezone.
- hot_context.py: renders a
Conversation loadsection into hot context, with budget fallback so OOB stays protected. - prompts.py: teaches the assistant to gently offer a pause around roughly
20+same-day messages when the moment is not urgent. - test_hot_context.py: covers the new counts and rendered context.
Verification:
uv run --python 3.11 --extra dev pytest tests/test_hot_context.py tests/test_agentic.py -qResult:
8 passed.