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 { create } from 'zustand';
import { useSessionUIStore } from '@/sync/session-ui-store'; import { routeMessage, useSessionUIStore } from '@/sync/session-ui-store';
import { devtools } from 'zustand/middleware'; import { devtools } from 'zustand/middleware';
import type { CreateMultiRunParams, CreateMultiRunResult } from '@/types/multirun'; import type { CreateMultiRunParams, CreateMultiRunResult } from '@/types/multirun';
import { opencodeClient } from '@/lib/opencode/client'; import { opencodeClient } from '@/lib/opencode/client';
@@ -244,17 +244,16 @@ export const useMultiRunStore = create<MultiRunStore>()(
createdRuns.map(async (run) => { createdRuns.map(async (run) => {
try { try {
const text = await expandText(run.prompt).catch(() => run.prompt); const text = await expandText(run.prompt).catch(() => run.prompt);
await opencodeClient.withDirectory(run.worktreePath, () => await routeMessage({
opencodeClient.sendMessage({ sessionId: run.sessionId,
id: run.sessionId, directory: run.worktreePath,
providerID: run.providerID, content: text,
modelID: run.modelID, providerID: run.providerID,
variant: run.variant, modelID: run.modelID,
text, variant: run.variant,
agent, agent,
files: filesForMessage, files: filesForMessage,
}), });
);
} catch (err) { } catch (err) {
console.warn('[MultiRun] Failed to start run:', 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 // Send routing — shell mode, slash commands, or normal prompt
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
function routeMessage(params: { export function routeMessage(params: {
sessionId: string sessionId: string
directory?: string | null directory?: string | null
content: string content: string