Skip to content

Commit 13010fb

Browse files
Jakegogoclaude
andcommitted
feat: cluster conversation-audit org-pin + quota + connectivity/openclaw + delivery (multi-session checkpoint)
[aikey-control] user vault friendly test-error component + tests; compliance page; i18n (en/zh). Refs: - multi-session checkpoint (workflow): https://github.com/aikeylabs/workflow/blob/84085e1980116dc971f419ea0929f06a91897953/sessions/conversation-audit-enterprise.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8f054f4 commit 13010fb

4 files changed

Lines changed: 41 additions & 0 deletions

File tree

web/src/pages/user/vault/friendlyTestError.test.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ describe('friendlyTestError matching order', () => {
5252
expect(out.title).toBe('aikey-proxy is not running');
5353
});
5454

55+
it('I_CLUSTER_NODE_UNRESOLVED wins over httpStatus 503 (not "Local server is unavailable")', () => {
56+
// 2026-06-17 cluster follow-up: write.go maps this code to 503 but
57+
// the UI had no case → it fell through to the 5xx "restart web"
58+
// message for cluster team keys. Pin the cluster destination.
59+
const out = friendlyTestError({
60+
code: 'I_CLUSTER_NODE_UNRESOLVED',
61+
httpStatus: 503,
62+
message: 'team key is a cluster key; node resolved but probe target could not be built',
63+
});
64+
expect(out.title).toBe('Cluster node not ready');
65+
});
66+
5567
it('I_CREDENTIAL_NOT_FOUND wins over httpStatus 500', () => {
5668
// The credential was deleted between click and probe. Server may
5769
// wrap this in a 500 (it currently maps to 404, but pin the UI

web/src/pages/user/vault/friendlyTestError.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import type React from 'react';
2424
* Cases (in match order):
2525
* • I_PROXY_NOT_RUNNING — aikey-proxy isn't running (CLI's
2626
* dedicated error code from handle_test).
27+
* • I_CLUSTER_NODE_UNRESOLVED — cluster team-key probe: node resolved
28+
* but no probe target could be built
29+
* (transient hub/control connectivity).
2730
* • I_CREDENTIAL_NOT_FOUND — alias / id resolved to nothing (rare,
2831
* implies the row was deleted between
2932
* the test click and the backend run).
@@ -76,6 +79,26 @@ export function friendlyTestError(
7679
),
7780
};
7881
}
82+
if (code === 'I_CLUSTER_NODE_UNRESOLVED') {
83+
// 2026-06-17: the 2026-06-11 cluster work added this code to write.go
84+
// (mapped to 503) but NOT here, so a cluster team-key probe whose
85+
// target couldn't be built fell through to the 5xx "Local server is
86+
// unavailable" branch — the same wrong-target bug I_PROXY_NOT_RUNNING
87+
// had. This case keeps it pointed at the cluster, not at restarting
88+
// web. Bugfix: 20260523-test-connection-proxy-down-shows-local-server-
89+
// error.md (cluster follow-up).
90+
return {
91+
title: tr('vault.errClusterNodeUnresolvedTitle', 'Cluster node not ready'),
92+
detail: tr(
93+
'vault.errClusterNodeUnresolvedDetail',
94+
"This team key's credential lives on the cluster's central node. The node resolved but the connectivity probe target couldn't be built — usually a transient state.",
95+
),
96+
action: tr(
97+
'vault.errClusterNodeUnresolvedAction',
98+
'Retry. If it keeps failing, run `aikey use <alias>` to refresh the key, or check control / hub connectivity.',
99+
),
100+
};
101+
}
79102
if (code === 'I_CREDENTIAL_NOT_FOUND') {
80103
return {
81104
title: tr('vault.errCredNotFoundTitle', 'Key not found'),

web/src/shared/i18n/locales/en/common.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,9 @@
569569
"errProxyNotRunningTitle": "aikey-proxy is not running",
570570
"errProxyNotRunningDetail": "The probe routes through aikey-proxy. Start the proxy and re-run the test.",
571571
"errProxyNotRunningActionPrefix": "Start it in a terminal: ",
572+
"errClusterNodeUnresolvedTitle": "Cluster node not ready",
573+
"errClusterNodeUnresolvedDetail": "This team key's credential lives on the cluster's central node. The node resolved but the connectivity probe target couldn't be built — usually a transient state.",
574+
"errClusterNodeUnresolvedAction": "Retry. If it keeps failing, run `aikey use <alias>` to refresh the key, or check control / hub connectivity.",
572575
"errCredNotFoundTitle": "Key not found",
573576
"errCredNotFoundDetail": "The vault no longer contains a credential with this alias / id. It may have been deleted in another window.",
574577
"errCredNotFoundAction": "Refresh the list (top-right button) and try again.",

web/src/shared/i18n/locales/zh/common.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,9 @@
569569
"errProxyNotRunningTitle": "aikey-proxy 未运行",
570570
"errProxyNotRunningDetail": "检测会经由 aikey-proxy。请启动代理后重新运行检测。",
571571
"errProxyNotRunningActionPrefix": "在终端中启动:",
572+
"errClusterNodeUnresolvedTitle": "集群节点未就绪",
573+
"errClusterNodeUnresolvedDetail": "该团队密钥的凭据存放在集群中心节点。节点已解析,但连通性探测目标暂时无法建立 —— 通常是临时状态。",
574+
"errClusterNodeUnresolvedAction": "请重试。若持续失败,运行 `aikey use <别名>` 刷新密钥,或检查 control / hub 连通性。",
572575
"errCredNotFoundTitle": "未找到密钥",
573576
"errCredNotFoundDetail": "保管库中已不存在使用此别名 / ID 的凭据。它可能已在其他窗口中被删除。",
574577
"errCredNotFoundAction": "刷新列表(右上角按钮)后重试。",

0 commit comments

Comments
 (0)