@app.message().
The handler receives:
session: the current conversation and user contextmsg: the incoming user message
Basic reply
Model messages
Usesession.chat_messages(msg) to turn Capsule history plus the current message into model-ready messages.
Streaming
Session state
session.data for lightweight state that belongs to one conversation.