Repository navigation
A failed in-place rename says so once, in official's words - #1269
Merged
Merged
Conversation
Official: Rename session is also the slash command /rename: with words after it the session takes them as its title, bare it asks the server to generate a new title; a new command, Generate session title, does the same; the header's title shimmers meanwhile and a second ask does nothing (packages/app/src/session/timeline/message-timeline.tsx:300-319, :702-704, controller.tsx:455-494). Ours had Rename session as an edit in place only. A command's /name can now take words (CommandEntry::words in opencode-kernel; only a plugin's could). The ask is the session's update with an empty title, one per session at a time (features/session-menu/src/generate_title.rs); its answer comes back as a rename's does, and the session is read again after it.
The first head showed the new title at once and did not put it back: with no server, or a server that refuses, the header and the tab kept a title the server never took (seen in the run: /rename New words on a fixture file kept New words with a toast that nothing was sent). Official sends the update and shows the title when the server's event comes (packages/app/src/session/timeline/controller.tsx:472-478). Ours now does the same: the write goes out and session.renamed brings the title.
The title edited in place (a tab's menu, the header) showed two toasts when its save could not be sent: the write's own 'Not connected to an OpenCode server' and the edit's 'Failed to rename session'. Official shows one, titled Request failed, with the error's words under it, or none after a time-out; with no server its error reads Request failed (packages/app/src/shell/titlebar/tab-rename-machine.ts:274-283, tab-nav.tsx:321-327, :354-357). The save's write now says nothing itself when it cannot go (App::write_quiet); the edit's machine says the one toast: Request failed / Request failed when not sent, Request failed alone after 15 s. A server's refusal of a rename is titled Request failed too, as an archive's already is.
What a failed save has to say (nothing, not sent, the server's refusal) decided who shows the toast by comparing strings; it is an enum now.
The quiet write hands back why it could not go. With no writer the edit shows official's Request failed; in a build that may not send, which official does not have, it shows what any write shows there: Nothing sent, read-only.
Official takes the failure toast description from error.message (packages/app/src/shell/titlebar/tab-nav.tsx:354-357), repeating Request failed only because its no-server-context branch rejects with new Error('Request failed') (:321-327). Ours has a real cause on the no-writer path (Not connected to an OpenCode server), so the one toast now reads Request failed / Not connected to an OpenCode server instead of repeating its title.
Hona
marked this pull request as ready for review
November 25, 2026 23:59
This was referenced Nov 26, 2026
Hona
added a commit
that referenced
this pull request
Nov 26, 2026
* Unsent writes from rename dialog, question/permission replies, and queue changes show one toast Follow-up to #1269 for the four remaining write paths whose own state machines emit a failure toast when a write cannot be sent: rename dialog (features/session-menu/src/rename_dialog.rs), permission and question form replies (features/timeline-extras/src/permission/mod.rs), and queued prompt changes (features/inbox/src/queue/{mod,run}.rs). Each now offers its write quietly via App::write_quiet so the machine emits a single toast: official's Request failed (or queue changeFailed) with the cause Not connected to an OpenCode server when no writer is attached, and our single read-only toast in a read-only window. * Scope PR to rename dialog: drop non-existent permission double-toast and split queue Reading permission/mod.rs:150-154 and :168-172 shows reply_permission and send_form already return early through host.write when !writes_open(), and App::write emits no toast on Ok(false) (dead channel), so permission and question form replies never showed a double toast. Queued prompt changes require a live --read-only server to exercise (fixture mutates locally) and move to their own draft PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A session's title edited in place (a tab's menu, the header) showed two toasts for one failed save. It now shows one, in official's words. A fault of ours only: no official commit, so no ledger row.
What changes
error.message(packages/app/src/shell/titlebar/tab-nav.tsx:354-357; with no server context it rejects withnew Error("Request failed"),:321-327)tab-rename-machine.ts:274-283,:282)tab-nav.tsx:354-357; the dialogproject-session-row.tsx:276-279;/rename wordssession/timeline/controller.tsx:480-482)In every case the title the server last accepted is put back, as before.
The last row also closes a difference #1249 named: a refused
/rename wordsnow reads Request failed.How
apps/desktop/src/session/inbox/send.rs:App::writeis split intooffer(hands the write to the server's writer, or says why there is none:Unsent::ReadOnly,Unsent::NoWriter),write(offer+ the toast, as before for every other write) andwrite_quiet(offeralone). The session menu's host haswrite_server_quietfor it, which hands back what became of the write (Offered::Sent,NoWriter,ReadOnly;features/session-menu/src/host.rs,apps/desktop/src/session/menu.rs).features/session-menu/src/rename.rsdispatch). What a failed save has to say was a string compared with a translated sentence; it is an enum now,Why::{Unsaid, NotSent, ReadOnly, Refused}.common.requestFailed(features/session-menu/src/lib.rssession_write_replied), as an archive's and a restore's already are.How it differs from official, and what is left
features/session-menu/src/rename_dialog.rs:172-179) and a queued prompt's change (features/inbox/src/queue/mod.rs:339-343, its write path not traced yet). One later change closes both.rune.toast.renameNoAnsweris no longer used. It stays in the locale files.Run
A PR build is of the PR's own head.
dev's build from before A bare /rename asks the server for a new session title (opencode#66396) #1249, headcc991c6505, and on A bare /rename asks the server for a new session title (opencode#66396) #1249's headc87457101): the tab's menu, Rename, "By the menu" typed, Return: the title back as it was and two toasts, "Not connected to an OpenCode server" / "Nothing was sent." and "Failed to rename session" / "Not connected to an OpenCode server".13ec78b41, the head that merges (headless, Windows x64 CI build, run45721451658, the app's own fixture file, no server; 2 launches exit 0; before = opencode-rune chore(pgo): the profiles re-keyed to Rune 5342f14d's symbol names #1271's own PR build, head278f9aaf38, run45709668204):"By the menu", Return: header and tab keep"Sidebar shows stale session titles", and one toast shows:"Request failed"/"Not connected to an OpenCode server". Before (278f9aaf38): two toasts ("Not connected to an OpenCode server"/"Nothing was sent."and"Failed to rename session"/"Not connected to an OpenCode server").title-buttonpressed),"By the header", Return: header and tab keep"Sidebar shows stale session titles", and one toast shows:"Request failed"/"Not connected to an OpenCode server".dfa0ae5c4(headless, Windows x64 CI build, run45712898391, same fixture and before build; only the two-lineWhy::NotSentdescription string changed betweendfa0ae5c4and13ec78b41): cases 3 and 4 hold (/rename New wordsclears composer, keeps title, shows one toast"Not connected to an OpenCode server"/"Nothing was sent."; Archive from a session's menu on Home shows the same one toast).45721451658green on13ec78b41(guardrails, macOS, Windows x64, Windows arm64, Linux x64; Linux arm64 skipped).devtook no file of this change since its base.The cases (headless, this PR's Windows x64 build, the app's own fixture file, no server):
title-button), a new title, Return: the same one toast./rename New words, Return (the shared-file sample:features/session-menu/src/lib.rs,host.rs,apps/desktop/src/session/menu.rsare A bare /rename asks the server for a new session title (opencode#66396) #1249's too): the composer clears, the title stays, one toast "Not connected to an OpenCode server" / "Nothing was sent." (this write is not the edit's, and says so itself as before).--fixturesimulates a reply instead of callingApp::write).With a server (a read-only window has one:
--read-onlyon a live server):Not run, each needs a server: case 5; a refusal (case: a server that answers the rename with an error: one toast "Request failed" with the server's words); no answer in 15 s (a server that stalls: one toast "Request failed" with nothing under it, and a late failure says nothing more).