diff options
| author | Dax Raad <[email protected]> | 2026-04-17 11:41:24 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-04-17 11:41:24 -0400 |
| commit | a27d3c162335946d3e6ed8a6a5a621006a88511e (patch) | |
| tree | fc3e1e0e82fbfa58898348f3c224190b647eab3a | |
| parent | 551216a452836a033e35bf88f64845bc966eef8f (diff) | |
| download | opencode-a27d3c162335946d3e6ed8a6a5a621006a88511e.tar.gz opencode-a27d3c162335946d3e6ed8a6a5a621006a88511e.zip | |
tui: fix session resumption with --session-id flag to navigate after app initialization
Previously when passing a session ID directly, the route was set during initial
render which could cause navigation issues before the router was fully ready.
Now the session navigation happens after initialization completes, ensuring
the TUI properly loads the requested session when users resume with --session-id.
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/app.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index 74eca9a0f..585e1ed23 100644 --- a/packages/opencode/src/cli/cmd/tui/app.tsx +++ b/packages/opencode/src/cli/cmd/tui/app.tsx @@ -150,7 +150,7 @@ export function tui(input: { <ToastProvider> <RouteProvider initialRoute={ - (input.args.sessionID || input.args.continue) && !input.args.fork + input.args.continue ? { type: "session", sessionID: "dummy", @@ -342,6 +342,12 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) { }) local.model.set({ providerID, modelID }, { recent: true }) } + if (args.sessionID && !args.fork) { + route.navigate({ + type: "session", + sessionID: args.sessionID, + }) + } }) }) |
