Skip to content

Commit f5f1b77

Browse files
committed
Refresh flashgrep binaries, add desktop dev config, and skip ACP session reuse
1 parent b6c684e commit f5f1b77

8 files changed

Lines changed: 145 additions & 1 deletion

File tree

resources/flashgrep/flashgrep-aarch64-apple-darwin

100644100755
File mode changed.

resources/flashgrep/flashgrep-aarch64-unknown-linux-gnu

100644100755
File mode changed.

resources/flashgrep/flashgrep-x86_64-apple-darwin

100644100755
File mode changed.

resources/flashgrep/flashgrep-x86_64-unknown-linux-gnu

100644100755
File mode changed.

scripts/dev.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ async function main() {
708708
if (mode === 'desktop') {
709709
await ensureDesktopOpenSslIfNeeded();
710710
const desktopDir = path.join(ROOT_DIR, 'src/apps/desktop');
711-
const tauriConfig = path.join(desktopDir, 'tauri.conf.json');
711+
const tauriConfig = path.join(desktopDir, 'tauri.dev.conf.json');
712712
if (process.platform === 'win32') {
713713
// Running the generated .cmd shim directly via spawn is flaky on Windows.
714714
// Use cmd.exe with an explicit args array so the desktop app directory
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"$schema": "https://schema.tauri.app/config/2",
3+
"productName": "BitFun",
4+
"identifier": "com.bitfun.desktop",
5+
"build": {
6+
"beforeDevCommand": "pnpm run dev:web",
7+
"devUrl": "http://localhost:1422",
8+
"beforeBuildCommand": "pnpm run build:web && pnpm run prepare:mobile-web",
9+
"frontendDist": "../../../dist"
10+
},
11+
"bundle": {
12+
"active": true,
13+
"targets": "all",
14+
"icon": [
15+
"icons/icon.icns",
16+
"icons/icon.ico",
17+
"icons/icon.png"
18+
],
19+
"resources": {
20+
"../../mobile-web/dist": "mobile-web/dist",
21+
"resources/worker_host.js": "resources/worker_host.js"
22+
},
23+
"linux": {
24+
"deb": {
25+
"depends": [
26+
"libwebkit2gtk-4.1-0",
27+
"libgtk-3-0"
28+
],
29+
"files": {
30+
"/usr/share/icons/hicolor/16x16/apps/bitfun-desktop.png": "icons/hicolor/16x16/apps/bitfun-desktop.png",
31+
"/usr/share/icons/hicolor/32x32/apps/bitfun-desktop.png": "icons/hicolor/32x32/apps/bitfun-desktop.png",
32+
"/usr/share/icons/hicolor/48x48/apps/bitfun-desktop.png": "icons/hicolor/48x48/apps/bitfun-desktop.png",
33+
"/usr/share/icons/hicolor/64x64/apps/bitfun-desktop.png": "icons/hicolor/64x64/apps/bitfun-desktop.png",
34+
"/usr/share/icons/hicolor/96x96/apps/bitfun-desktop.png": "icons/hicolor/96x96/apps/bitfun-desktop.png",
35+
"/usr/share/icons/hicolor/128x128/apps/bitfun-desktop.png": "icons/hicolor/128x128/apps/bitfun-desktop.png",
36+
"/usr/share/icons/hicolor/256x256/apps/bitfun-desktop.png": "icons/hicolor/256x256/apps/bitfun-desktop.png",
37+
"/usr/share/icons/hicolor/512x512/apps/bitfun-desktop.png": "icons/hicolor/512x512/apps/bitfun-desktop.png"
38+
},
39+
"postInstallScript": "scripts/post-install-icons.sh"
40+
},
41+
"appimage": {
42+
"bundleMediaFramework": false
43+
}
44+
}
45+
},
46+
"app": {
47+
"windows": [],
48+
"security": {
49+
"csp": null
50+
},
51+
"macOSPrivateApi": true,
52+
"withGlobalTauri": true
53+
}
54+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import { afterEach, describe, expect, it } from 'vitest';
2+
import { flowChatStore } from '@/flow_chat/store/FlowChatStore';
3+
import type { FlowChatState, Session } from '@/flow_chat/types/flow-chat';
4+
import { WorkspaceKind, type WorkspaceInfo } from '@/shared/types';
5+
import { findReusableEmptySessionId } from './projectSessionWorkspace';
6+
7+
const resetStore = () => {
8+
flowChatStore.setState((): FlowChatState => ({
9+
sessions: new Map(),
10+
activeSessionId: null,
11+
}));
12+
};
13+
14+
const createWorkspace = (): WorkspaceInfo => ({
15+
id: 'workspace-1',
16+
name: 'BitFun',
17+
rootPath: '/workspace/BitFun',
18+
workspaceKind: WorkspaceKind.Normal,
19+
});
20+
21+
const createSession = (overrides: Partial<Session> = {}): Session => ({
22+
sessionId: 'session-1',
23+
title: 'Session 1',
24+
dialogTurns: [],
25+
status: 'idle',
26+
config: { agentType: 'agentic' },
27+
createdAt: 1,
28+
lastActiveAt: 1,
29+
error: null,
30+
isHistorical: false,
31+
maxContextTokens: 128128,
32+
mode: 'agentic',
33+
workspacePath: '/workspace/BitFun',
34+
workspaceId: 'workspace-1',
35+
sessionKind: 'normal',
36+
btwThreads: [],
37+
isTransient: false,
38+
...overrides,
39+
});
40+
41+
describe('findReusableEmptySessionId', () => {
42+
afterEach(() => {
43+
resetStore();
44+
});
45+
46+
it('does not reuse an empty ACP session for a new code session', () => {
47+
const workspace = createWorkspace();
48+
const acpSession = createSession({
49+
sessionId: 'acp-session',
50+
config: { agentType: 'acp:codex' },
51+
mode: 'acp:codex',
52+
lastActiveAt: 10,
53+
});
54+
55+
flowChatStore.setState(() => ({
56+
sessions: new Map([[acpSession.sessionId, acpSession]]),
57+
activeSessionId: acpSession.sessionId,
58+
}));
59+
60+
expect(findReusableEmptySessionId(workspace, 'agentic')).toBeNull();
61+
});
62+
63+
it('still reuses a matching empty code session when ACP sessions also exist', () => {
64+
const workspace = createWorkspace();
65+
const codeSession = createSession({
66+
sessionId: 'code-session',
67+
lastActiveAt: 5,
68+
});
69+
const acpSession = createSession({
70+
sessionId: 'acp-session',
71+
config: { agentType: 'acp:codex' },
72+
mode: 'acp:codex',
73+
lastActiveAt: 20,
74+
});
75+
76+
flowChatStore.setState(() => ({
77+
sessions: new Map([
78+
[codeSession.sessionId, codeSession],
79+
[acpSession.sessionId, acpSession],
80+
]),
81+
activeSessionId: acpSession.sessionId,
82+
}));
83+
84+
expect(findReusableEmptySessionId(workspace, 'agentic')).toBe(codeSession.sessionId);
85+
});
86+
});

src/web-ui/src/app/utils/projectSessionWorkspace.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { flowChatStore } from '@/flow_chat/store/FlowChatStore';
22
import type { Session } from '@/flow_chat/types/flow-chat';
3+
import { isAcpFlowSession } from '@/flow_chat/utils/acpSession';
34
import { WorkspaceKind, isRemoteWorkspace, type WorkspaceInfo } from '@/shared/types';
45

56
type SessionDisplayBucket = 'code' | 'cowork' | 'claw';
@@ -53,6 +54,9 @@ function isEmptyReusableSession(session: Session, workspace: WorkspaceInfo, buck
5354
if (session.sessionKind !== 'normal') {
5455
return false;
5556
}
57+
if (isAcpFlowSession(session)) {
58+
return false;
59+
}
5660
if (session.isHistorical) {
5761
return false;
5862
}

0 commit comments

Comments
 (0)