fix(agent): recover stale runs and improve new-user OA delivery

Fix DEV logout cookie clearing, materialize selected MindSpace OA assets before agent runs, and recover zombie runs from synced workspace pages. Add client run wait timeout, harness retry limits, page-edit asset forwarding, and logout/john2 scenario tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-10 20:05:52 +08:00
parent aede1e6fcb
commit 7f8d692d16
34 changed files with 1318 additions and 125 deletions
+18 -3
View File
@@ -14,6 +14,7 @@ import {
listScenarios,
loadScenario,
loginViaApi,
logoutViaApi,
resolvePortalBase,
snapshotPublicHtml,
verifyPageAccess,
@@ -95,9 +96,22 @@ async function runScenario(scenario, port) {
const label = step.label ?? step.action;
console.log(`\n--- ${label} ---`);
if (step.action === 'login') {
auth = await loginViaApi(baseUrl, account, reporter);
publishKey = auth.user?.id ?? auth.user?.publishSlug ?? account.username;
if (step.action === 'login' || (step.action === 'chat' && !auth && step.login !== false)) {
if (!auth) {
auth = await loginViaApi(baseUrl, account, reporter);
publishKey = auth.user?.id ?? auth.user?.publishSlug ?? account.username;
}
if (step.action === 'login') {
continue;
}
}
if (step.action === 'logout') {
if (!auth) {
throw new Error('logout 步骤前必须先 login');
}
await logoutViaApi(baseUrl, auth.cookie, reporter);
auth = null;
continue;
}
@@ -114,6 +128,7 @@ async function runScenario(scenario, port) {
message: step.message,
sessionId,
selectedChatSkill: step.selectedChatSkill ?? null,
selectedAssetIds: step.selectedAssetIds ?? null,
});
reporter.pass('提交消息', `"${step.message}" → run ${run.runId}`);