This commit is contained in:
Dax Raad 2025-11-19 12:56:21 -05:00
parent 2e0e72c4df
commit 95f5bdf6bf
3 changed files with 16 additions and 3 deletions

View file

@ -9,7 +9,7 @@ import {
fg,
type KeyBinding,
} from "@opentui/core"
import { createEffect, createMemo, Match, Switch, type JSX, onMount, batch } from "solid-js"
import { createEffect, createMemo, Match, Switch, type JSX, onMount } from "solid-js"
import { useLocal } from "@tui/context/local"
import { useTheme } from "@tui/context/theme"
import { SplitBorder } from "@tui/component/border"
@ -425,7 +425,10 @@ export function Prompt(props: PromptProps) {
},
body: {
agent: local.agent.current().name,
model: `${local.model.current().providerID}/${local.model.current().modelID}`,
model: {
providerID: local.model.current().providerID,
modelID: local.model.current().modelID,
},
command: inputText,
},
})

View file

@ -1085,6 +1085,12 @@ export namespace SessionPrompt {
export const ShellInput = z.object({
sessionID: Identifier.schema("session"),
agent: z.string(),
model: z
.object({
providerID: z.string(),
modelID: z.string(),
})
.optional(),
command: z.string(),
})
export type ShellInput = z.infer<typeof ShellInput>
@ -1094,7 +1100,7 @@ export namespace SessionPrompt {
SessionRevert.cleanup(session)
}
const agent = await Agent.get(input.agent)
const model = agent.model ?? (await lastModel(input.sessionID))
const model = input.model ?? agent.model ?? (await lastModel(input.sessionID))
const userMsg: MessageV2.User = {
id: Identifier.ascending("message"),
sessionID: input.sessionID,

View file

@ -2294,6 +2294,10 @@ export type SessionCommandResponse = SessionCommandResponses[keyof SessionComman
export type SessionShellData = {
body?: {
agent: string
model?: {
providerID: string
modelID: string
}
command: string
}
path: {