This commit is contained in:
Dax Raad 2025-10-24 12:32:22 -04:00
parent 6dc73575d2
commit a6e19a07ea
5 changed files with 14 additions and 11 deletions

View file

@ -9,7 +9,7 @@
"test": "bun test",
"build": "./script/build.ts",
"dev": "bun run --conditions=browser ./src/index.ts",
"random": "echo 'This is a modified random script'"
"random": "echo 'Random script updated at $(date)'"
},
"bin": {
"opencode": "./bin/opencode"

View file

@ -574,9 +574,6 @@ function UserMessage(props: {
</For>
</box>
</Show>
<Show when={props.message.summary}>
<text>EXPERIMENTAL: {props.message.summary!.text}</text>
</Show>
<text>
{sync.data.config.username ?? "You"}{" "}
<Show
@ -619,7 +616,12 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
<text fg={Theme.textMuted}>{props.message.error?.data.message}</text>
</box>
</Show>
<Show when={!props.message.time.completed || (props.last && props.message.finish === "tool-calls")}>
<Show
when={
!props.message.time.completed ||
(props.last && props.parts.some((item) => item.type === "step-finish" && item.reason === "tool-calls"))
}
>
<box
paddingLeft={2}
marginTop={1}
@ -633,7 +635,12 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
<Shimmer text={`${props.message.modelID}`} color={Theme.text} />
</box>
</Show>
<Show when={props.message.time.completed && props.message.finish === "stop"}>
<Show
when={
props.message.time.completed &&
props.parts.some((item) => item.type === "step-finish" && item.reason !== "tool-calls")
}
>
<box paddingLeft={3}>
<text marginTop={1}>
<span style={{ fg: local.agent.color(props.message.mode) }}>{Locale.titlecase(props.message.mode)}</span>{" "}

View file

@ -314,7 +314,6 @@ export namespace MessageV2 {
])
.optional(),
system: z.string().array(),
finish: z.string().optional(),
parentID: z.string(),
modelID: z.string(),
providerID: z.string(),

View file

@ -1358,8 +1358,6 @@ export namespace SessionPrompt {
case "finish":
assistantMsg.time.completed = Date.now()
assistantMsg.finish = value.finishReason
if (blocked) assistantMsg.finish = "rejected"
await Session.updateMessage(assistantMsg)
break
@ -1374,7 +1372,6 @@ export namespace SessionPrompt {
log.error("process", {
error: e,
})
assistantMsg.finish = "error"
const error = MessageV2.fromError(e, { providerID: input.providerID })
if (retries.count < retries.max && MessageV2.APIError.isInstance(error) && error.data.isRetryable) {
shouldRetry = true

View file

@ -672,7 +672,6 @@ export type AssistantMessage = {
}
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError
system: Array<string>
finish?: string
parentID: string
modelID: string
providerID: string
@ -855,6 +854,7 @@ export type StepFinishPart = {
sessionID: string
messageID: string
type: "step-finish"
reason: string
snapshot?: string
cost: number
tokens: {