mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix: resolve TypeScript errors in session status and lock usage
This commit is contained in:
parent
961210f496
commit
f4480fe000
3 changed files with 4 additions and 3 deletions
0
a.out
Normal file
0
a.out
Normal 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>
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue