mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-21 14:11:26 +00:00
fix: treat inline buttons as native approval ui
This commit is contained in:
@@ -180,10 +180,14 @@ function buildDocsSection(params: { docsPath?: string; isMinimal: boolean; readT
|
||||
];
|
||||
}
|
||||
|
||||
function buildExecApprovalPromptGuidance(params: { runtimeChannel?: string }) {
|
||||
function buildExecApprovalPromptGuidance(params: {
|
||||
runtimeChannel?: string;
|
||||
inlineButtonsEnabled?: boolean;
|
||||
}) {
|
||||
const runtimeChannel = params.runtimeChannel?.trim().toLowerCase();
|
||||
const usesNativeApprovalUi =
|
||||
runtimeChannel === "webchat" ||
|
||||
params.inlineButtonsEnabled === true ||
|
||||
(runtimeChannel
|
||||
? Boolean(resolveChannelApprovalCapability(getChannelPlugin(runtimeChannel))?.native)
|
||||
: false);
|
||||
@@ -504,6 +508,7 @@ export function buildAgentSystemPrompt(params: {
|
||||
"When a first-class tool exists for an action, use the tool directly instead of asking the user to run equivalent CLI or slash commands.",
|
||||
buildExecApprovalPromptGuidance({
|
||||
runtimeChannel: params.runtimeInfo?.channel,
|
||||
inlineButtonsEnabled,
|
||||
}),
|
||||
"Never execute /approve through exec or any other shell/tool path; /approve is a user-facing approval command, not a shell command.",
|
||||
"Treat allow-once as single-command only: if another elevated command needs approval, request a fresh /approve and do not claim prior approval covered it.",
|
||||
|
||||
Reference in New Issue
Block a user