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:
@@ -1,5 +1,8 @@
|
||||
import { buildMindSpacePageSaveInstructions } from './mindspace-page-patch.mjs';
|
||||
import { buildSelectedAssetDeleteInstructions } from './mindspace-asset-agent.mjs';
|
||||
import {
|
||||
buildSelectedAssetDeleteInstructions,
|
||||
buildSelectedAssetReadInstructions,
|
||||
} from './mindspace-asset-agent.mjs';
|
||||
|
||||
const VIEW_LABELS = {
|
||||
home: '空间首页',
|
||||
@@ -107,7 +110,7 @@ function buildSelectedAssetInstructions(context) {
|
||||
lines.push(
|
||||
`- 用户在界面勾选了 1 份${kind}:「${asset.displayName}」(id: ${asset.id},${asset.mimeType})`,
|
||||
'- 用户说「这个 / 这份 / 这篇 / 这份报告 / 这个数据 / 帮我分析 / 帮我删除」等指代词时,**必须**指这份勾选资料,不得猜测其它文件。',
|
||||
`- 读取/下载:GET /api/mindspace/v1/assets/${asset.id}/download`,
|
||||
'- 读取/分析:优先 `list_dir oa` / `read_file oa/文件名`;若工作区尚无副本,见下方「勾选资料读取」用 Agent 代理下载落盘。',
|
||||
'- 删除:须先与用户确认,确认后由你直接执行删除(见下方「勾选资料删除」);你对该用户空间有完整读写删改权限,**禁止**推给用户自行去界面删除。',
|
||||
);
|
||||
if (context.h5ApiBase) {
|
||||
@@ -363,6 +366,7 @@ export function buildContextPrefix(context) {
|
||||
}
|
||||
|
||||
lines.push(...buildSelectedAssetInstructions(context));
|
||||
lines.push(...buildSelectedAssetReadInstructions(context));
|
||||
lines.push(...buildSelectedAssetDeleteInstructions(context));
|
||||
|
||||
if (context.homeCategories?.length) {
|
||||
|
||||
Reference in New Issue
Block a user