Merge remote-tracking branch 'gitea/master' into sidecar-app-store

This commit is contained in:
2026-08-11 19:10:52 +00:00
30 changed files with 2313 additions and 729 deletions
+9 -5
View File
@@ -23,7 +23,7 @@ import {
renameOpenCodeSession,
isOpenCodeSessionId,
} from './opencode-sessions';
import { getOpenCodeSession } from './opencode/state';
import { getOpenCodePrompt, getOpenCodeSession } from './opencode/state';
import { listChatModels } from './list-models';
import { logger } from './logger';
import { readSttConfig } from '../server-settings/stt';
@@ -55,7 +55,8 @@ chatRouter.use(async (ctx, next) => {
// The working directory a request operates on: an explicit ?cwd= (a chosen pwd), else the default
// 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.)
// OpenCode runs on one fixed serve, but each session records the directory its turn ran in, so cwd
// selects there too.
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.
@@ -173,9 +174,12 @@ chatRouter.get('/live', async (ctx) => {
isGenerating: true,
pendingTasks: 0,
harness: 'opencode' as const,
// Still null for the first seconds of a turn: the id is only known once the subprocess prints it.
// That window is real and short, and showing nothing beats showing a key the user has never seen.
title: meta?.title ?? null,
// OpenCode's own title wins as soon as it exists — it is derived from the conversation and is
// better than anything we would compose. Until then (and it titles asynchronously, so "until
// then" covers the whole time a turn is RUNNING, which is exactly what this panel shows) fall
// back to the prompt that started the session. Same shape as the Claude side, which has never
// shown a live row without a name.
title: meta?.title && meta.title !== '(untitled)' ? meta.title : (getOpenCodePrompt(sessionKey) ?? null),
cwd: meta?.cwd || null,
};
});