fix(tui): preserve session route on transient errors
This commit is contained in:
parent
068c32df39
commit
c7b2dfc280
1 changed files with 11 additions and 10 deletions
|
|
@ -25,15 +25,16 @@ import { Spinner, SPINNER_FRAMES } from "../../component/spinner"
|
||||||
import { ThemeContextProvider, useTheme, useThemes } from "../../context/theme"
|
import { ThemeContextProvider, useTheme, useThemes } from "../../context/theme"
|
||||||
import { BoxRenderable, ScrollBoxRenderable, addDefaultParsers, TextAttributes, RGBA } from "@opentui/core"
|
import { BoxRenderable, ScrollBoxRenderable, addDefaultParsers, TextAttributes, RGBA } from "@opentui/core"
|
||||||
import { Prompt, type PromptRef } from "../../component/prompt"
|
import { Prompt, type PromptRef } from "../../component/prompt"
|
||||||
import type {
|
import {
|
||||||
ModelInfo,
|
isSessionNotFoundError,
|
||||||
SessionMessageInfo,
|
type ModelInfo,
|
||||||
SessionMessageAssistant,
|
type SessionMessageInfo,
|
||||||
SessionMessageAssistantReasoning,
|
type SessionMessageAssistant,
|
||||||
SessionMessageAssistantText,
|
type SessionMessageAssistantReasoning,
|
||||||
SessionMessageAssistantTool,
|
type SessionMessageAssistantText,
|
||||||
SessionMessageUser,
|
type SessionMessageAssistantTool,
|
||||||
SessionInfo,
|
type SessionMessageUser,
|
||||||
|
type SessionInfo,
|
||||||
} from "@opencode-ai/client"
|
} from "@opencode-ai/client"
|
||||||
import { useLocal } from "../../context/local"
|
import { useLocal } from "../../context/local"
|
||||||
import { Locale } from "../../util/locale"
|
import { Locale } from "../../util/locale"
|
||||||
|
|
@ -282,7 +283,7 @@ export function Session() {
|
||||||
variant: "error",
|
variant: "error",
|
||||||
duration: 5000,
|
duration: 5000,
|
||||||
})
|
})
|
||||||
navigate({ type: "home" })
|
if (isSessionNotFoundError(error)) navigate({ type: "home" })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue