Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f894584
feat(desktop): reference bounded Session snapshots from Composer
Sep 1, 2026
7daaa0e
fix(ui): keep session picker open after spaces
Sep 1, 2026
db8b011
Revert "fix(ui): keep session picker open after spaces"
Sep 1, 2026
7313aee
fix(ui): simplify session reference picker
Sep 1, 2026
6acdfae
fix(core): preserve snapshot content when truncating
Sep 1, 2026
a69d597
fix(core): avoid partial snapshot role prefixes
Sep 1, 2026
ada4863
docs: document trigger menu patch seam
Sep 1, 2026
1e9b2ed
fix(ui): polish Session reference presentation
Sep 1, 2026
b571bbe
Merge latest apache/main into session reference
Sep 1, 2026
fa6a19c
fix(ui): keep single Session references compact
Sep 1, 2026
b6d2b63
fix(deps): regenerate Astryx core patch after merge
Sep 1, 2026
367678f
Merge remote-tracking branch 'apache/main' into codex/issue-4309-sess…
Sep 2, 2026
840c369
fix(desktop): resolve feature service merge conflict
Sep 2, 2026
105818f
fix(ci): refresh Astryx surface inventory
Sep 2, 2026
4c96dbd
fix(desktop): narrow conversation feature exports
Sep 2, 2026
78d1146
Merge remote-tracking branch 'apache/main' into codex/issue-4309-sess…
Sep 2, 2026
e8658ab
Merge remote-tracking branch 'apache/main' into codex/issue-4309-sess…
Sep 2, 2026
af07b87
fix(desktop): keep session reference within architecture budget
Sep 2, 2026
96de6d6
test(cli): avoid activator startup race in timeout test
Sep 2, 2026
5ab3a56
fix(desktop): preserve session picker identity on refresh
Sep 2, 2026
073ca55
Merge remote-tracking branch 'apache/main' into codex/issue-4309-sess…
Sep 2, 2026
b66a10f
chore(ui): refresh Astryx surface inventory
Sep 2, 2026
e5bc8dc
Merge remote-tracking branch 'apache/main' into codex/issue-4309-sess…
Sep 3, 2026
ce7b65a
fix(desktop): address session reference review feedback
Sep 3, 2026
6c8d9ef
Merge remote-tracking branch 'apache/main' into codex/issue-4309-sess…
Sep 3, 2026
e250e53
Merge remote-tracking branch 'apache/main' into codex/issue-4309-sess…
Sep 3, 2026
660b48e
fix(core): redact secrets from session references
Sep 3, 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,
});
});
36 changes: 9 additions & 27 deletions apps/desktop/renderer-architecture.json
Original file line number Diff line number Diff line change
Expand Up @@ -980,25 +980,21 @@
"react": 1
},
"importSpecifiers": 184,
"nonTriviaTokens": 15692
"nonTriviaTokens": 15689
},
"src/renderer/use-app-shell-composer-quotes.ts": {
"importDeclarations": 3,
"importDeclarations": 1,
"bridgePaths": {},
"environmentCapabilities": {},
"hookCalls": {
"useState": 1
},
"hookCalls": {},
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./pending-items.js": 1,
"@maka/core/events": 1,
"react": 1
"./features/conversation/index.js": 1
},
"importSpecifiers": 7,
"nonTriviaTokens": 360
"importSpecifiers": 1,
"nonTriviaTokens": 24
},
"src/renderer/use-app-shell-session-list.ts": {
"importDeclarations": 11,
Expand Down Expand Up @@ -1384,28 +1380,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": {
"../preload/bridge-contract.js": 1,
"@maka/core/settings": 1,
"@maka/runtime/skill-invocation": 1,
"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