mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 11:01:39 +03:00
agents: reduce prompt token bloat from exec and context (#16539)
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 8e1635fa3fdfb199a58bd53e816abc41cd400d44 Co-authored-by: CharlieGreenman <8540141+CharlieGreenman@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
This commit is contained in:
@@ -79,6 +79,7 @@ export type ExecToolDefaults = {
|
||||
sessionKey?: string;
|
||||
messageProvider?: string;
|
||||
notifyOnExit?: boolean;
|
||||
notifyOnExitEmptySuccess?: boolean;
|
||||
cwd?: string;
|
||||
};
|
||||
|
||||
@@ -135,6 +136,7 @@ export function createExecTool(
|
||||
const defaultPathPrepend = normalizePathPrepend(defaults?.pathPrepend);
|
||||
const safeBins = resolveSafeBins(defaults?.safeBins);
|
||||
const notifyOnExit = defaults?.notifyOnExit !== false;
|
||||
const notifyOnExitEmptySuccess = defaults?.notifyOnExitEmptySuccess === true;
|
||||
const notifySessionKey = defaults?.sessionKey?.trim() || undefined;
|
||||
const approvalRunningNoticeMs = resolveApprovalRunningNoticeMs(defaults?.approvalRunningNoticeMs);
|
||||
// Derive agentId only when sessionKey is an agent session key.
|
||||
@@ -749,6 +751,7 @@ export function createExecTool(
|
||||
maxOutput,
|
||||
pendingMaxOutput,
|
||||
notifyOnExit: false,
|
||||
notifyOnExitEmptySuccess: false,
|
||||
scopeKey: defaults?.scopeKey,
|
||||
sessionKey: notifySessionKey,
|
||||
timeoutSec: effectiveTimeout,
|
||||
@@ -883,6 +886,7 @@ export function createExecTool(
|
||||
maxOutput,
|
||||
pendingMaxOutput,
|
||||
notifyOnExit,
|
||||
notifyOnExitEmptySuccess,
|
||||
scopeKey: defaults?.scopeKey,
|
||||
sessionKey: notifySessionKey,
|
||||
timeoutSec: effectiveTimeout,
|
||||
|
||||
Reference in New Issue
Block a user