Support a --continue flag to persist context in a new session #849

Closed
opened 2026-02-16 17:28:32 -05:00 by yindo · 27 comments
Owner

Originally created by @mcncl on GitHub (Jul 21, 2025).

Originally assigned to: @thdxr on GitHub.

Problem

Due to issues like https://github.com/sst/opencode/issues/725, where limits aren't clear and no messaging is provided, it's easy to assume that OpenCode has just stopped working, so moving to another tool such as Amp or Claude Code is the assumed solution. However, those tools then inform you that limits have been reached. At that point though, context for OpenCode has been lost, so I need to interact with the tool to get it back up to speed with where we were.

Suggestion

Given we have a /share command, I would assume that there is some context stored for the current conversation. Would it be possible to therefore support a --continue flag when running opencode so that the previous conversation can continue and context is not lost? I would assume there are some logs or session information in the locally stored DB?

I appreciate that's a few assumptions, but I'd like to continue to use OpenCode and not have to quit out to check that usage limits are the issue, losing my progress and conversation.

Else, can we add information on usage limits to the conversation window?

Originally created by @mcncl on GitHub (Jul 21, 2025). Originally assigned to: @thdxr on GitHub. ## Problem Due to issues like https://github.com/sst/opencode/issues/725, where limits aren't clear and no messaging is provided, it's easy to assume that OpenCode has just stopped working, so moving to another tool such as Amp or Claude Code is the assumed solution. However, those tools then inform you that limits have been reached. At that point though, context for OpenCode has been lost, so I need to interact with the tool to get it back up to speed with where we were. ## Suggestion Given we have a `/share` command, I would assume that there is some context stored for the current conversation. Would it be possible to therefore support a `--continue` flag when running `opencode` so that the previous conversation can continue and context is not lost? I would assume there are some logs or session information in the locally stored DB? I appreciate that's a few _assumptions_, but I'd like to continue to use OpenCode and not have to quit out to check that usage limits are the issue, losing my progress and conversation. Else, can we add information on usage limits to the conversation window?
yindo closed this issue 2026-02-16 17:28:32 -05:00
Author
Owner

@thdxr commented on GitHub (Jul 22, 2025):

maybe im not following but can't you open the session list and get back to the old session?

@thdxr commented on GitHub (Jul 22, 2025): maybe im not following but can't you open the session list and get back to the old session?
Author
Owner

@mcncl commented on GitHub (Jul 31, 2025):

@thdxr wow. 😬Apologies for wasting your time even opening this. This is clearly me being dumb; I just assumed it would be a flag or sub command on the opencode command.

I'll close this and just thank you for providing such a great tool.

@mcncl commented on GitHub (Jul 31, 2025): @thdxr wow. 😬Apologies for wasting your time even opening this. This is clearly me being dumb; I just assumed it would be a flag or sub command on the `opencode` command. I'll close this and just thank you for providing such a great tool.
Author
Owner

@davidchase commented on GitHub (Sep 3, 2025):

maybe im not following but can't you open the session list and get back to the old session?

@thdxr I actually have this issue I was in a session and now the session list is empty and cannot continue my old session, are they perhaps stored somewhere?

@davidchase commented on GitHub (Sep 3, 2025): > maybe im not following but can't you open the session list and get back to the old session? @thdxr I actually have this issue I was in a session and now the session list is empty and cannot continue my old session, are they perhaps stored somewhere?
Author
Owner

@rekram1-node commented on GitHub (Sep 3, 2025):

@davidchase I think you migrations may have failed, I can help you debug.

What version of opencode are you on, what do you see if you run:

cat ~/.local/share/opencode/storage/migration
@rekram1-node commented on GitHub (Sep 3, 2025): @davidchase I think you migrations may have failed, I can help you debug. What version of opencode are you on, what do you see if you run: ``` cat ~/.local/share/opencode/storage/migration ```
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

That would be awesome @rekram1-node !

➜ ~ opencode --version
0.6.4

➜ ~ cat ~/.local/share/opencode/storage/migration
1

@davidchase commented on GitHub (Sep 4, 2025): That would be awesome @rekram1-node ! ➜ ~ opencode --version 0.6.4 ➜ ~ cat ~/.local/share/opencode/storage/migration 1
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

@davidchase delete that migration file I just had you cat, then start opencode

it will run the migrations for say 10 seconds to a minute or so (no visual indication atm)

once it is done the tui will boot

@rekram1-node commented on GitHub (Sep 4, 2025): @davidchase delete that migration file I just had you cat, then start opencode it will run the migrations for say 10 seconds to a minute or so (no visual indication atm) once it is done the tui will boot
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

once that happens first:
check if you have any sessions listed

if not:
show me the latest log file

it would be in ~/.local/share/opencode/log/

@rekram1-node commented on GitHub (Sep 4, 2025): once that happens first: check if you have any sessions listed if not: show me the latest log file it would be in ~/.local/share/opencode/log/
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

will the migration delete the session i have started since ive lost the previous one? i dont want to lose the new one too

@davidchase commented on GitHub (Sep 4, 2025): will the migration delete the session i have started since ive lost the previous one? i dont want to lose the new one too
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

it shouldn’t but I can double check if you want

@rekram1-node commented on GitHub (Sep 4, 2025): it shouldn’t but I can double check if you want
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

ok i exported the session that i had started just in case, then deleted that migration you had me 'cat' and then started opencode and i have only my single new session there and not old one from before

@davidchase commented on GitHub (Sep 4, 2025): ok i exported the session that i had started just in case, then deleted that migration you had me 'cat' and then started opencode and i have only my single new session there and not old one from before
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

@davidchase can you show me the latest log file

@rekram1-node commented on GitHub (Sep 4, 2025): @davidchase can you show me the latest log file
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

sure the log from today is

➜  log cat 2025-09-04T140923.log
INFO  2025-09-04T14:09:23 +50ms service=default version=0.6.4 args=[] opencode
INFO  2025-09-04T14:09:23 +1ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:23 +10ms service=config path=/Users/davidcasa/.config/opencode/config.json loading
INFO  2025-09-04T14:09:23 +0ms service=config path=/Users/davidcasa/.config/opencode/opencode.json loading
INFO  2025-09-04T14:09:23 +0ms service=config path=/Users/davidcasa/.config/opencode/opencode.jsonc loading
INFO  2025-09-04T14:09:23 +2ms service=plugin path=opencode-copilot-auth@0.0.2 loading plugin
INFO  2025-09-04T14:09:23 +1ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
INFO  2025-09-04T14:09:23 +11ms service=bus type=* subscribing
INFO  2025-09-04T14:09:23 +0ms service=bus type=session.updated subscribing
INFO  2025-09-04T14:09:23 +0ms service=bus type=message.updated subscribing
INFO  2025-09-04T14:09:23 +0ms service=bus type=message.part.updated subscribing
INFO  2025-09-04T14:09:23 +0ms service=format init
INFO  2025-09-04T14:09:23 +0ms service=bus type=file.edited subscribing
INFO  2025-09-04T14:09:23 +1ms service=lsp serverIds=typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd enabled LSP servers
INFO  2025-09-04T14:09:23 +1ms service=models.dev file={} refreshing
INFO  2025-09-04T14:09:23 +3ms service=provider init
INFO  2025-09-04T14:09:23 +0ms service=provider providerID=opencode found
INFO  2025-09-04T14:09:23 +0ms service=provider providerID=anthropic found
INFO  2025-09-04T14:09:23 +2ms service=default cmd=["/Users/davidcasa/.cache/opencode/tui/tui-tdf4tf8r."] tui
INFO  2025-09-04T14:09:23 +18ms service=server method=GET path=/agent request
INFO  2025-09-04T14:09:23 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:23 +1ms service=server duration=1 response
INFO  2025-09-04T14:09:23 +0ms service=server method=GET path=/path request
INFO  2025-09-04T14:09:23 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:23 +0ms service=server duration=0 response
INFO  2025-09-04T14:09:23 +0ms service=server method=GET path=/project/current request
INFO  2025-09-04T14:09:24 +1ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +0ms service=server duration=0 response
INFO  2025-09-04T14:09:24 +1ms service=server method=GET path=/config request
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +0ms service=server duration=0 response
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +8ms service=server method=GET path=/command request
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +0ms service=server duration=0 response
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +1ms service=server method=GET path=/file/status request
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +0ms service=server duration=0 response
INFO  2025-09-04T14:09:24 +0ms service=server method=GET path=/event request
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +0ms service=server event connected
INFO  2025-09-04T14:09:24 +2ms service=bus type=* subscribing
INFO  2025-09-04T14:09:24 +0ms service=server duration=2 response
INFO  2025-09-04T14:09:24 +1ms service=server method=GET path=/config/providers request
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +0ms service=server duration=0 response
INFO  2025-09-04T14:09:24 +0ms service=server method=GET path=/tui/control/next request
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +1ms service=tui commands={"agent_cycle":{},"agent_cycle_reverse":{},"agent_list":{},"app_exit":{},"app_help":{},"editor_open":{},"input_clear":{},"input_newline":{},"input_paste":{},"input_submit":{},"messages_copy":{},"messages_first":{},"messages_half_page_down":{},"messages_half_page_up":{},"messages_last":{},"messages_page_down":{},"messages_page_up":{},"messages_redo":{},"messages_undo":{},"model_cycle_recent":{},"model_cycle_recent_reverse":{},"model_list":{},"project_init":{},"session_child_cycle":{},"session_child_cycle_reverse":{},"session_compact":{},"session_export":{},"session_interrupt":{},"session_list":{},"session_new":{},"session_share":{},"session_timeline":{},"session_unshare":{},"theme_list":{},"thinking_blocks":{},"tool_details":{}} Loaded commands
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +7ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +9ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +6ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:24 +1ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:26 +2386ms service=server method=GET path=/session request
INFO  2025-09-04T14:09:26 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory
INFO  2025-09-04T14:09:26 +2ms service=server duration=2 response
@davidchase commented on GitHub (Sep 4, 2025): sure the log from today is ```shell ➜ log cat 2025-09-04T140923.log INFO 2025-09-04T14:09:23 +50ms service=default version=0.6.4 args=[] opencode INFO 2025-09-04T14:09:23 +1ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:23 +10ms service=config path=/Users/davidcasa/.config/opencode/config.json loading INFO 2025-09-04T14:09:23 +0ms service=config path=/Users/davidcasa/.config/opencode/opencode.json loading INFO 2025-09-04T14:09:23 +0ms service=config path=/Users/davidcasa/.config/opencode/opencode.jsonc loading INFO 2025-09-04T14:09:23 +2ms service=plugin path=opencode-copilot-auth@0.0.2 loading plugin INFO 2025-09-04T14:09:23 +1ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin INFO 2025-09-04T14:09:23 +11ms service=bus type=* subscribing INFO 2025-09-04T14:09:23 +0ms service=bus type=session.updated subscribing INFO 2025-09-04T14:09:23 +0ms service=bus type=message.updated subscribing INFO 2025-09-04T14:09:23 +0ms service=bus type=message.part.updated subscribing INFO 2025-09-04T14:09:23 +0ms service=format init INFO 2025-09-04T14:09:23 +0ms service=bus type=file.edited subscribing INFO 2025-09-04T14:09:23 +1ms service=lsp serverIds=typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd enabled LSP servers INFO 2025-09-04T14:09:23 +1ms service=models.dev file={} refreshing INFO 2025-09-04T14:09:23 +3ms service=provider init INFO 2025-09-04T14:09:23 +0ms service=provider providerID=opencode found INFO 2025-09-04T14:09:23 +0ms service=provider providerID=anthropic found INFO 2025-09-04T14:09:23 +2ms service=default cmd=["/Users/davidcasa/.cache/opencode/tui/tui-tdf4tf8r."] tui INFO 2025-09-04T14:09:23 +18ms service=server method=GET path=/agent request INFO 2025-09-04T14:09:23 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:23 +1ms service=server duration=1 response INFO 2025-09-04T14:09:23 +0ms service=server method=GET path=/path request INFO 2025-09-04T14:09:23 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:23 +0ms service=server duration=0 response INFO 2025-09-04T14:09:23 +0ms service=server method=GET path=/project/current request INFO 2025-09-04T14:09:24 +1ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +0ms service=server duration=0 response INFO 2025-09-04T14:09:24 +1ms service=server method=GET path=/config request INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +0ms service=server duration=0 response INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +8ms service=server method=GET path=/command request INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +0ms service=server duration=0 response INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +1ms service=server method=GET path=/file/status request INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +0ms service=server duration=0 response INFO 2025-09-04T14:09:24 +0ms service=server method=GET path=/event request INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +0ms service=server event connected INFO 2025-09-04T14:09:24 +2ms service=bus type=* subscribing INFO 2025-09-04T14:09:24 +0ms service=server duration=2 response INFO 2025-09-04T14:09:24 +1ms service=server method=GET path=/config/providers request INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +0ms service=server duration=0 response INFO 2025-09-04T14:09:24 +0ms service=server method=GET path=/tui/control/next request INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +1ms service=tui commands={"agent_cycle":{},"agent_cycle_reverse":{},"agent_list":{},"app_exit":{},"app_help":{},"editor_open":{},"input_clear":{},"input_newline":{},"input_paste":{},"input_submit":{},"messages_copy":{},"messages_first":{},"messages_half_page_down":{},"messages_half_page_up":{},"messages_last":{},"messages_page_down":{},"messages_page_up":{},"messages_redo":{},"messages_undo":{},"model_cycle_recent":{},"model_cycle_recent_reverse":{},"model_list":{},"project_init":{},"session_child_cycle":{},"session_child_cycle_reverse":{},"session_compact":{},"session_export":{},"session_interrupt":{},"session_list":{},"session_new":{},"session_share":{},"session_timeline":{},"session_unshare":{},"theme_list":{},"thinking_blocks":{},"tool_details":{}} Loaded commands INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +7ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +9ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +6ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:24 +1ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:26 +2386ms service=server method=GET path=/session request INFO 2025-09-04T14:09:26 +0ms service=project directory=/Users/davidcasa/chiron fromDirectory INFO 2025-09-04T14:09:26 +2ms service=server duration=2 response ```
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

let me know if i should add logs from yesterday since i noticed the issue of missing session then, it seems i have more logs from yesterday with larger sizes

@davidchase commented on GitHub (Sep 4, 2025): let me know if i should add logs from yesterday since i noticed the issue of missing session then, it seems i have more logs from yesterday with larger sizes
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

I suppose it doesn't hurt, mostly what I need is the logs immediately after deleting the migration and then rerunning opencode

@rekram1-node commented on GitHub (Sep 4, 2025): I suppose it doesn't hurt, mostly what I need is the logs immediately after deleting the migration and then rerunning opencode
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

the logs i shared above are from today after deleting that migration file

@davidchase commented on GitHub (Sep 4, 2025): the logs i shared above are from today after deleting that migration file
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

That's very strange then, looks like no errors… did you run it in the same dir that previously had the session you were looking for?

@rekram1-node commented on GitHub (Sep 4, 2025): That's very strange then, looks like no errors… did you run it in the same dir that previously had the session you were looking for?
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

yes i working in ~/chiron that had the original session that was lost and now started a new session same directory

@davidchase commented on GitHub (Sep 4, 2025): yes i working in ~/chiron that had the original session that was lost and now started a new session same directory
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

Hmm I'm not really sure then maybe some failure is happening silently I will check

@rekram1-node commented on GitHub (Sep 4, 2025): Hmm I'm not really sure then maybe some failure is happening silently I will check
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

@rekram1-node here is the log i think around when the session went missing because i was getting errors that were popping up and after that i noticed my session was gone this one has error logs along with info

2025-08-29T131955.log

@davidchase commented on GitHub (Sep 4, 2025): @rekram1-node here is the log i think around when the session went missing because i was getting errors that were popping up and after that i noticed my session was gone this one has error logs along with info [2025-08-29T131955.log](https://github.com/user-attachments/files/22142828/2025-08-29T131955.log)
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

Hmm still no errors related to what I'd expect

@rekram1-node commented on GitHub (Sep 4, 2025): Hmm still no errors related to what I'd expect
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

so probably no way to recover it?

@davidchase commented on GitHub (Sep 4, 2025): so probably no way to recover it?
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

you can try looking around in ~/.local/share/opencode/storage/ but recovering likely requires a bit of work

@rekram1-node commented on GitHub (Sep 4, 2025): you can try looking around in \~/.local/share/opencode/storage/ but recovering likely requires a bit of work
Author
Owner

@davidchase commented on GitHub (Sep 4, 2025):

thanks for the tips btw much appreciate you looking into this... one last question any way to try to prevent session loss in the future? should i just export daily the sessions?

@davidchase commented on GitHub (Sep 4, 2025): thanks for the tips btw much appreciate you looking into this... one last question any way to try to prevent session loss in the future? should i just export daily the sessions?
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

no problem, it is hard to say because I don't know what caused loss here, you could've changed the dir name, accidentally deleted, a whole host of things.

I haven't had any sessions randomly disappear but if you are super worried about sessions then maybe making a /share link would be useful.

I think super long sessions are generally an anti pattern so I always split them up per task rather than 1 giant one

@rekram1-node commented on GitHub (Sep 4, 2025): no problem, it is hard to say because I don't know what caused loss here, you could've changed the dir name, accidentally deleted, a whole host of things. I haven't had any sessions randomly disappear but if you are super worried about sessions then maybe making a /share link would be useful. I think super long sessions are generally an anti pattern so I always split them up per task rather than 1 giant one
Author
Owner

@acornforth commented on GitHub (Nov 10, 2025):

@rekram1-node I have also had the issue of sessions disappearing from the /sessions list.

I can see that there are still a number of sessions stored in json files in ~/.local/share/opencode/storage/sessions, and a bunch of corresponding messages, but they are not listed when i use the command in tui.

my migration file just says '2' and i've observed this in version 1.0.45, and not resolved by updating to 1.0.55

I also tried the steps you mentioned above, deleting the migration file and re-running the tui, but no change to the empty session list.

attempting to load the session directly using the -s <session_id> flag yield the following error:

INFO  2025-11-10T13:09:13 +69ms service=config path=/home/acorn/.config/opencode/config.json loading
INFO  2025-11-10TERROR 2025-11-10T13:09:14 +339ms service=default e=undefined is not an object (evaluating 'scroll.scrollTo') exception
rvice=config path=/home/acorn/.config/opencode/opencode.jsonc loading
INFO  2025-11-10T13:09:13 +23ms service=server method=GET path=/config/providers request
INFO  2025-11-10T13:09:13 +0ms service=server status=started method=GET path=/config/providers request

and attempting to opencode import the session from the file name, fails with a different error, but i assume this is because "exported" sessions have a different format? :

ERROR 2025-11-10T13:10:55 +8ms service=default name=TypeError message=undefined is not an object (evaluating 'exportData.info.id') stack=TypeError: undefined is not an object (evaluating 'exportData.info.id')
    at <anonymous> (src/cli/cmd/import.ts:84:71)
    at processTicksAndRejections (native:7:39) fatal

I've searched the issues and i can't see any currently open or active ticket tracking this. Should i create one?

I hope this extra information is useful for debugging, please let me know if you discover a way i can restore these sessions 🤞🏼

@acornforth commented on GitHub (Nov 10, 2025): @rekram1-node I have also had the issue of sessions disappearing from the /sessions list. I can see that there are still a number of sessions stored in json files in `~/.local/share/opencode/storage/sessions`, and a bunch of corresponding messages, but they are not listed when i use the command in tui. my migration file just says '2' and i've observed this in version 1.0.45, and not resolved by updating to 1.0.55 I also tried the steps you mentioned above, deleting the migration file and re-running the tui, but no change to the empty session list. attempting to load the session directly using the -s <session_id> flag yield the following error: ``` INFO 2025-11-10T13:09:13 +69ms service=config path=/home/acorn/.config/opencode/config.json loading INFO 2025-11-10TERROR 2025-11-10T13:09:14 +339ms service=default e=undefined is not an object (evaluating 'scroll.scrollTo') exception rvice=config path=/home/acorn/.config/opencode/opencode.jsonc loading INFO 2025-11-10T13:09:13 +23ms service=server method=GET path=/config/providers request INFO 2025-11-10T13:09:13 +0ms service=server status=started method=GET path=/config/providers request ``` and attempting to `opencode import` the session from the file name, fails with a different error, but i assume this is because "exported" sessions have a different format? : ``` ERROR 2025-11-10T13:10:55 +8ms service=default name=TypeError message=undefined is not an object (evaluating 'exportData.info.id') stack=TypeError: undefined is not an object (evaluating 'exportData.info.id') at <anonymous> (src/cli/cmd/import.ts:84:71) at processTicksAndRejections (native:7:39) fatal ``` I've searched the issues and i can't see any currently open or active ticket tracking this. Should i create one? I hope this extra information is useful for debugging, please let me know if you discover a way i can restore these sessions 🤞🏼
Author
Owner

@rekram1-node commented on GitHub (Nov 10, 2025):

@acornforth hm the import should still work id think

I have heard someone else have this issue tooo

maybe there is a bug if a message is created in a certain state then it breaks the session making it seem “deleted”

@rekram1-node commented on GitHub (Nov 10, 2025): @acornforth hm the import should still work id think I have heard someone else have this issue tooo maybe there is a bug if a message is created in a certain state then it breaks the session making it seem “deleted”
Author
Owner

@manascb1344 commented on GitHub (Jan 18, 2026):

maybe im not following but can't you open the session list and get back to the old session?

IN the case where i moved the folder to a new path, i notice that there are no previous sessions
Is there a way to fix this
I tried exporting session to md file from opencode tui, it generated an md file then i tried opencode import, however it only works with json or opencode.ai urls

@manascb1344 commented on GitHub (Jan 18, 2026): > maybe im not following but can't you open the session list and get back to the old session? IN the case where i moved the folder to a new path, i notice that there are no previous sessions Is there a way to fix this I tried exporting session to md file from opencode tui, it generated an md file then i tried opencode import, however it only works with json or opencode.ai urls
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#849