fix: treat inline buttons as native approval ui

This commit is contained in:
Peter Steinberger
2026-04-05 08:30:06 +01:00
parent d91d3cc0f0
commit 31d8b022eb

View File

@@ -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.",