mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-04 16:02:13 +00:00
fix: checks for doc cache on mcp tool call (#514)
This commit is contained in:
parent
c0e557cdb7
commit
00dafbe535
1 changed files with 8 additions and 0 deletions
|
|
@ -38,6 +38,14 @@ export async function processToolCallContent(
|
||||||
const url = toolCall.args?.url || toolCall.args?.uri || toolCall.args?.path;
|
const url = toolCall.args?.url || toolCall.args?.uri || toolCall.args?.path;
|
||||||
const parsedResult = typeof url === "string" ? parseUrl(url) : null;
|
const parsedResult = typeof url === "string" ? parseUrl(url) : null;
|
||||||
const parsedUrl = parsedResult?.success ? parsedResult.url.href : undefined;
|
const parsedUrl = parsedResult?.success ? parsedResult.url.href : undefined;
|
||||||
|
|
||||||
|
// avoid generating TOC again if it's already in the cache
|
||||||
|
if (parsedUrl && state.documentCache[parsedUrl]) {
|
||||||
|
return {
|
||||||
|
content: state.documentCache[parsedUrl],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const processedContent = await handleMcpDocumentationOutput(
|
const processedContent = await handleMcpDocumentationOutput(
|
||||||
result,
|
result,
|
||||||
config,
|
config,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue