fix: send multi-run slash commands correctly

Multi-run now uses the normal chat routing path
Slash commands are sent as commands instead of plain text
Type-check and lint pass
This commit is contained in:
Bohdan Triapitsyn
2026-05-25 16:00:48 +03:00
parent c444415cb2
commit f585ca2f60
2 changed files with 12 additions and 13 deletions
+11 -12
View File
@@ -1,5 +1,5 @@
import { create } from 'zustand';
import { useSessionUIStore } from '@/sync/session-ui-store';
import { routeMessage, useSessionUIStore } from '@/sync/session-ui-store';
import { devtools } from 'zustand/middleware';
import type { CreateMultiRunParams, CreateMultiRunResult } from '@/types/multirun';
import { opencodeClient } from '@/lib/opencode/client';
@@ -244,17 +244,16 @@ export const useMultiRunStore = create<MultiRunStore>()(
createdRuns.map(async (run) => {
try {
const text = await expandText(run.prompt).catch(() => run.prompt);
await opencodeClient.withDirectory(run.worktreePath, () =>
opencodeClient.sendMessage({
id: run.sessionId,
providerID: run.providerID,
modelID: run.modelID,
variant: run.variant,
text,
agent,
files: filesForMessage,
}),
);
await routeMessage({
sessionId: run.sessionId,
directory: run.worktreePath,
content: text,
providerID: run.providerID,
modelID: run.modelID,
variant: run.variant,
agent,
files: filesForMessage,
});
} catch (err) {
console.warn('[MultiRun] Failed to start run:', err);
}
+1 -1
View File
@@ -61,7 +61,7 @@ export type { AttachedFile }
// Send routing — shell mode, slash commands, or normal prompt
// ---------------------------------------------------------------------------
function routeMessage(params: {
export function routeMessage(params: {
sessionId: string
directory?: string | null
content: string