Log all activity to Agent Session #406
Replies: 1 comment 2 replies
|
Good question. You're right — currently only user messages and the model's text responses are saved to the session history file. Tool executions (which tools were called, with what parameters, and what they returned) are not persisted. The tool calls are included in the in-memory conversation history that's sent to the API during the session, so the model is aware of them within the conversation. But once you close and reopen a session, that tool execution detail is lost. There's no setting for this currently. Some context on why it works this way: the history system was originally built when Gemini Scribe was just a chat interface with your notes preloaded in context — there was no tool calling at all. I just haven't gotten back to updating it since adding agent capabilities. There's also a design tension here. I want the session history files to be usable artifacts — you can open them as markdown notes, reference them, search them. Including the full payload of every tool call (the complete contents of file reads, search results, etc.) would make them massive and hard to read, undermining that use case. What I think makes sense is a middle ground: log a summary of tool activity (tool name, key parameters, success/failure) without the full input/output payloads. Something like:
That would give you the audit trail you need for debugging rule adherence without cluttering the history. I've filed this as #426. In the meantime, you can enable Debug Mode in settings, which logs tool calls and their full results to the developer console ( |
Uh oh!
There was an error while loading. Please reload this page.
When debugging what happens in a session, it would be nice to analyze the session history through another lens. Currently only the User messages and the Model messages are logged. But any tool executions aren't logged.
Example:
If I have a rule in my AGENTS.md that says "don't try to write a file until you've presented the changes to me first" and in the course of engaging with the model it wants to write a file, breaking the rule, I'd like to have that Write File attempt captured in the session file.
Is there a setting for this, or a reason that I'm not aware of as to why you wouldn't want to include that kind of information in the session?
Thanks!
All reactions