fix: resolve TypeScript errors in session status and lock usage

This commit is contained in:
Dax Raad 2025-11-13 17:55:14 -05:00
parent 961210f496
commit f4480fe000
3 changed files with 4 additions and 3 deletions

0
a.out Normal file
View file

View file

@ -798,7 +798,7 @@ export function Session() {
<Shimmer text={lastUserMessage().model.modelID} color={theme.text} />
<Show when={status().type === "retry"}>
<text fg={theme.error}>
{status().message} [retry #{status().attempt}]
{(status() as any).message} [retry #{(status() as any).attempt}]
</text>
</Show>
</box>

View file

@ -16,6 +16,7 @@ import { Log } from "../util/log"
import { ProviderTransform } from "@/provider/transform"
import { SessionRetry } from "./retry"
import { Config } from "@/config/config"
import { Lock } from "../util/lock"
export namespace SessionCompaction {
const log = Log.create({ service: "session.compaction" })
@ -87,8 +88,8 @@ export namespace SessionCompaction {
}
export async function run(input: { sessionID: string; providerID: string; modelID: string; signal?: AbortSignal }) {
await using lock = input.signal === undefined ? SessionLock.acquire({ sessionID: input.sessionID }) : undefined
const signal = input.signal ?? lock!.signal
const signal = input.signal ?? new AbortController().signal
await using lock = input.signal === undefined ? await Lock.write(input.sessionID) : undefined
await Session.update(input.sessionID, (draft) => {
draft.time.compacting = Date.now()