merge: integrate remote learning module safely
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
2026-08-17 01:05:49 +08:00
125 changed files with 11451 additions and 12132 deletions

View File

@@ -484,13 +484,27 @@ async function configureSlashCompactionHost(
role: 'assistant',
time: { created: 1_753_190_401_000 },
},
parts: [{
id: 'part_slash_e2e_assistant',
sessionID: 'ses_slash_e2e',
messageID: 'msg_slash_e2e_assistant',
type: 'text',
text: '已有的助手回复',
}],
parts: [
{
id: 'part_slash_e2e_assistant',
sessionID: 'ses_slash_e2e',
messageID: 'msg_slash_e2e_assistant',
type: 'text',
text: '已有的助手回复,我先确认上下文,再继续处理。',
},
{
id: 'part_slash_e2e_tool',
sessionID: 'ses_slash_e2e',
messageID: 'msg_slash_e2e_assistant',
type: 'tool',
tool: 'read_file',
callID: 'call_slash_e2e_read',
state: {
status: 'completed',
input: { filePath: 'README.md' },
},
},
],
},
];
});
@@ -558,6 +572,15 @@ async function installSlashRendererEventSource(
});
}
async function openProgrammingModule(
page: import('@playwright/test').Page,
): Promise<void> {
await page.getByTestId('sidebar-module-switcher-trigger').click();
await expect(page.getByTestId('ai-module-selection-page')).toBeVisible();
await page.getByTestId('ai-module-option-programming').click();
await expect(page).toHaveURL(/\/opencode-chat$/);
}
test.describe('OpenCode slash commands', () => {
test.afterEach(async ({ electronApp }) => {
await electronApp.evaluate(async () => {
@@ -580,7 +603,7 @@ test.describe('OpenCode slash commands', () => {
await completeSetup(page);
await installSlashCommandHost(electronApp);
await page.reload();
await expect(page).toHaveURL(/\/opencode-chat$/);
await openProgrammingModule(page);
await page.getByTestId('project-agent-chat-game-development').click();
const composer = page.getByRole('textbox');
await expect(composer).toBeVisible();
@@ -660,9 +683,7 @@ test.describe('OpenCode slash commands', () => {
seedTranscript: true,
});
await page.reload();
await page.getByTestId('sidebar-module-switcher-trigger').click();
await page.getByTestId('sidebar-module-programming').click();
await expect(page).toHaveURL(/\/opencode-chat$/);
await openProgrammingModule(page);
await page.getByTestId('project-agent-chat-game-development').click();
const transcript = page.getByTestId('opencode-transcript-scroll');
@@ -670,6 +691,11 @@ test.describe('OpenCode slash commands', () => {
'[data-chat-message-id="msg_slash_e2e_assistant"]',
);
await expect(existingAssistant).toBeVisible();
await expect(existingAssistant.getByTestId('chat-message-bubble-assistant'))
.toContainText('已有的助手回复,我先确认上下文,再继续处理。');
await expect(existingAssistant.getByTestId('chat-message-avatar-assistant')).toBeVisible();
await expect(transcript.getByTestId('chat-execution-graph')).toBeVisible();
await expect(transcript.getByTestId('chat-execution-step')).toHaveCount(1);
const composer = page.getByRole('textbox');
await expect(composer).toBeVisible();
await composer.fill('/compact');
@@ -766,7 +792,7 @@ test.describe('OpenCode slash commands', () => {
await installSlashCommandHost(electronApp);
await page.reload();
await page.setViewportSize({ width: 1280, height: 800 });
await expect(page).toHaveURL(/\/opencode-chat$/);
await openProgrammingModule(page);
await expect(page.getByTestId('opencode-message-composer')).toBeVisible();
const createPartnerButton = page.getByRole('button', { name: '创建伙伴' });