[Bug] 日志窗口仍会访问 Monaco CDN,加载失败时日志编辑器无法就绪
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 66/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- electron, javascript, node.js, typescript
Research direction
Start with frontend/src/main.ts and frontend/src/utils/monaco.ts to understand when local Monaco configuration becomes available. Compare that initialization with the direct VueMonacoEditor use in frontend/src/views/Logs.vue and frontend/src/views/history/components/HistoryLogModal.vue; frontend/src/views/scheduler/SchedulerLogPanel.vue and pull/1845 provide a reference. Done means these log views use the local Monaco setup before editor initialization so opening them does not request Monaco from the CDN.
Written by the indexing model from the issue text.
Description
本轮仅按 MAS 最新正式版 v5.8.0 与最新 beta v5.8.0-beta.4 查询 Sentry;下列现场证据均来自该范围中的 v5.8.0。
提交所用的 AI 工具或模型
ChatGPT(GPT-6 Astra Pro)。本报告按用户授权读取 Sentry,并核对仓库源码及已有 Issue/PR 后整理。
问题描述
打开日志窗口时,日志编辑器可能转去加载外部 CDN 的 Monaco 资源,资源加载失败后无法就绪。应用已打包本地 Monaco,因此正常查看本地日志不应依赖该 CDN 是否可达。
证据与环境
| Sentry 分组 | 组内累计事件数 | 本次读取样本版本 | 样本时间(UTC) |
|---|---|---|---|
| AUTO-MAS-DESKTOP-1K | 7 | [email protected] | 2026-11-10T13:18:58.613000Z |
累计数是整个分组的历史累计,不代表本版本的发生次数;每组完整上下文以本次读取的最新事件为主。
DESKTOP-1K 在 v5.8.0 的 Logs 页面报 [object Event],来源是 cdn.jsdelivr.net 的 [email protected] loader 加载失败处理。仓库 package.json 使用本地 Monaco 0.54.0。
main.ts 只在 requestIdleCallback(或延迟定时器)中预热 configureLocalMonaco;该函数完成动态导入后才配置 loader。本次核对的 Logs.vue 和 HistoryLogModal.vue 直接使用 VueMonacoEditor,没有等待这个配置。dev 的 #1845 已让 SchedulerLogPanel 等待本地配置,并明确注明刷新后日志恢复可能早于空闲预热;但 Logs/历史日志入口仍保持直接挂载。
可核对的源码:
- frontend/src/main.ts
- frontend/src/utils/monaco.ts
- frontend/src/views/Logs.vue
- frontend/src/views/history/components/HistoryLogModal.vue
- frontend/src/views/scheduler/SchedulerLogPanel.vue
- frontend/package.json
关联记录:pull/1845。
验证与复现边界
在当前 dev 提交上实际执行了最小验证,使用与锁文件一致的 Vue 3.5.32、@guolao/vue-monaco-editor 1.6.0 和 @monaco-editor/loader 1.7.0:
- 执行 main.ts 中实际的空闲预热安排,并在空闲回调触发前挂载真实 VueMonacoEditor 组件。
- 真实 loader 立即插入了
https://cdn.jsdelivr.net/npm/[email protected]/min/vs/loader.js。 - 随后执行真实 configureLocalMonaco 并让本地模块导入完成;此时本地配置已经写入,但之前的 CDN 加载仍在等待。
- 向该 CDN script 的浏览器错误边界注入加载失败,真实组件显示
load failed,同时观察到 Promise 拒绝。 - 对照流程先完成同一个 configureLocalMonaco,再调用 loader.init:外部 script 数为 0,Promise 正常得到本地模块。
因此可以确认初始化顺序会使编辑器选择远端资源,迟到的本地配置不能救回已经开始的 CDN 初始化。验证运行于 Linux Node 24.22.1,Vue 的宿主 DOM 和本地模块导入完成时机受控,编辑器/loader 逻辑及生产配置函数实际执行;没有宣称完成 Electron 窗口或整页实机复现。此次未修改生产实现。
确认
- 这是 AI 生成的内容,已核对上面引用的事件与代码位置;事实和待确认推测已分别说明。
- 理解 AI 报告分区不承诺处理时间,也不保证有人认领。
日志 / 堆栈补充
以下内容由 Sentry 结构化异常字段脱敏渲染,不是完整 app.log / frontend.log。帧来自该事件实际记录,按抛出点到调用者排列;仅截取与本问题直接相关的 5 层,没有补造缺失调用。
- 分组:AUTO-MAS-DESKTOP-1K
- 事件:
204dcf264e9d49f88a471b40ea3d14b5 - 时间:2026-11-10T13:18:58.613000Z(UTC)
- 记录版本:
[email protected];运行环境:Electron 43.8.2。
Error: [object Event]
at Object.y [as ensureError] (/npm/[email protected]/min/vs/loader.js:172:13)
at c._createLoadError (/npm/[email protected]/min/vs/loader.js:1056:16)
at c._onLoadError (/npm/[email protected]/min/vs/loader.js:1060:19)
at l (/npm/[email protected]/min/vs/loader.js:1139:37)
at Object.errorback (/npm/[email protected]/min/vs/loader.js:1159:27)
省略用户/机器上下文、原始日志、绝对安装路径及请求参数。此节只补充真实事件的调用位置,复现范围与结论仍以正文“验证与复现边界”为准。
- Dominant language
- Python
- Stars
- 707
- Forks
- 56
- Avg merge
- 11h 45m
- Merged PRs (30d)
- 429
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AUTO-MAS-Project/AUTO-MAS
-
AI bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AUTO-MAS-Project/AUTO-MAS#1960 · 1 comment ·
Maintainers usually reply within 1 day
-
AI bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
AUTO-MAS-Project/AUTO-MAS#1959 · 1 comment ·
Maintainers usually reply within 1 day
-
AI bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
AUTO-MAS-Project/AUTO-MAS#1953 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
AUTO-MAS-Project/AUTO-MAS#1947 ·
Maintainers usually reply within 1 day
-
米哈游游戏无法登录Openbug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
AUTO-MAS-Project/AUTO-MAS#1936 · 2 comments ·
Maintainers usually reply within 1 day
All issues in AUTO-MAS-Project/AUTO-MAS
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib-wallet#872 ·
Maintainers usually reply within 1 day
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme loadPossibly taken A pull request linked to this issue is open or already merged. Openbug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
saltstack/salt#70789 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
btclib-org/btclib#3093 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
patrickballard/wheelgap#269 ·