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:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user