Skip to content

[Agent Builder] do not store filestore tool calls in filestore#254850

Open
pgayvallet wants to merge 9 commits intoelastic:mainfrom
pgayvallet:ab-xxx-no-store-filesystem-tools
Open

[Agent Builder] do not store filestore tool calls in filestore#254850
pgayvallet wants to merge 9 commits intoelastic:mainfrom
pgayvallet:ab-xxx-no-store-filesystem-tools

Conversation

@pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented Feb 25, 2026

Summary

Context: slack discussion

Storing filestore (and attachment) tool call results in the filestore doesn't bring anything at best (given the data is already in the store from the initial tool call), and is confusing for the LLM at worse.

This PR changes that behavior, so that:

  • calls to filestore.* or attachments.* tools aren't persisted in the storage
  • filestore.* tools summarization is now using a simple placeholder instead of a link to the filestore.
  • (attachment tools already had a custom tool-level summarization, so I didn't change that)
  • also fix a bug where the summarization system wasn't working with "internal" tools (so filestore and attachment tools, of course...)

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet pgayvallet added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.4.0 feature:agent-builder Identify agent builder functionalities to be grouped together for release notes labels Feb 25, 2026
@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet pgayvallet self-assigned this Feb 25, 2026
Comment on lines +163 to +167
const managerSummarizer = toolManager.getSummarizer(toolCall.tool_id);
if (managerSummarizer) {
const summarizedResults = managerSummarizer(toolCall);
return summarizedResults ?? undefined;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal tools such as the filestore and attachment tools aren't registered in the tool registry, so that whole logic of result summarization wasnt working properly for them. Had to adapt a bunch of things, and use the tool manager as a second source of truth for the tool definitions.

Note that this also fixes a bug with attachment tools, because they currently define summarizeToolReturn which aren't used without that PR.

Comment on lines +17 to +23
return toolReturn.results.map((result) => ({
tool_result_id: result.tool_result_id,
type: ToolResultType.other,
data: {
comment: 'Tool result removed from the discussion, call the tool again to access the data',
},
}));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new placeholder data we use for all filestore tool calls. I kept it fairly simple.

Comment on lines +141 to +147
/**
* Gets the summarizer function for a tool by its internal tool ID.
* Returns undefined if the tool is not found or has no summarizer.
*/
public getSummarizer(toolId: string): ToolReturnSummarizerFn | undefined {
return this.executableTools.get(toolId)?.summarizeToolReturn;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to previous comments - the tool manager is the service knowing about non-registry tools, so I had to adapt it to keep track of its tools to access the summarizers

@pgayvallet
Copy link
Contributor Author

/ci

Comment on lines -49 to -51
...getConversationAttachmentsSystemMessages(
params.processedConversation.versionedAttachmentPresentation
),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to the PR, but I took the opportunity to clean how the attachment prompt is being added

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @pgayvallet

@pgayvallet pgayvallet marked this pull request as ready for review February 25, 2026 09:58
@pgayvallet pgayvallet requested a review from a team as a code owner February 25, 2026 09:58
Copy link
Contributor

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pgayvallet
Copy link
Contributor Author

@elasticmachine merge upstream

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

Labels

backport:skip This PR does not require backporting feature:agent-builder Identify agent builder functionalities to be grouped together for release notes release_note:skip Skip the PR/issue when compiling release notes v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants