mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 00:38:28 +00:00
Reduce prompt token overhead with leaner context injections
This commit is contained in:
committed by
Peter Steinberger
parent
7a917602c5
commit
412990a139
@@ -85,7 +85,6 @@ export function buildAgentSystemPromptAppend(params: {
|
||||
new Set(normalizedTools.filter((tool) => !toolOrder.includes(tool))),
|
||||
);
|
||||
const enabledTools = toolOrder.filter((tool) => availableTools.has(tool));
|
||||
const disabledTools = toolOrder.filter((tool) => !availableTools.has(tool));
|
||||
const toolLines = enabledTools.map((tool) => {
|
||||
const summary = toolSummaries[tool];
|
||||
return summary ? `- ${tool}: ${summary}` : `- ${tool}`;
|
||||
@@ -160,9 +159,6 @@ export function buildAgentSystemPromptAppend(params: {
|
||||
"- sessions_history: fetch session history",
|
||||
"- sessions_send: send to another session",
|
||||
].join("\n"),
|
||||
disabledTools.length > 0
|
||||
? `Unavailable tools (do not call): ${disabledTools.join(", ")}`
|
||||
: "",
|
||||
"TOOLS.md does not control tool availability; it is user guidance for how to use external tools.",
|
||||
"",
|
||||
params.modelAliasLines && params.modelAliasLines.length > 0
|
||||
|
||||
Reference in New Issue
Block a user