You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not able to rename chat sessions in 1.0.152. Dialog for renaming shows up and allows for renaming, but reverts back the the default name after submitting.
I've investigated this issue and found the root cause:
The rename DOES work at the backend level
The JSON files in storage are correctly updated. For example:
{
"id": "ses_4e3a579daffeoAdHvBK3FdvzlE",
"title": "Debugging rename function in opencode", // ✅ Updated correctly...
}
The problem is in the UI sync mechanism
The issue is in packages/opencode/src/cli/cmd/tui/context/sync.tsx:
case"session.updated": {constresult=Binary.search(store.session,event.properties.info.id,(s)=>s.id)if(result.found){setStore("session",result.index,reconcile(event.properties.info))break}// If not found, it tries to insert at the wrong indexsetStore("session",produce((draft)=>{draft.splice(result.index,0,event.properties.info)}),)break}
The Binary.search may fail to find the session if the session array in the store is not sorted in the same order that Binary.search expects (by ID string comparison).
Workaround
Close the session list (Escape) and reopen it (Ctrl+X L) - the renamed title will appear since it's already persisted.
Environment
OpenCode version: 1.0.152
OS: macOS
Storage: Using symlink from ~/.local/share/opencode/storage to ~/context/opencode/storage
@rekram1-node This seems to be working now. It probably was pulling the name from a cached index for me instead of the new name given. Once all opencode instances were restarted, it seems to have been fixed. Thank you!
Activity
github-actions commentedon Dec 13, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Dec 14, 2025
Are you sure this is still an issue?
Screen.Recording.2025-12-13.at.10.48.06.PM.mov
can't replicate
cedefrespo commentedon Dec 14, 2025
Additional Diagnosis
I've investigated this issue and found the root cause:
The rename DOES work at the backend level
The JSON files in storage are correctly updated. For example:
{ "id": "ses_4e3a579daffeoAdHvBK3FdvzlE", "title": "Debugging rename function in opencode", // ✅ Updated correctly ... }The problem is in the UI sync mechanism
The issue is in
packages/opencode/src/cli/cmd/tui/context/sync.tsx:The
Binary.searchmay fail to find the session if the session array in the store is not sorted in the same order thatBinary.searchexpects (by ID string comparison).Workaround
Close the session list (Escape) and reopen it (Ctrl+X L) - the renamed title will appear since it's already persisted.
Environment
~/.local/share/opencode/storageto~/context/opencode/storageI'm working on a PR to fix this.
fix(tui): add linear search fallback for session update/delete sync
ranjanjayapal commentedon Dec 14, 2025
@rekram1-node This seems to be working now. It probably was pulling the name from a cached index for me instead of the new name given. Once all opencode instances were restarted, it seems to have been fixed. Thank you!
rekram1-node commentedon Dec 14, 2025
Yeah we don't sync across instances rn we should fix that