mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:41:37 +00:00
fix(agents): harden bash tool and reply directive handling
This commit is contained in:
@@ -102,6 +102,31 @@ export async function applyInlineDirectiveOverrides(params: {
|
||||
let { directives } = params;
|
||||
let { provider, model } = params;
|
||||
let { contextTokens } = params;
|
||||
const directiveModelState = {
|
||||
allowedModelKeys: modelState.allowedModelKeys,
|
||||
allowedModelCatalog: modelState.allowedModelCatalog,
|
||||
resetModelOverride: modelState.resetModelOverride,
|
||||
};
|
||||
const createDirectiveHandlingBase = () => ({
|
||||
cfg,
|
||||
directives,
|
||||
sessionEntry,
|
||||
sessionStore,
|
||||
sessionKey,
|
||||
storePath,
|
||||
elevatedEnabled,
|
||||
elevatedAllowed,
|
||||
elevatedFailures,
|
||||
messageProviderKey,
|
||||
defaultProvider,
|
||||
defaultModel,
|
||||
aliasIndex,
|
||||
...directiveModelState,
|
||||
provider,
|
||||
model,
|
||||
initialModelLabel,
|
||||
formatModelSwitchEvent,
|
||||
});
|
||||
|
||||
let directiveAck: ReplyPayload | undefined;
|
||||
|
||||
@@ -135,26 +160,7 @@ export async function applyInlineDirectiveOverrides(params: {
|
||||
});
|
||||
const currentThinkLevel = resolvedDefaultThinkLevel;
|
||||
const directiveReply = await handleDirectiveOnly({
|
||||
cfg,
|
||||
directives,
|
||||
sessionEntry,
|
||||
sessionStore,
|
||||
sessionKey,
|
||||
storePath,
|
||||
elevatedEnabled,
|
||||
elevatedAllowed,
|
||||
elevatedFailures,
|
||||
messageProviderKey,
|
||||
defaultProvider,
|
||||
defaultModel,
|
||||
aliasIndex,
|
||||
allowedModelKeys: modelState.allowedModelKeys,
|
||||
allowedModelCatalog: modelState.allowedModelCatalog,
|
||||
resetModelOverride: modelState.resetModelOverride,
|
||||
provider,
|
||||
model,
|
||||
initialModelLabel,
|
||||
formatModelSwitchEvent,
|
||||
...createDirectiveHandlingBase(),
|
||||
currentThinkLevel,
|
||||
currentVerboseLevel,
|
||||
currentReasoningLevel,
|
||||
@@ -222,9 +228,7 @@ export async function applyInlineDirectiveOverrides(params: {
|
||||
defaultProvider,
|
||||
defaultModel,
|
||||
aliasIndex,
|
||||
allowedModelKeys: modelState.allowedModelKeys,
|
||||
allowedModelCatalog: modelState.allowedModelCatalog,
|
||||
resetModelOverride: modelState.resetModelOverride,
|
||||
...directiveModelState,
|
||||
provider,
|
||||
model,
|
||||
initialModelLabel,
|
||||
@@ -232,9 +236,7 @@ export async function applyInlineDirectiveOverrides(params: {
|
||||
agentCfg,
|
||||
modelState: {
|
||||
resolveDefaultThinkingLevel: modelState.resolveDefaultThinkingLevel,
|
||||
allowedModelKeys: modelState.allowedModelKeys,
|
||||
allowedModelCatalog: modelState.allowedModelCatalog,
|
||||
resetModelOverride: modelState.resetModelOverride,
|
||||
...directiveModelState,
|
||||
},
|
||||
});
|
||||
directiveAck = fastLane.directiveAck;
|
||||
|
||||
Reference in New Issue
Block a user