chat: rename claude_sessions → general_chat_sessions; drop dead chat_sessions

The default /chat working directory is used by both the Claude and OpenCode harnesses
now, so its Claude-specific name was misleading.

- Rename the dir + accessors: getClaudeSessionsCwd → getGeneralChatSessionsCwd,
  ensureClaudeSessionsCwd → ensureGeneralChatSessionsCwd, path segment claude_sessions
  → general_chat_sessions (data-path on disk + code + UI labels/comments). No history
  migration — the old Claude transcript slug is orphaned (intentionally).

- Remove the vestigial chat_sessions dir (leftover from the retired session store):
  it only ever held empty claude/archived/ dirs, recreated by a signin hook. Drop that
  hook (+ its dead imports) and the 4 unused data-path accessors (getUserSessionsDir,
  getClaudeDir, getSessionDir, getArchivedSessionDir), and delete the dir.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 11:50:48 +00:00
co-authored by Claude Opus 4.8
parent 9a79a76b95
commit 0c3f270419
10 changed files with 107 additions and 60 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ import type { Context } from 'hono';
import { createRouter } from '../../create-router';
import { getUserSettings } from 'officerdb';
import {
getClaudeSessionsCwd,
getGeneralChatSessionsCwd,
listClaudePwds,
listClaudeSessions,
loadClaudeSession,
@@ -24,14 +24,14 @@ import { transcribeAudio } from '../stt/transcribe';
export const chatRouter = createRouter();
// The working directory a request operates on: an explicit ?cwd= (a chosen pwd), else the default
// claude_sessions dir. Claude groups sessions by cwd, so this selects which project group we read.
// general_chat_sessions dir. Claude groups sessions by cwd, so this selects which project group we read.
// (OpenCode sessions all live in the one fixed server and ignore cwd.)
const cwdOf = (ctx: Context, email: string): string => ctx.req.query('cwd')?.trim() || getClaudeSessionsCwd(email);
const cwdOf = (ctx: Context, email: string): string => ctx.req.query('cwd')?.trim() || getGeneralChatSessionsCwd(email);
// GET /chat/pwds — the default /chat dir plus every directory that already has Claude sessions.
chatRouter.get('/pwds', (ctx) => {
const email = ctx.get('user').email;
return ctx.json({ pwds: listClaudePwds(email), default: getClaudeSessionsCwd(email) });
return ctx.json({ pwds: listClaudePwds(email), default: getGeneralChatSessionsCwd(email) });
});
// GET /chat/sessions[?cwd=] — conversations for a working directory, merged across both harnesses