refactor(auto-reply): dedupe inline action command handling

This commit is contained in:
Peter Steinberger
2026-02-15 07:01:14 +00:00
parent eb79785b36
commit 2c1a4ddabc
@@ -272,16 +272,11 @@ export async function handleInlineActions(params: {
directives = { ...directives, hasStatusDirective: false }; directives = { ...directives, hasStatusDirective: false };
} }
if (inlineCommand) { const runCommands = (commandInput: typeof command) =>
const inlineCommandContext = { handleCommands({
...command,
rawBodyNormalized: inlineCommand.command,
commandBodyNormalized: inlineCommand.command,
};
const inlineResult = await handleCommands({
ctx, ctx,
cfg, cfg,
command: inlineCommandContext, command: commandInput,
agentId, agentId,
directives, directives,
elevated: { elevated: {
@@ -308,6 +303,14 @@ export async function handleInlineActions(params: {
isGroup, isGroup,
skillCommands, skillCommands,
}); });
if (inlineCommand) {
const inlineCommandContext = {
...command,
rawBodyNormalized: inlineCommand.command,
commandBodyNormalized: inlineCommand.command,
};
const inlineResult = await runCommands(inlineCommandContext);
if (inlineResult.reply) { if (inlineResult.reply) {
if (!inlineCommand.cleaned) { if (!inlineCommand.cleaned) {
typing.cleanup(); typing.cleanup();
@@ -341,36 +344,7 @@ export async function handleInlineActions(params: {
abortedLastRun = getAbortMemory(command.abortKey) ?? false; abortedLastRun = getAbortMemory(command.abortKey) ?? false;
} }
const commandResult = await handleCommands({ const commandResult = await runCommands(command);
ctx,
cfg,
command,
agentId,
directives,
elevated: {
enabled: elevatedEnabled,
allowed: elevatedAllowed,
failures: elevatedFailures,
},
sessionEntry,
previousSessionEntry,
sessionStore,
sessionKey,
storePath,
sessionScope,
workspaceDir,
defaultGroupActivation: defaultActivation,
resolvedThinkLevel,
resolvedVerboseLevel: resolvedVerboseLevel ?? "off",
resolvedReasoningLevel,
resolvedElevatedLevel,
resolveDefaultThinkingLevel,
provider,
model,
contextTokens,
isGroup,
skillCommands,
});
if (!commandResult.shouldContinue) { if (!commandResult.shouldContinue) {
typing.cleanup(); typing.cleanup();
return { kind: "reply", reply: commandResult.reply }; return { kind: "reply", reply: commandResult.reply };