Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0c7f5a4
feat(desktop): reference bounded Session snapshots from Composer
Sep 1, 2026
5091256
fix(ui): simplify session reference picker
Sep 1, 2026
f57561a
fix(core): preserve snapshot content when truncating
Sep 1, 2026
32bc286
fix(core): avoid partial snapshot role prefixes
Sep 1, 2026
79b303d
docs: document trigger menu patch seam
Sep 1, 2026
64f673b
fix(ui): polish Session reference presentation
Sep 1, 2026
5f39759
fix(ui): keep single Session references compact
Sep 1, 2026
de4752a
fix(deps): regenerate Astryx core patch after merge
Sep 1, 2026
5492aed
fix(desktop): resolve feature service merge conflict
Sep 2, 2026
70b824f
fix(ci): refresh Astryx surface inventory
Sep 2, 2026
4a926b9
fix(desktop): narrow conversation feature exports
Sep 2, 2026
3cbb508
fix(desktop): keep session reference within architecture budget
Sep 2, 2026
672ccf5
fix(desktop): preserve session picker identity on refresh
Sep 2, 2026
81fd3ed
fix(desktop): address session reference review feedback
Sep 3, 2026
0e5707b
fix(core): redact secrets from session references
Sep 3, 2026
bb039a0
fix(desktop): wire conversation feature services
Sep 4, 2026
a6cd1c9
ci: retry unrelated code scroll check
Sep 4, 2026
25992c5
fix(ui): complete session reference copy
Sep 5, 2026
cde2783
fix(desktop): regenerate renderer architecture ledger
Sep 5, 2026
7dba05b
fix(desktop): restore composer mentions provider adapter
Sep 5, 2026
10bf7c0
fix(desktop): forward session mention picker props
Sep 5, 2026
f7b1c0b
test(desktop): provide conversation services in slash menu story
Sep 5, 2026
5fcc6a3
ci: retry unrelated quote-selection flaky test
Sep 5, 2026
4046f1e
ci: retry unrelated transcript scroll e2e
Sep 5, 2026
d14e370
chore: refresh Astryx surface inventory
Sep 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions apps/desktop/e2e/composer-session-reference.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { ensureSidebarExpanded, expect, test, COMPOSER_INPUT } from './fixtures';

test('references another Session from @, including a trailing-space browse', async ({
window: page,
}, testInfo) => {
const composer = page.locator(COMPOSER_INPUT);
const sourceName = 'Reference source';
const sourcePrompt = 'source transcript marker';

await composer.fill(sourcePrompt);
await composer.press('Enter');
await expect(page.getByText(`Fake backend received: ${sourcePrompt}`)).toBeVisible();
await expect(page.getByRole('button', { name: '重新生成' })).toHaveCount(1, {
timeout: 20_000,
});

await page.evaluate(async (name) => {
const source = (await window.maka.sessions.list())[0];
if (!source) throw new Error('the source Session was not created');
await window.maka.sessions.rename(source.id, name);
}, sourceName);

await ensureSidebarExpanded(page);
const sidebar = page.getByRole('navigation', { name: '任务列表' });
await sidebar.getByRole('button', { name: '新任务', exact: true }).click();
await expect(composer).toHaveText('');

await composer.click();
await composer.pressSequentially('@');
const menu = page.getByRole('listbox', { name: '工作区文件和会话' });
await expect(menu).toBeVisible();

const sourceOption = menu.getByRole('option', { name: sourceName, exact: true });
await expect(sourceOption).toBeVisible();
await expect(sourceOption.locator('svg.lucide-messages-square')).toHaveCount(1);

await composer.press('Space');
await expect(menu).toBeVisible();
await expect(sourceOption).toBeVisible();

await composer.fill('@reference');
await expect(sourceOption).toBeVisible();
await sourceOption.click();
await expect(menu).not.toBeVisible();

const chip = page.locator('.maka-composer-session-token');
await expect(chip).toContainText(sourceName);
await expect(chip.locator('svg.lucide-messages-square')).toHaveCount(1);
await page.screenshot({ path: testInfo.outputPath('session-reference-staged.png') });

const followUp = 'continue from the referenced session';
await composer.fill(followUp);
await composer.press('Enter');
const sent = page.getByLabel('你发送的消息').last();
await expect(sent).toContainText(followUp);
await expect(sent).toContainText(sourceName);
await expect(chip).toHaveCount(0);
await expect(page.getByRole('button', { name: '重新生成' })).toHaveCount(1, {
timeout: 20_000,
});
});
32 changes: 9 additions & 23 deletions apps/desktop/renderer-architecture.json
Original file line number Diff line number Diff line change
Expand Up @@ -896,24 +896,21 @@
"react": 1
},
"importSpecifiers": 147,
"nonTriviaTokens": 15588
"nonTriviaTokens": 15587
},
"src/renderer/use-app-shell-composer-quotes.ts": {
"importDeclarations": 2,
"importDeclarations": 1,
"bridgePaths": {},
"environmentCapabilities": {},
"hookCalls": {
"useState": 1
},
"hookCalls": {},
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./pending-items.js": 1,
"react": 1
"./features/conversation/index.js": 1
},
"importSpecifiers": 5,
"nonTriviaTokens": 360
"importSpecifiers": 1,
"nonTriviaTokens": 24
},
"src/renderer/use-app-shell-session-list.ts": {
"importDeclarations": 10,
Expand Down Expand Up @@ -1261,25 +1258,14 @@
}
},
"src/renderer/composer-mentions.tsx": {
"bridgePaths": {
"window.maka.mcp.subscribeChanges": 1,
"window.maka.newTasks.listInvocableSkills": 1,
"window.maka.newTasks.searchFiles": 1,
"window.maka.newTasks.subscribeChanges": 1,
"window.maka.sessions.subscribeChanges": 1,
"window.maka.skills.listInvocable": 1,
"window.maka.workspace.searchFiles": 1
},
"bridgePaths": {},
"environmentCapabilities": {},
"hookCalls": {
"useEffect": 1,
"useState": 1
},
"hookCalls": {},
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"react": 1
"./features/conversation/index.js": 1
}
},
"src/renderer/conversation-markdown.ts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import assert from 'node:assert/strict';
import test from 'node:test';
import type { MakaBridge } from '../../preload/bridge-contract.js';
import { createDesktopConversationServices } from '../../renderer/platform/desktop/create-conversation-services.js';

test('Desktop conversation adapter keeps snapshot reads and catalog access on the bridge', async () => {
const calls: string[] = [];
const bridge = {
sessions: {
list: async () => [],
subscribeChanges: () => () => undefined,
readSnapshot: async (sessionId: string) => {
calls.push(`snapshot:${sessionId}`);
return {};
},
},
skills: { listInvocable: async () => [] },
workspace: { searchFiles: async () => ({ ok: false as const, reason: 'no_project' as const }) },
newTasks: {
subscribeChanges: () => () => undefined,
listInvocableSkills: async () => [],
searchFiles: async () => ({ ok: false as const, reason: 'no_project' as const }),
},
mcp: { subscribeChanges: () => () => undefined },
} as unknown as MakaBridge;
const services = createDesktopConversationServices(bridge);

await services.sessions.readSnapshot('source');
assert.deepEqual(await services.sessions.list(), []);
assert.deepEqual(calls, ['snapshot:source']);
});
17 changes: 17 additions & 0 deletions apps/desktop/src/main/__tests__/new-task-staged-content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,23 @@ test('a Session keeps its own staged quotes, and the new-task bucket keeps its o
['quoted for the Session'],
);

await act(() => probe.latest().addQuote({
text: 'bounded session context',
label: 'Session: Research',
sourceSessionId: 'source-session',
sourceSessionName: 'Research',
sourceCapturedAt: 123,
sourceTruncated: true,
}));
assert.deepEqual(probe.latest().pendingQuotes.at(-1), {
text: 'bounded session context',
label: 'Session: Research',
sourceSessionId: 'source-session',
sourceSessionName: 'Research',
sourceCapturedAt: 123,
sourceTruncated: true,
});

await probe.render(NEW_TASK_PENDING_KEY);
assert.deepEqual(
probe.latest().pendingQuotes.map((quote) => quote.text),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,16 @@ describe('permission response IPC boundary', () => {
],
turnOrchestration: { mode: 'swarm', source: 'slash_command', ignored: true },
quotes: [
{ text: 'the excerpt', label: ' Assistant ', sourceTurnId: 'turn-9', extra: true },
{
text: 'the excerpt',
label: ' Assistant ',
sourceTurnId: 'turn-9',
sourceSessionId: 'source-session',
sourceSessionName: 'Research',
sourceCapturedAt: 123,
sourceTruncated: false,
extra: true,
},
],
workspaceFileReferences: [
{
Expand Down Expand Up @@ -223,7 +232,15 @@ describe('permission response IPC boundary', () => {
},
],
turnOrchestration: { mode: 'swarm', source: 'slash_command' },
quotes: [{ text: 'the excerpt', label: 'Assistant', sourceTurnId: 'turn-9' }],
quotes: [{
text: 'the excerpt',
label: 'Assistant',
sourceTurnId: 'turn-9',
sourceSessionId: 'source-session',
sourceSessionName: 'Research',
sourceCapturedAt: 123,
sourceTruncated: false,
}],
workspaceFileReferences: [
{
value: '@packages/ui/src/chat turn.tsx',
Expand Down Expand Up @@ -253,6 +270,7 @@ describe('permission response IPC boundary', () => {
{ type: 'send', text: 'hello', quotes: Array(17).fill({ text: 'x' }) },
{ type: 'send', text: 'hello', quotes: [{ text: '' }] },
{ type: 'send', text: 'hello', quotes: [{ text: 'x', sourceTurnId: 1 }] },
{ type: 'send', text: 'hello', quotes: [{ text: 'x', sourceSessionId: 'source-session' }] },
{ type: 'send', text: 'hello', workspaceFileReferences: {} },
{
type: 'send',
Expand Down
Loading