dsh-agentone 0.5.19 → 0.5.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +16 -2
- package/lib/page.js +11 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -807,8 +807,22 @@ export function apply(ctx, config) {
|
|
|
807
807
|
// 失败自愈:模型同步残留错误时由轮询驱动后台重试(成功即清,
|
|
808
808
|
// 下次轮询状态页恢复);错误已被登录/手动同步清除时取消待定
|
|
809
809
|
// 重试并复位退避计数。
|
|
810
|
-
if (credentials.model_error)
|
|
811
|
-
|
|
810
|
+
if (credentials.model_error) {
|
|
811
|
+
// 套餐已生效(active)却残留 model_error:多半是审批前同步失败
|
|
812
|
+
// 的旧错误(plan_required),此时重试必然成功——立即同步一次,
|
|
813
|
+
// 不走首轮 60s 的指数退避。常量幂等:同步成功清掉错误后不再进。
|
|
814
|
+
const planActive = capabilities?.plan_state === 'active';
|
|
815
|
+
if (planActive) {
|
|
816
|
+
syncPlatformModel(config, log)
|
|
817
|
+
.then(() => {
|
|
818
|
+
clearModelRetry();
|
|
819
|
+
modelRetryAttempts = 0;
|
|
820
|
+
})
|
|
821
|
+
.catch(() => scheduleModelRetry(config, log));
|
|
822
|
+
} else {
|
|
823
|
+
scheduleModelRetry(config, log);
|
|
824
|
+
}
|
|
825
|
+
} else {
|
|
812
826
|
clearModelRetry();
|
|
813
827
|
modelRetryAttempts = 0;
|
|
814
828
|
}
|
package/lib/page.js
CHANGED
|
@@ -924,11 +924,21 @@ const refresh = async () => {
|
|
|
924
924
|
}
|
|
925
925
|
$('model-body').innerHTML = lines.join('')
|
|
926
926
|
+ (planBlocked
|
|
927
|
-
? '<div class="row" style="margin-top:10px"
|
|
927
|
+
? '<div class="row" style="margin-top:10px">'
|
|
928
|
+
+ '<button id="retry-model-btn" class="btn ghost small" data-loading="同步中…">重新同步模型</button>'
|
|
929
|
+
+ '<button id="goto-plan-btn" class="btn primary small">去申请套餐</button></div>'
|
|
928
930
|
: '');
|
|
929
931
|
$('sync-btn').hidden = !modelEnabled || planBlocked;
|
|
930
932
|
const gotoPlan = $('goto-plan-btn');
|
|
931
933
|
if (gotoPlan) gotoPlan.onclick = () => activateTab('plan');
|
|
934
|
+
// planBlocked 兜底手动出口:旧错误残留时(套餐已批但本地还挂着
|
|
935
|
+
// plan_required)可立即重同步,不等后端自愈的退避周期
|
|
936
|
+
const retryModel = $('retry-model-btn');
|
|
937
|
+
if (retryModel) retryModel.onclick = () => withLoading(
|
|
938
|
+
retryModel,
|
|
939
|
+
() => fetch('api/model/sync', { method: 'POST' }),
|
|
940
|
+
'平台模型已同步',
|
|
941
|
+
);
|
|
932
942
|
}
|
|
933
943
|
if (s.logged_in && s.skillhub) {
|
|
934
944
|
const sh = s.skillhub;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agentone",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.20",
|
|
4
4
|
"description": "AgentOne 平台集成插件:飞书登录、平台模型(同步失败自愈重试)、SkillHub 技能(升级检测一键升级、装后即时刷新、套餐技能自动同步)、套餐申请、插件管理与自助升级、lark-cli / ccpg-cli 探测(请求超时与错误码透传、令牌轮换 single-flight、凭据损坏容错与并发安全写入、状态页 UX 增强)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|