Skip to content

Automatic capture drops Agent and MCP tool results listed in includeTools #152

Description

@RaphaelFakhri

With a tool listed in includeTools, the Stop capture should include that tool's result. Results from the Agent tool and from MCP tools never appear in the saved document. Results from Read, Bash and Edit do appear.

Cause

The session transcript stores most tool results as a string, but Agent and MCP tool results are stored as an array of content blocks:

{"type":"tool_result","tool_use_id":"toolu_1","content":[{"type":"text","text":"..."}]}

formatUserMessage in plugin/hooks/lib/transcript.js passes block.content straight to cleanContent, which returns an empty string for anything that is not a string. The result is then skipped as empty.

Steps to reproduce

  1. Set "includeTools": ["Agent"] in ~/.supermemory-claude/settings.json.
  2. In a session, ask the assistant to delegate a search to a subagent and let the turn end.
  3. Inspect the saved document (or the request body sent to /v3/documents): the Agent tool call is there, the assistant:tool_result entry for it is missing.

Expected

The text blocks of the tool result are captured (and truncated to 500 characters) like a string result. Non-text blocks such as images stay out.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions