mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 05:50:44 +08:00
Fix prewarm prompt preview staleness (cache + Admin wait)
Include skill_role_binding store JSON in executor and manager prompt cache signatures so skill catalog updates after binding edits without restart. Admin async prewarm now polls prewarm/status until not running before router() so parallel prompts fetch matches completed warm. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
4dbb834c95
commit
c33ca303a2
4 changed files with 84 additions and 2 deletions
|
|
@ -1643,10 +1643,27 @@ async function renderStack() {
|
|||
class: "btn btn--primary",
|
||||
text: currentLang === "zh" ? "立即预热" : "Run prewarm now",
|
||||
onclick: async () => {
|
||||
prewarmStatus.textContent = currentLang === "zh" ? "[预热] 提交中…" : "[prewarm] submitting…";
|
||||
const resp = await apiPost("/admin/api/runtime/prewarm", { mode: "async", reason: "admin_manual" });
|
||||
prewarmStatus.textContent = `[prewarm] accepted=${Boolean(resp && resp.accepted)}`;
|
||||
if (!(resp && resp.accepted)) {
|
||||
prewarmStatus.textContent = `[prewarm] accepted=${Boolean(resp && resp.accepted)}`;
|
||||
return;
|
||||
}
|
||||
prewarmStatus.textContent =
|
||||
currentLang === "zh"
|
||||
? "[预热] 后台执行中,完成后自动刷新本页数据(含提示词)…"
|
||||
: "[prewarm] running in background; refreshing this page when finished…";
|
||||
runtimePrewarmReminder = "";
|
||||
router();
|
||||
const maxWaitMs = 120000;
|
||||
const stepMs = 400;
|
||||
let waited = 0;
|
||||
while (waited < maxWaitMs) {
|
||||
await new Promise((r) => setTimeout(r, stepMs));
|
||||
waited += stepMs;
|
||||
const st = await apiGet("/admin/api/runtime/prewarm/status");
|
||||
if (!(st && st.running)) break;
|
||||
}
|
||||
await router();
|
||||
},
|
||||
});
|
||||
const prewarmSummary = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue