{"record":{"id":"90cd00c7866b2f83","repo":"different-ai/openwork","slug":"app-error-session-name-required","errorCode":null,"errorMessage":"app.error_session_name_required","messagePattern":"app\\.error_session_name_required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/session/sync/actions-store.ts","lineNumber":775,"sourceCode":"      const id = options.messageIdFromInfo(candidate);\n      if (id && id < messageID) {\n        prior = candidate;\n        break;\n      }\n    }\n\n    if (prior) {\n      options.restorePromptFromUserMessage(prior);\n      return;\n    }\n\n    options.setPrompt(\"\");\n  }\n\n  async function renameSessionTitle(sessionID: string, title: string) {\n    const trimmed = title.trim();\n    if (!trimmed) {\n      throw new Error(t(\"app.error_session_name_required\"));\n    }\n\n    await options.renameSession(sessionID, trimmed);\n    await options.refreshSidebarWorkspaceSessions(options.selectedWorkspaceId()).catch(() => undefined);\n  }\n\n  async function deleteSessionById(sessionID: string) {\n    const trimmed = sessionID.trim();\n    if (!trimmed) return;\n    const c = options.client();\n    if (!c) {\n      throw new Error(t(\"app.error_not_connected\"));\n    }\n\n    const root = options.selectedWorkspaceRoot().trim();\n    const directory = toSessionTransportDirectory(root);\n    const params = directory ? { sessionID: trimmed, directory } : { sessionID: trimmed };\n    unwrap(await c.session.delete(params));","sourceCodeStart":757,"sourceCodeEnd":793,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/session/sync/actions-store.ts#L757-L793","documentation":"renameSessionTitle validates that the new session title is non-empty after trimming whitespace. An empty or whitespace-only title cannot identify the session in the sidebar, so the localized message 'app.error_session_name_required' is thrown before calling options.renameSession.","triggerScenarios":"Calling renameSessionTitle(sessionID, title) with title = '' or a string of only whitespace (e.g. the user cleared the rename input and pressed Enter).","commonSituations":"Rename dialog allowing an empty submit; programmatic rename from an automation with an unset title variable; pasting only spaces or invisible characters into the rename field.","solutions":["Trim and validate the title in the UI before calling renameSessionTitle; disable the confirm button while trimmed title is empty.","Pass a fallback title (e.g. 'Untitled session') when input is blank.","Catch the error and show the localized validation message in the rename dialog."],"exampleFix":"// before: await store.renameSessionTitle(id, input.value) | // after: const title = input.value.trim(); if (title) await store.renameSessionTitle(id, title)","handlingStrategy":"validation","validationCode":"const title = newTitle.trim(); if (!title) { showToast(t('app.error_session_name_required')); return; } await store.renameSessionTitle(sessionID, title);","typeGuard":null,"tryCatchPattern":"try { await store.renameSessionTitle(sessionID, title); } catch (e) { if (e.message.includes('error_session_name_required')) { setRenameError(t('app.error_session_name_required')); } else { throw e; } }","preventionTips":["Disable the rename confirm button while the trimmed input is empty.","Strip whitespace/invisible characters from rename input before submit.","Provide a default title fallback for programmatic renames."],"tags":["session","rename","validation","input"],"backgroundTag":"missing-required-argument","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}