@openchambery/web 1.19.8 → 1.19.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AssistantView-COc8I6gW.js → AssistantView-DnN3m4Dp.js} +1 -1
- package/dist/assets/{DiagramView-CoVZOXs9.js → DiagramView-E3efnEX7.js} +1 -1
- package/dist/assets/{MarkdownRenderer-_JCvalLT.js → MarkdownRenderer-BYryAKz2.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-DN4uUYze.js → MarkdownRendererImpl-CdpiFWqs.js} +1 -1
- package/dist/assets/MarkstreamRendererImpl-BPyoNg8p.js +3 -0
- package/dist/assets/{MobileDetailNavigation-BQsfM2Rw.js → MobileDetailNavigation-Cx7eDb4W.js} +1 -1
- package/dist/assets/{MobileShareBridge-Dxp1onW7.js → MobileShareBridge-B_go2MeO.js} +1 -1
- package/dist/assets/{MobileSurface-CQCBU22F.js → MobileSurface-ByPOhQrz.js} +1 -1
- package/dist/assets/{MultiRunWindow-DT1_Ns0D.js → MultiRunWindow-DLCZOjCj.js} +1 -1
- package/dist/assets/{SettingsView-Dt_5bHeR.js → SettingsView-C4mB0uFW.js} +1 -1
- package/dist/assets/{SettingsWindow-D9hpPkBj.js → SettingsWindow-OGO76Rgi.js} +1 -1
- package/dist/assets/{TerminalView-1PvRK1IA.js → TerminalView-Ck5P5GWU.js} +1 -1
- package/dist/assets/{ToolOutputDialog-DMbQi6z1.js → ToolOutputDialog-BenN_1If.js} +1 -1
- package/dist/assets/{appThemeRegistry-DPhbPffi.js → appThemeRegistry-DAH35eaE.js} +1 -1
- package/dist/assets/{gitApi-C_b8zklq.js → gitApi-DdJQDVmv.js} +1 -1
- package/dist/assets/{insertionBoundaries-BaWrDrco.js → insertionBoundaries-DRvsnrxu.js} +1 -1
- package/dist/assets/{main-D2HTQe9J.js → main-CEdvbeao.js} +2 -2
- package/dist/assets/{main-DWgbPYug.js → main-DPnPRJo9.js} +4 -4
- package/dist/assets/{miniChat-uGc-vzeR.js → miniChat-9KRGMcES.js} +2 -2
- package/dist/assets/{mobile-CcNC7nNg.js → mobile-CaTrLmyq.js} +2 -2
- package/dist/assets/{multirun-BhX-4Fl1.js → multirun-DZxLNwZx.js} +1 -1
- package/dist/assets/{projectMeta-bRWLqh7i.js → projectMeta-B4mvLrV7.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-DnSqUd-V.js → renderElectronMiniChatApp-IARSnJ6n.js} +2 -2
- package/dist/assets/{renderMobileApp-BBzRRO_F.js → renderMobileApp-CvA1QBLw.js} +4 -4
- package/dist/assets/{runtimeConfig-Dz9IoMdy.js → runtimeConfig-CmL9jcr-.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-zQSnGP_k.js → runtimeEndpointReset-DUO6iUn_.js} +1 -1
- package/dist/assets/{sessionLookup-Bd75H5dK.js → sessionLookup-CfllxmO1.js} +1 -1
- package/dist/assets/{useAppFontEffects-BF9UdL3e.js → useAppFontEffects-COqtb3tR.js} +5 -5
- package/dist/assets/{useDesktopWindowControlsLayout-SiK0UEm-.js → useDesktopWindowControlsLayout-nDXj3p6q.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-CUKxer0Q.js → useEffectiveDirectory-DOU5Xg5n.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-BUYEOEE2.js → useMobileNavigationStore-BawYHSru.js} +2 -2
- package/dist/assets/{useSessionAutoCleanup-B6CyB5t3.js → useSessionAutoCleanup-R4Ke7did.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-De_sQIec.js → useWorkerHighlightedLines-Dfd5Ra8Y.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/mini-chat.html +2 -2
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/server/lib/llm/DOCUMENTATION.md +9 -4
- package/server/lib/llm/generate.test.js +1 -0
- package/server/lib/notifications/DOCUMENTATION.md +1 -1
- package/server/lib/notifications/runtime.js +9 -2
- package/server/lib/notifications/runtime.test.js +144 -0
- package/server/lib/session-index/DOCUMENTATION.md +3 -2
- package/server/lib/session-index/service.js +1 -0
- package/server/lib/session-index/service.test.js +7 -2
- package/server/lib/session-title/DOCUMENTATION.md +4 -3
- package/server/lib/session-title/runtime.js +1 -0
- package/server/lib/session-title/runtime.test.js +6 -0
- package/dist/assets/MarkstreamRendererImpl-tc5eRLJw.js +0 -3
package/dist/mini-chat.html
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
}
|
|
75
75
|
</style>
|
|
76
76
|
|
|
77
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
77
|
+
<script type="module" crossorigin src="/assets/miniChat-9KRGMcES.js"></script>
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C0FnF6B9.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CnHfUmDN.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-B4dlGEM2.js">
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-947l7Ra3.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="/assets/types-BuiqMmh_.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DCowZ2ab.js">
|
|
94
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CmL9jcr-.js">
|
|
95
95
|
<link rel="stylesheet" crossorigin href="/assets/src-B-P5qIBc.css">
|
|
96
96
|
</head>
|
|
97
97
|
<body class="h-full bg-background text-foreground">
|
package/dist/mobile.html
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
66
|
+
<script type="module" crossorigin src="/assets/mobile-CaTrLmyq.js"></script>
|
|
67
67
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C0FnF6B9.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CnHfUmDN.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-B4dlGEM2.js">
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-947l7Ra3.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/types-BuiqMmh_.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DCowZ2ab.js">
|
|
83
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CmL9jcr-.js">
|
|
84
84
|
<link rel="stylesheet" crossorigin href="/assets/src-B-P5qIBc.css">
|
|
85
85
|
</head>
|
|
86
86
|
<body class="h-full bg-background text-foreground">
|
package/package.json
CHANGED
|
@@ -41,10 +41,15 @@ The 1.18.4 client exposes `GET /provider`, `GET /config/providers`, and
|
|
|
41
41
|
Non-vision models (for example deepseek-v4-flash) keep the `[image: …]`
|
|
42
42
|
description and any text-file bytes, and skip image data URLs so generate
|
|
43
43
|
cannot stall on unsupported vision parts. Non-image
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
text files are also inlined into the flattened prompt. Wait for idle via
|
|
45
|
+
`session.status` + `session.messages`, then delete the session. Throwaway
|
|
46
|
+
sessions are created with
|
|
47
|
+
`metadata.openchamber.llm.purpose = 'chat-completions'` (and archived
|
|
48
|
+
immediately) so sidebar visibility, session-index, session-title, and
|
|
49
|
+
notification/push fanout treat them as system-owned — same contract as
|
|
50
|
+
non-empty `smallModel.purpose`. This is a text generator only — never the
|
|
51
|
+
contact transcript and never a coding SessionPrompt loop. Upstream
|
|
52
|
+
`info.error.message` is forwarded on 502.
|
|
48
53
|
|
|
49
54
|
### Internal token callback (in-process only)
|
|
50
55
|
|
|
@@ -78,6 +78,7 @@ describe('generateOpenCodeText', () => {
|
|
|
78
78
|
|
|
79
79
|
expect(create).toHaveBeenCalledWith(expect.objectContaining({
|
|
80
80
|
title: expect.stringContaining('[openchamber-llm]'),
|
|
81
|
+
metadata: { openchamber: { llm: { purpose: 'chat-completions' } } },
|
|
81
82
|
}), expect.anything())
|
|
82
83
|
expect(update).toHaveBeenCalled()
|
|
83
84
|
expect(promptAsync).toHaveBeenCalledWith(expect.objectContaining({
|
|
@@ -47,7 +47,7 @@ This module provides notification message preparation utilities for the web serv
|
|
|
47
47
|
- Returned API:
|
|
48
48
|
- `maybeSendPushForTrigger(payload)`
|
|
49
49
|
- Owns:
|
|
50
|
-
- top-level completion/question/permission trigger routing; completion is the sole task-status notification. Ordinary push is limited to sidebar-visible root sessions. Child/subagent sessions, Assistant bindings (`openchamber.assistant.assistantID` unless `assigned.from === 'contact'`), scheduled-task sessions, small-model system sessions (`metadata.openchamber.smallModel.purpose`), and `smartfetch-secondary` titles are suppressed. Contact-assigned workers stay visible and still notify.
|
|
50
|
+
- top-level completion/question/permission trigger routing; completion is the sole task-status notification. Ordinary push is limited to sidebar-visible root sessions. Child/subagent sessions, Assistant bindings (`openchamber.assistant.assistantID` unless `assigned.from === 'contact'`), scheduled-task sessions, small-model system sessions (`metadata.openchamber.smallModel.purpose`), LLM gateway throwaway sessions (`metadata.openchamber.llm.purpose`), and `smartfetch-secondary` titles are suppressed. Contact-assigned workers stay visible and still notify.
|
|
51
51
|
- contact-turn notifications (`sendContactTurnNotification`) are a separate SMS-style path: title is the assistant nickname, body is the spoken message text, on desktop / UI SSE / web-push / APNs. APNs does **not** rewrite these into the generic "Task completed" scenario title.
|
|
52
52
|
- top-level completion/error Live Activity `end` (`sendLiveActivityEnd`), independent of ordinary push settings and UI visibility, with the same hidden-session suppression; duplicate terminal events are idempotent at the token store
|
|
53
53
|
- session meta cache for sidebar-visibility suppression
|
|
@@ -185,6 +185,9 @@ export const createNotificationTriggerRuntime = (deps) => {
|
|
|
185
185
|
smallModelPurpose: meta.smallModelPurpose !== undefined
|
|
186
186
|
? meta.smallModelPurpose
|
|
187
187
|
: (previous?.smallModelPurpose ?? null),
|
|
188
|
+
llmPurpose: meta.llmPurpose !== undefined
|
|
189
|
+
? meta.llmPurpose
|
|
190
|
+
: (previous?.llmPurpose ?? null),
|
|
188
191
|
assistantID: meta.assistantID !== undefined ? meta.assistantID : (previous?.assistantID ?? null),
|
|
189
192
|
assignedFrom: meta.assignedFrom !== undefined ? meta.assignedFrom : (previous?.assignedFrom ?? null),
|
|
190
193
|
scheduledTaskID: meta.scheduledTaskID !== undefined
|
|
@@ -202,6 +205,9 @@ export const createNotificationTriggerRuntime = (deps) => {
|
|
|
202
205
|
: null;
|
|
203
206
|
return {
|
|
204
207
|
smallModelPurpose: normalizeSmallModelPurpose(openchamber?.smallModel?.purpose),
|
|
208
|
+
// Throwaway LLM gateway sessions (`metadata.openchamber.llm.purpose`) share
|
|
209
|
+
// the same sidebar-hidden contract as small-model system sessions.
|
|
210
|
+
llmPurpose: normalizeSmallModelPurpose(openchamber?.llm?.purpose),
|
|
205
211
|
assistantID: nonEmptySystemID(openchamber?.assistant?.assistantID)
|
|
206
212
|
? openchamber.assistant.assistantID
|
|
207
213
|
: null,
|
|
@@ -292,6 +298,7 @@ export const createNotificationTriggerRuntime = (deps) => {
|
|
|
292
298
|
if (!meta) return false;
|
|
293
299
|
if (typeof meta.parentID === 'string' && meta.parentID.length > 0) return true;
|
|
294
300
|
if (typeof meta.smallModelPurpose === 'string' && meta.smallModelPurpose.length > 0) return true;
|
|
301
|
+
if (typeof meta.llmPurpose === 'string' && meta.llmPurpose.length > 0) return true;
|
|
295
302
|
if (typeof meta.assistantID === 'string' && meta.assistantID.length > 0 && meta.assignedFrom !== 'contact') {
|
|
296
303
|
return true;
|
|
297
304
|
}
|
|
@@ -302,8 +309,8 @@ export const createNotificationTriggerRuntime = (deps) => {
|
|
|
302
309
|
|
|
303
310
|
// Only sessions that can appear as sidebar roots get ordinary push. Child /
|
|
304
311
|
// subagent sessions, archived Assistant bindings, scheduled-task sessions,
|
|
305
|
-
// small-model system sessions, and SmartFetch secondaries are
|
|
306
|
-
// Contact-assigned worker sessions stay visible and still notify.
|
|
312
|
+
// small-model / LLM gateway system sessions, and SmartFetch secondaries are
|
|
313
|
+
// excluded. Contact-assigned worker sessions stay visible and still notify.
|
|
307
314
|
const shouldSkipSystemSessionNotification = async (sessionId, directory) => {
|
|
308
315
|
const meta = await fetchSessionMeta(sessionId, directory);
|
|
309
316
|
return isHiddenFromNavSession(meta);
|
|
@@ -229,6 +229,150 @@ describe('notification trigger runtime smallModel suppression', () => {
|
|
|
229
229
|
});
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
+
describe('notification trigger runtime llm system-session suppression', () => {
|
|
233
|
+
const llmSessionResponse = (purpose = 'chat-completions') => jsonResponse({
|
|
234
|
+
id: 'ses_llm',
|
|
235
|
+
parentID: null,
|
|
236
|
+
title: '[openchamber-llm] generate',
|
|
237
|
+
metadata: { openchamber: { llm: { purpose } } },
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
const expectAllOutletsSilent = ({
|
|
241
|
+
emitDesktopNotification,
|
|
242
|
+
broadcastUiNotification,
|
|
243
|
+
sendPushToAllUiSessions,
|
|
244
|
+
sendApnsToAllUiSessions,
|
|
245
|
+
sendLiveActivityEnd,
|
|
246
|
+
}) => {
|
|
247
|
+
expect(emitDesktopNotification).not.toHaveBeenCalled();
|
|
248
|
+
expect(broadcastUiNotification).not.toHaveBeenCalled();
|
|
249
|
+
expect(sendPushToAllUiSessions).not.toHaveBeenCalled();
|
|
250
|
+
expect(sendApnsToAllUiSessions).not.toHaveBeenCalled();
|
|
251
|
+
expect(sendLiveActivityEnd).not.toHaveBeenCalled();
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
it('skips ready notifications for llm sessions fetched by id', async () => {
|
|
255
|
+
vi.stubGlobal('fetch', vi.fn(async () => llmSessionResponse()));
|
|
256
|
+
const outlets = createRuntime();
|
|
257
|
+
await outlets.runtime.maybeSendPushForTrigger(completionPayload('ses_llm'));
|
|
258
|
+
expectAllOutletsSilent(outlets);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
it('skips ready notifications synthesized from session.idle for llm sessions', async () => {
|
|
262
|
+
vi.stubGlobal('fetch', vi.fn(async () => llmSessionResponse()));
|
|
263
|
+
const outlets = createRuntime();
|
|
264
|
+
await outlets.runtime.maybeSendPushForTrigger({
|
|
265
|
+
type: 'session.idle',
|
|
266
|
+
properties: {
|
|
267
|
+
directory: '/repo',
|
|
268
|
+
sessionID: 'ses_llm',
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
expectAllOutletsSilent(outlets);
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
it('skips error notifications and live-activity end for llm sessions', async () => {
|
|
275
|
+
vi.stubGlobal('fetch', vi.fn(async () => llmSessionResponse()));
|
|
276
|
+
const outlets = createRuntime();
|
|
277
|
+
await outlets.runtime.maybeSendPushForTrigger({
|
|
278
|
+
type: 'session.error',
|
|
279
|
+
properties: {
|
|
280
|
+
directory: '/repo',
|
|
281
|
+
sessionID: 'ses_llm',
|
|
282
|
+
error: 'boom',
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
expectAllOutletsSilent(outlets);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it('skips question notifications for llm sessions', async () => {
|
|
289
|
+
vi.useFakeTimers();
|
|
290
|
+
vi.stubGlobal('fetch', vi.fn(async () => llmSessionResponse()));
|
|
291
|
+
const outlets = createRuntime();
|
|
292
|
+
await outlets.runtime.maybeSendPushForTrigger({
|
|
293
|
+
type: 'question.asked',
|
|
294
|
+
properties: {
|
|
295
|
+
directory: '/repo',
|
|
296
|
+
sessionID: 'ses_llm',
|
|
297
|
+
questions: [{ header: 'Input needed', question: 'Continue?' }],
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
await vi.runAllTimersAsync();
|
|
301
|
+
expectAllOutletsSilent(outlets);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it('skips permission notifications for llm sessions', async () => {
|
|
305
|
+
vi.useFakeTimers();
|
|
306
|
+
vi.stubGlobal('fetch', vi.fn(async () => llmSessionResponse()));
|
|
307
|
+
const outlets = createRuntime();
|
|
308
|
+
await outlets.runtime.maybeSendPushForTrigger({
|
|
309
|
+
type: 'permission.asked',
|
|
310
|
+
properties: {
|
|
311
|
+
directory: '/repo',
|
|
312
|
+
sessionID: 'ses_llm',
|
|
313
|
+
id: 'perm_llm',
|
|
314
|
+
permission: 'edit',
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
|
+
await vi.runAllTimersAsync();
|
|
318
|
+
expectAllOutletsSilent(outlets);
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
it('uses session.updated event cache so later idle stays suppressed without llm on fetch', async () => {
|
|
322
|
+
const fetchMock = vi.fn(async () => jsonResponse({
|
|
323
|
+
id: 'ses_llm',
|
|
324
|
+
parentID: null,
|
|
325
|
+
title: 'Ordinary after strip',
|
|
326
|
+
metadata: {},
|
|
327
|
+
}));
|
|
328
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
329
|
+
const outlets = createRuntime();
|
|
330
|
+
await outlets.runtime.maybeSendPushForTrigger({
|
|
331
|
+
type: 'session.updated',
|
|
332
|
+
properties: {
|
|
333
|
+
directory: '/repo',
|
|
334
|
+
info: {
|
|
335
|
+
id: 'ses_llm',
|
|
336
|
+
sessionID: 'ses_llm',
|
|
337
|
+
parentID: null,
|
|
338
|
+
title: '[openchamber-llm] generate',
|
|
339
|
+
metadata: { openchamber: { llm: { purpose: 'chat-completions' } } },
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
});
|
|
343
|
+
await outlets.runtime.maybeSendPushForTrigger({
|
|
344
|
+
type: 'session.idle',
|
|
345
|
+
properties: {
|
|
346
|
+
directory: '/repo',
|
|
347
|
+
sessionID: 'ses_llm',
|
|
348
|
+
},
|
|
349
|
+
});
|
|
350
|
+
expect(fetchMock).not.toHaveBeenCalled();
|
|
351
|
+
expectAllOutletsSilent(outlets);
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it('does not treat empty llm.purpose as a hidden system session', async () => {
|
|
355
|
+
vi.stubGlobal('fetch', vi.fn(async () => jsonResponse({
|
|
356
|
+
id: 'ses_llm_empty',
|
|
357
|
+
parentID: null,
|
|
358
|
+
title: 'Looks like llm',
|
|
359
|
+
metadata: { openchamber: { llm: { purpose: '' } } },
|
|
360
|
+
})));
|
|
361
|
+
const {
|
|
362
|
+
runtime,
|
|
363
|
+
emitDesktopNotification,
|
|
364
|
+
sendPushToAllUiSessions,
|
|
365
|
+
sendApnsToAllUiSessions,
|
|
366
|
+
sendLiveActivityEnd,
|
|
367
|
+
} = createRuntime();
|
|
368
|
+
await runtime.maybeSendPushForTrigger(completionPayload('ses_llm_empty'));
|
|
369
|
+
expect(emitDesktopNotification).toHaveBeenCalledTimes(1);
|
|
370
|
+
expect(sendPushToAllUiSessions).toHaveBeenCalledTimes(1);
|
|
371
|
+
expect(sendApnsToAllUiSessions).toHaveBeenCalledTimes(1);
|
|
372
|
+
expect(sendLiveActivityEnd).toHaveBeenCalledWith({ sessionId: 'ses_llm_empty', status: 'complete' });
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
|
|
232
376
|
const rootSessionResponse = () => jsonResponse({
|
|
233
377
|
id: 'ses_root',
|
|
234
378
|
parentID: null,
|
|
@@ -18,8 +18,9 @@ the index excludes them from every snapshot and clears prior summaries when a
|
|
|
18
18
|
`metadata.openchamber.assistant.assistantID` (unless
|
|
19
19
|
`metadata.openchamber.assigned.from === 'contact'` — those are visible
|
|
20
20
|
coding workers the Assistant subscribed to),
|
|
21
|
-
`metadata.openchamber.scheduledTask.taskID`,
|
|
22
|
-
`metadata.openchamber.smallModel.purpose
|
|
21
|
+
`metadata.openchamber.scheduledTask.taskID`,
|
|
22
|
+
`metadata.openchamber.smallModel.purpose`, or
|
|
23
|
+
`metadata.openchamber.llm.purpose`. Title prefixes are human labels and
|
|
23
24
|
never participate in this filter. Metadata is the ownership/isolation signal;
|
|
24
25
|
`time.archived` is archive state; `time.pinned` is OpenChamber-owned pin state
|
|
25
26
|
overlaid from the independent `session_pin` table (also mirrored onto in-window
|
|
@@ -20,6 +20,7 @@ const isSystemSession = (session) => {
|
|
|
20
20
|
if (nonEmptySystemID(openchamber.assistant?.assistantID) && !isContactAssignedSession(openchamber)) return true;
|
|
21
21
|
if (nonEmptySystemID(openchamber.scheduledTask?.taskID)) return true;
|
|
22
22
|
if (nonEmptySystemID(openchamber.smallModel?.purpose)) return true;
|
|
23
|
+
if (nonEmptySystemID(openchamber.llm?.purpose)) return true;
|
|
23
24
|
return false;
|
|
24
25
|
};
|
|
25
26
|
|
|
@@ -68,7 +68,7 @@ describe('Electron session index', () => {
|
|
|
68
68
|
service.close();
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
it('excludes Assistant, Scheduled, and
|
|
71
|
+
it('excludes Assistant, Scheduled, smallModel, and llm system sessions from ordinary sidebar summaries', () => {
|
|
72
72
|
const runtimeRef = { value: 'http://runtime-a.test' };
|
|
73
73
|
const service = createService(runtimeRef);
|
|
74
74
|
const assistantSession = {
|
|
@@ -83,11 +83,15 @@ describe('Electron session index', () => {
|
|
|
83
83
|
...session('ses_small_model', 97),
|
|
84
84
|
metadata: { openchamber: { smallModel: { purpose: 'session-title' } } },
|
|
85
85
|
};
|
|
86
|
+
const llmSession = {
|
|
87
|
+
...session('ses_llm', 96),
|
|
88
|
+
metadata: { openchamber: { llm: { purpose: 'chat-completions' } } },
|
|
89
|
+
};
|
|
86
90
|
const ordinary = session('ses_ordinary', 98);
|
|
87
91
|
|
|
88
92
|
service.replaceDirectory({
|
|
89
93
|
directory: '/repo',
|
|
90
|
-
sessions: [assistantSession, scheduledSession, smallModelSession, ordinary],
|
|
94
|
+
sessions: [assistantSession, scheduledSession, smallModelSession, llmSession, ordinary],
|
|
91
95
|
cursor: null,
|
|
92
96
|
hasMore: false,
|
|
93
97
|
});
|
|
@@ -96,6 +100,7 @@ describe('Electron session index', () => {
|
|
|
96
100
|
service.upsert(assistantSession);
|
|
97
101
|
service.upsert(scheduledSession);
|
|
98
102
|
service.upsert(smallModelSession);
|
|
103
|
+
service.upsert(llmSession);
|
|
99
104
|
expect(service.snapshot().directories[0].sessions.map((item) => item.id)).toEqual(['ses_ordinary']);
|
|
100
105
|
service.close();
|
|
101
106
|
});
|
|
@@ -35,9 +35,10 @@ throttle (`TITLE_THROTTLE_MS`) when a refresh is armed.
|
|
|
35
35
|
3. On fire:
|
|
36
36
|
- Skip when Settings → Chat → session title refresh is off.
|
|
37
37
|
- Skip system-owned sessions whose metadata carries a non-empty
|
|
38
|
-
`openchamber.assistant.assistantID`, `openchamber.scheduledTask.taskID`,
|
|
39
|
-
`openchamber.smallModel.purpose`
|
|
40
|
-
(fixed Assistant / scheduled / small-model titles must not be
|
|
38
|
+
`openchamber.assistant.assistantID`, `openchamber.scheduledTask.taskID`,
|
|
39
|
+
`openchamber.smallModel.purpose`, or `openchamber.llm.purpose`
|
|
40
|
+
(fixed Assistant / scheduled / small-model / LLM gateway titles must not be
|
|
41
|
+
rewritten). Early
|
|
41
42
|
`session.created` and smart-title request extraction skip the same
|
|
42
43
|
metadata when present so timers are not armed.
|
|
43
44
|
- Skip sub-agent sessions (`parentID`), multi-run/fusion structural titles,
|
|
@@ -167,6 +167,7 @@ export const isSystemOwnedSession = (sessionOrInfo) => {
|
|
|
167
167
|
if (typeof openchamber.assistant?.assistantID === 'string' && openchamber.assistant.assistantID) return true;
|
|
168
168
|
if (typeof openchamber.scheduledTask?.taskID === 'string' && openchamber.scheduledTask.taskID) return true;
|
|
169
169
|
if (typeof openchamber.smallModel?.purpose === 'string' && openchamber.smallModel.purpose) return true;
|
|
170
|
+
if (typeof openchamber.llm?.purpose === 'string' && openchamber.llm.purpose) return true;
|
|
170
171
|
return false;
|
|
171
172
|
};
|
|
172
173
|
|
|
@@ -235,6 +235,9 @@ describe('session-title helpers', () => {
|
|
|
235
235
|
expect(isSystemOwnedSession({
|
|
236
236
|
metadata: { openchamber: { smallModel: { purpose: 'session-title' } } },
|
|
237
237
|
})).toBe(true);
|
|
238
|
+
expect(isSystemOwnedSession({
|
|
239
|
+
metadata: { openchamber: { llm: { purpose: 'chat-completions' } } },
|
|
240
|
+
})).toBe(true);
|
|
238
241
|
expect(isSystemOwnedSession({
|
|
239
242
|
title: '[Assistant] Looks system',
|
|
240
243
|
metadata: { openchamber: { assistant: { name: 'no-id' } } },
|
|
@@ -242,6 +245,9 @@ describe('session-title helpers', () => {
|
|
|
242
245
|
expect(isSystemOwnedSession({
|
|
243
246
|
metadata: { openchamber: { smallModel: { purpose: '' } } },
|
|
244
247
|
})).toBe(false);
|
|
248
|
+
expect(isSystemOwnedSession({
|
|
249
|
+
metadata: { openchamber: { llm: { purpose: '' } } },
|
|
250
|
+
})).toBe(false);
|
|
245
251
|
expect(isSystemOwnedSession({ title: 'Ordinary' })).toBe(false);
|
|
246
252
|
expect(isSystemOwnedSession({
|
|
247
253
|
metadata: { openchamber: { assigned: { from: 'contact', assistantID: 'assistant_1' } } },
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n}from"./vendor-base-ui-CnHfUmDN.js";import{n as r}from"./vendor-react-DLPElpoQ.js";import{a as i,i as a,n as o,o as s,r as c,t as l}from"./vendor-markstream-react-DX55XLGO.js";import{n as u,r as d,u as f}from"./vendor-reactuses-core-DDoDDyM9.js";import{Oi as p}from"./useMobileNavigationStore-BUYEOEE2.js";import{t as m}from"./utils-BiK3tBGM.js";import{t as h}from"./useThemeSystem-DMzWVJaW.js";import{n as g}from"./useRuntimeAPIs-DSLXJybW.js";import{a as _,r as v}from"./url-Pk6tQ1EZ.js";import{n as y}from"./useEffectiveDirectory-CUKxer0Q.js";import{r as b,t as x}from"./markdownHeightCache-CYDlisxr.js";import{a as S,c as C,d as w,f as T,i as E,l as D,o as O,p as k,r as A,s as j,t as M}from"./MarkdownRendererImpl-DN4uUYze.js";var N=e(n(),1),P=`img:not([data-md-link-favicon="true"])`,F=e=>e.getAttribute(`data-md-image-source`)??e.getAttribute(`src`)??``,I=(e,t)=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;let n=e.target;if(!(n instanceof Element))return;let r=n.closest(P);if(r instanceof HTMLImageElement&&t.onShowPopup){let n=e.currentTarget;if(!(n instanceof HTMLElement))return;let i=Array.from(n.querySelectorAll(P)).map(e=>({url:F(e),filename:e.alt||F(e)||void 0})).filter(e=>e.url),a=F(r),o=i.findIndex(e=>e.url===a);if(!a)return;e.preventDefault(),e.stopPropagation(),t.onShowPopup({open:!0,title:r.alt||a,content:``,image:{url:a,filename:r.alt||a,gallery:i,index:o>=0?o:0}});return}if(t.fileReference){let r=n.closest(w);if(r instanceof HTMLElement){e.preventDefault(),e.stopPropagation(),O(r,t.fileReference);return}}let i=n.closest(`a[href]`);if(!(i instanceof HTMLAnchorElement))return;let a=i.getAttribute(`href`)??``;v(a)&&(e.preventDefault(),e.stopPropagation(),_(a))},ee=(e,t)=>{if(e.key!==`Enter`&&e.key!==` `||!t.fileReference)return;let n=e.target;if(!(n instanceof Element))return;let r=n.closest(w);!(r instanceof HTMLElement)||r.getAttribute(`data-openchamber-file-link`)!==`true`||(e.preventDefault(),e.stopPropagation(),O(r,t.fileReference))},L=r(),R=(e,t)=>{let n=t>=2?e.slice(t-2,t):``;return(t>=1?e.charAt(t-1):``)===`:`||n===`:/`},z=e=>{if(!e.includes(`/`)||!e.includes(`.`))return[{kind:`text`,value:e}];k.lastIndex=0;let t=[],n=0,r=k.exec(e);for(;r;){let i=r[0];if(!i||R(e,r.index)||!T(i)){r=k.exec(e);continue}r.index>n&&t.push({kind:`text`,value:e.slice(n,r.index)}),t.push({kind:`path`,value:i}),n=r.index+i.length,r=k.exec(e)}return n===0?[{kind:`text`,value:e}]:(n<e.length&&t.push({kind:`text`,value:e.slice(n)}),t)},B=t(),V=N.createContext({enabled:!1,insideLink:!1,isMobileSurface:!1,effectiveDirectory:``,preferRuntimeEditor:!1,slots:{used:0,limit:0}}),H=e=>{let t=(0,L.c)(11),{enabled:n,effectiveDirectory:r,editor:i,preferRuntimeEditor:a,onShowPopup:o,content:s,children:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=p(),t[0]=l):l=t[0];let u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={used:0,limit:E()},t[1]=u):u=t[1];let d;t[2]!==i||t[3]!==r||t[4]!==n||t[5]!==o||t[6]!==a?(d={enabled:n,insideLink:!1,isMobileSurface:l,effectiveDirectory:r,editor:i,preferRuntimeEditor:a,onShowPopup:o,slots:u},t[2]=i,t[3]=r,t[4]=n,t[5]=o,t[6]=a,t[7]=d):d=t[7];let f=d,m;return t[8]!==c||t[9]!==f?(m=(0,B.jsx)(V.Provider,{value:f,children:c}),t[8]=c,t[9]=f,t[10]=m):m=t[10],m},U=({raw:e,children:t})=>{let n=N.useContext(V),r=S(e,n.effectiveDirectory),i=N.useRef(!1);n.enabled&&r&&!i.current&&n.slots.used<n.slots.limit&&(n.slots.used+=1,i.current=!0);let[a,o]=N.useState(r?j(r.resolvedPath)??null:null),s=r?.resolvedPath;if(N.useEffect(()=>{if(!n.enabled||!s||!i.current)return;let e=!1;return C(s,n.effectiveDirectory).then(t=>{e||o(t)}),()=>{e=!0}},[n.enabled,n.effectiveDirectory,s]),!r)return t??e;let c=!!(i.current&&a&&D(r.resolvedPath,a,n.isMobileSurface));return(0,B.jsx)(`span`,{"data-openchamber-block-path-token":`true`,...c?{"data-openchamber-file-link":`true`,"data-openchamber-file-ref":e,"data-openchamber-file-path":r.resolvedPath,"data-openchamber-file-binary":String(a?.isBinary===!0),title:A,...t?{}:{role:`button`,tabIndex:0}}:{},children:t??e})};function W(e){let t=(0,L.c)(12),n=N.useContext(V),r=e.node.content??``;if(!n.enabled||n.insideLink){let n;return t[0]===e?n=t[1]:(n=(0,B.jsx)(c,{...e}),t[0]=e,t[1]=n),n}let i,a;if(t[2]!==r||t[3]!==e){a=Symbol.for(`react.early_return_sentinel`);bb0:{let n=z(r);if(n.length===1&&n[0]?.kind!==`path`){let n;t[6]===e?n=t[7]:(n=(0,B.jsx)(c,{...e}),t[6]=e,t[7]=n),a=n;break bb0}let o;t[8]===e?o=t[9]:(o=(t,n)=>t.kind===`path`?(0,B.jsx)(U,{raw:t.value},`path-${n}-${t.value}`):(0,B.jsx)(c,{...e,node:{...e.node,content:t.value}},`text-${n}`),t[8]=e,t[9]=o),i=n.map(o)}t[2]=r,t[3]=e,t[4]=i,t[5]=a}else i=t[4],a=t[5];if(a!==Symbol.for(`react.early_return_sentinel`))return a;let o;return t[10]===i?o=t[11]:(o=(0,B.jsx)(B.Fragment,{children:i}),t[10]=i,t[11]=o),o}function G(e){let t=(0,L.c)(7),n=N.useContext(V),r=e.node.code??``;if(!n.enabled||!T(r)){let n;return t[0]===e?n=t[1]:(n=(0,B.jsx)(a,{...e}),t[0]=e,t[1]=n),n}let i;t[2]===r?i=t[3]:(i=(0,B.jsx)(U,{raw:r}),t[2]=r,t[3]=i);let o;return t[4]!==e||t[5]!==i?(o=(0,B.jsx)(a,{...e,children:i}),t[4]=e,t[5]=i,t[6]=o):o=t[6],o}function K(e){let t=(0,L.c)(12),n=N.useContext(V),r=e.node.href??``,i;t[0]!==n.enabled||t[1]!==r?(i=n.enabled&&T(r),t[0]=n.enabled,t[1]=r,t[2]=i):i=t[2];let a=i,s;t[3]===n?s=t[4]:(s={...n,insideLink:!0},t[3]=n,t[4]=s);let c;t[5]!==a||t[6]!==r||t[7]!==e?(c=a?(0,B.jsx)(U,{raw:r,children:(0,B.jsx)(o,{...e})}):(0,B.jsx)(o,{...e}),t[5]=a,t[6]=r,t[7]=e,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l=(0,B.jsx)(V.Provider,{value:s,children:c}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}var q=/^[ \t]{0,3}(`{3,}|~{3,})/,J=e=>{if(typeof e!=`string`||e.length===0)return!1;let t=e.split(/\r?\n/,1)[0]??``;return q.test(t)},Y=e=>{let t=0,n=0,r=e.match(/[`~]+/g)??[];for(let e of r)e[0]==="`"?t=Math.max(t,e.length):n=Math.max(n,e.length);return t>=3?"`".repeat(Math.max(3,t+1)):n>=3&&t===0?"```":n>=3?`~`.repeat(Math.max(3,n+1)):"```"},X=e=>{let t=typeof e.raw==`string`?e.raw:``;if(J(t))return t.endsWith(`
|
|
2
|
-
`)?t:`${t}\n`;let n=(e.language??``).trim(),r=e.code??``,i=Y(r);return`${i}${n}\n${r.endsWith(`
|
|
3
|
-
`)?r:`${r}\n`}${i}\n`},Z=e=>{let t=e.partId?`part-${e.partId}`:`body`,n=e.indexKey!==void 0&&e.indexKey!==null&&String(e.indexKey).length>0?String(e.indexKey):e.language&&e.language.length>0?e.language:`code`;return`${e.messageId}:${t}:code:${n}`},Q=N.createContext({messageId:`markstream`,isStreaming:!1,disableStreamAnimation:!1,variant:`assistant`,enableFileReferences:!0}),te=()=>N.useContext(Q);function ne(e){let t=(0,L.c)(20),n=te(),r=e.node.language??``,i=e.node.code??``,a=e.node.raw??``,o;t[0]!==i||t[1]!==r||t[2]!==a?(o=X({type:`code_block`,language:r,code:i,raw:a}),t[0]=i,t[1]=r,t[2]=a,t[3]=o):o=t[3];let s=o,c=n.isStreaming||e.loading===!0||e.node.loading===!0,l=n.part?.id,u;t[4]!==n.messageId||t[5]!==e.indexKey||t[6]!==e.node.language||t[7]!==l?(u=Z({messageId:n.messageId,partId:l,indexKey:e.indexKey,language:e.node.language}),t[4]=n.messageId,t[5]=e.indexKey,t[6]=e.node.language,t[7]=l,t[8]=u):u=t[8];let d=u,f=n.enableFileReferences&&!c,p;t[9]!==s||t[10]!==n.disableStreamAnimation||t[11]!==n.onShowPopup||t[12]!==n.variant||t[13]!==d||t[14]!==c||t[15]!==f?(p=(0,B.jsx)(M,{content:s,messageId:d,isAnimated:!1,skipFadeIn:!0,isStreaming:c,disableStreamAnimation:n.disableStreamAnimation,variant:n.variant,onShowPopup:n.onShowPopup,enableFileReferences:f}),t[9]=s,t[10]=n.disableStreamAnimation,t[11]=n.onShowPopup,t[12]=n.variant,t[13]=d,t[14]=c,t[15]=f,t[16]=p):p=t[16];let m;return t[17]!==d||t[18]!==p?(m=(0,B.jsx)(`div`,{className:`oc-markstream-code-host min-w-0 w-full`,"data-oc-markstream-code":`markdown-impl`,"data-oc-markstream-code-id":d,children:p}),t[17]=d,t[18]=p,t[19]=m):m=t[19],m}var $=!1,re=()=>{$||($=!0,i({text:W,inline_code:G,link:K,code_block:s(ne,`block`)}))},ie={maxLiveNodes:0,liveNodeBuffer:0,batchRendering:!1,deferNodesUntilVisible:!1,viewportPriority:!1,smoothStreaming:!1,typewriter:!1,fade:!1};re();var ae=e=>e===`tool`?`markdown-content markdown-tool oc-markstream-host`:e===`reasoning`?`markdown-content markdown-reasoning oc-markstream-host`:`markdown-content leading-relaxed oc-markstream-host`,oe=N.memo(({content:e,part:t,messageId:n,className:r,isStreaming:i=!1,disableStreamAnimation:a=!1,variant:o=`assistant`,onShowPopup:s,enableFileReferences:c=!0})=>{let p=h()?.currentTheme.metadata.variant===`dark`,{editor:_,runtime:v}=g(),S=y()??``,C=N.useRef(null),w=t?.id?`oc-ms-${t.id}`:`oc-ms-${n}`,T=x(e,`markstream:${o}`),E=!i,D=c&&!i,O=D?{effectiveDirectory:S,editor:_,preferRuntimeEditor:v.isVSCode,onShowPopup:s}:void 0,k=N.useMemo(()=>({messageId:n,part:t,isStreaming:i,disableStreamAnimation:a,variant:o,onShowPopup:s,enableFileReferences:c}),[n,t,i,a,o,s,c]),A=N.useRef(E);A.current=E;let j=N.useRef(T);j.current=T;let M=u(e=>{if(!A.current)return;let t=e[0];if(!t)return;let n=t.borderBoxSize?.[0],r=n?n.blockSize:t.contentRect.height,i=n?n.inlineSize:t.contentRect.width;b(j.current,r,i)});f(C,M);let P=u(e=>{I(e,{onShowPopup:s,fileReference:O})}),F=u(e=>{ee(e,{fileReference:O})});return d(`click`,P,C),d(`keydown`,F,C),(0,B.jsx)(`div`,{ref:C,className:m(`relative break-words w-full min-w-0`,ae(o),r),"data-markdown-ready":`true`,"data-markdown-hydration":`ready`,"data-oc-markdown-engine":`markstream`,"data-oc-markstream-virtual":`off`,children:(0,B.jsx)(Q.Provider,{value:k,children:(0,B.jsx)(H,{enabled:D,effectiveDirectory:S,editor:_,preferRuntimeEditor:v.isVSCode,onShowPopup:s,content:e,children:(0,B.jsx)(l,{content:e,customId:w,final:!i,isDark:p,codeBlockStream:i,...ie})})})})},(e,t)=>e.content===t.content&&e.isStreaming===t.isStreaming&&e.disableStreamAnimation===t.disableStreamAnimation&&e.variant===t.variant&&e.isAnimated===t.isAnimated&&e.skipFadeIn===t.skipFadeIn&&e.className===t.className&&e.messageId===t.messageId&&e.onShowPopup===t.onShowPopup&&e.enableFileReferences===t.enableFileReferences&&e.part?.id===t.part?.id);export{oe as MarkstreamRenderer};
|