- 归档 OnlyOffice live bridge、Page AI、mindmap、design governance 与相关 bug 条目 - 补齐 MinerU OCR 后端 runtime 合同与 smoke/test 基线 - 收口 ChatOnly/Doubao、ObjectIdentity、Page Aggregate compat 与 runtime owner 文档口径 验证: - cargo test --manifest-path rust/Cargo.toml -p mnote-web local_ocr -- --test-threads=1 - cargo test --manifest-path rust/Cargo.toml -p mnote-web onlyoffice_bridge -- --test-threads=1 - git diff --check - git diff --cached --check - codegraph index . --force && codegraph status . - codegraph sync . && codegraph status .
34 lines
1.7 KiB
Markdown
34 lines
1.7 KiB
Markdown
# 7-54 Page AI Office target 误查 Markdown buffer-state
|
||
|
||
## 状态
|
||
|
||
- 状态:done
|
||
- Owner:07-ai / Page AI target runtime / OnlyOffice resource target
|
||
- 发现时间:2026-06-01
|
||
- 修复时间:2026-06-01
|
||
|
||
## 现象
|
||
|
||
真实 Page AI UI 选择 Office resource target 后,发送 run 前的 buffer guard 会按 Office 文件相对路径请求 `/api/documents/buffer-state`:
|
||
|
||
```text
|
||
/api/documents/buffer-state?...&relativePath=Page/office-a.docx
|
||
```
|
||
|
||
该端点只服务 local Markdown 文档 buffer,Office target 会返回 404。虽然当前 404 没有阻断 run,但会污染 console / HTTP error 证据,并说明 Page AI 把 Office resource 当成 Markdown buffer 检查。
|
||
|
||
## 根因
|
||
|
||
`rust/crates/mnote-web/browser/sidebar-page-ai-runtime.js` 的 `fetchPageAiTargetBufferState()` 只判断 `sourceKind=local_folder`,没有区分 target `resourceKind`。Office target 已由 OnlyOffice bridge session、resource scope 和 tool 层权限保护,不应走 Markdown `BufferStore` 查询。
|
||
|
||
## 修复
|
||
|
||
- `fetchPageAiTargetBufferState()` 对 `office` / `only_office` / `onlyoffice` target 直接返回 `null`。
|
||
- `scripts/task523-page-ai-onlyoffice-real-target-session-smoke.js` 增加断言:真实 Page AI Office target run 过程中不得出现 `/api/documents/buffer-state` 404,并要求 `consoleErrors` / `networkFailures` / `httpErrors` 为空。
|
||
|
||
## 验收
|
||
|
||
- `node --check rust/crates/mnote-web/browser/sidebar-page-ai-runtime.js`
|
||
- `node --check scripts/task523-page-ai-onlyoffice-real-target-session-smoke.js`
|
||
- `MNOTE_UI_BASE_URL=http://127.0.0.1:3301 MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3301 node scripts/task523-page-ai-onlyoffice-real-target-session-smoke.js`
|