[PR #5439] fix - might be critical? : session rename completely not working since v1.0.144 #11407

Closed
opened 2026-02-16 18:16:14 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5439

State: closed
Merged: No


Summary

Fix session rename functionality (/rename command) that has been broken since v1.0.144.

Root Cause Analysis

Issue 1: Missing await in API call (since v1.0.10)

Commit 30f9fa12d9 ("tui: add session rename functionality with /rename command", 2025-10-31) introduced DialogSessionRename component without await on the API call:

onConfirm={(value) => {
  sdk.client.session.update({...})  // No await!
  dialog.clear()  // Closes immediately, ignoring API result
}}

This meant any API errors were silently ignored.

Issue 2: time field became required (since v1.0.144)

Commit 936a6be5d6 ("stuff adam needs", 2025-12-10) added a time field to the session update validator but made it required:

validator("json", z.object({
  title: z.string().optional(),
  time: z.object({  // Required! But DialogSessionRename only sends title
    archived: z.number().optional(),
  }),
})),

Since DialogSessionRename only sends { sessionID, title } without time, all rename requests started failing with 400 validation error. Combined with Issue 1 (missing await), users saw no error - the dialog just closed and nothing happened.

Fix

  1. server.ts: Make time field optional in session update validator
  2. dialog-session-rename.tsx: Add async/await to properly handle API response

Affected Versions

  • v1.0.10 ~ v1.0.143: Rename worked but errors were silently ignored
  • v1.0.144+: Rename completely broken (validation failure + silent error)

Related Issues

  • Fixes #5369 (The /rename command is invalid in version 1.0.144 and later versions)
  • Might fix #3779 (Session rename via /rename or /session + ctrl-r not working) - reported earlier, possibly same underlying issue

Changes

File Change
server.ts Make time field .optional() in session update validator
dialog-session-rename.tsx Add async/await to API call
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5439 **State:** closed **Merged:** No --- ## Summary Fix session rename functionality (`/rename` command) that has been broken since v1.0.144. ## Root Cause Analysis ### Issue 1: Missing `await` in API call (since v1.0.10) Commit 30f9fa12d9 ("tui: add session rename functionality with /rename command", 2025-10-31) introduced `DialogSessionRename` component without `await` on the API call: ```typescript onConfirm={(value) => { sdk.client.session.update({...}) // No await! dialog.clear() // Closes immediately, ignoring API result }} ``` This meant any API errors were silently ignored. ### Issue 2: `time` field became required (since v1.0.144) Commit 936a6be5d6 ("stuff adam needs", 2025-12-10) added a `time` field to the session update validator but made it **required**: ```typescript validator("json", z.object({ title: z.string().optional(), time: z.object({ // Required! But DialogSessionRename only sends title archived: z.number().optional(), }), })), ``` Since `DialogSessionRename` only sends `{ sessionID, title }` without `time`, all rename requests started failing with 400 validation error. Combined with Issue 1 (missing await), users saw no error - the dialog just closed and nothing happened. ## Fix 1. **server.ts**: Make `time` field optional in session update validator 2. **dialog-session-rename.tsx**: Add `async/await` to properly handle API response ## Affected Versions - v1.0.10 ~ v1.0.143: Rename worked but errors were silently ignored - v1.0.144+: Rename completely broken (validation failure + silent error) ## Related Issues - Fixes #5369 (The /rename command is invalid in version 1.0.144 and later versions) - Might fix #3779 (Session rename via /rename or /session + ctrl-r not working) - reported earlier, possibly same underlying issue ## Changes | File | Change | |------|--------| | `server.ts` | Make `time` field `.optional()` in session update validator | | `dialog-session-rename.tsx` | Add `async/await` to API call |
yindo added the pull-request label 2026-02-16 18:16:14 -05:00
yindo closed this issue 2026-02-16 18:16:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11407