Q93: disconnect erases the secret here and revokes at the provider where it can

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 15:33:58 -04:00
1 parent 06eb2ce8dc
commit 7cd386a38c
15 files changed
+257 -29

No files matched your search

+3 -1
View File
@@ -32,6 +32,9 @@ export const zh: Record<string, string> = {
"superseded": "已被取代",
"stalled": "已停滞",
"Resume": "恢复",
"Disconnect": "断开连接",
"Revokes the sign-in at {provider} and erases it from this computer.": "在 {provider} 撤销登录授权,并从本机删除。",
"Erases the key from this computer. {provider} keeps accepting it until you revoke it in your account.": "仅从本机删除密钥。在你于 {provider} 账号中撤销之前,该密钥仍然有效。",
"API key (if the server asks for one)": "API 密钥(服务需要时填写)",
"Checking...": "检查中...",
"Check for agent work": "检查能否胜任 Agent 工作",
@@ -400,7 +403,6 @@ export const zh: Record<string, string> = {
"Restricted": "受限",
"Retry": "重试",
"Reviews deliverables": "交付物需审核",
"Revoke": "撤销",
"Risk": "风险",
"Role": "角色",
"Roster": "名册",
@@ -72,6 +72,7 @@ export function ProvidersPanel({ orgId, employeeId, providers, authProfiles, cat
onCheck={() => void actions.run(() => window.agentCompany.checkProviderHealth({ orgId, providerId: provider.id }))}
onManage={() => setActive(provider)}
onRevoke={() => void actions.run(() => window.agentCompany.revokeProviderCredential({ orgId, providerId: provider.id }))}
revokesRemotely={requireCatalogEntry(catalog, provider.providerKey).revokesRemotely}
/>
))}
</div>
@@ -317,6 +318,7 @@ function ProviderRow({
onCheck,
onManage,
onRevoke,
revokesRemotely,
}: {
provider: ProviderRecord;
authProfile: ProviderAuthProfileRecord | null;
@@ -324,6 +326,7 @@ function ProviderRow({
onCheck: () => void;
onManage: () => void;
onRevoke: () => void;
revokesRemotely: boolean;
}) {
const boundCount = agents.filter((agent) => agent.modelProviderId === provider.id).length;
return (
@@ -353,7 +356,15 @@ function ProviderRow({
<span className="reveal row" style={{ gap: 6 }}>
<Button onClick={onCheck}>{t("Check")}</Button>
<Button onClick={onManage}>{t("Manage")}</Button>
<Button tone="ghost" onClick={onRevoke}>{t("Revoke")}</Button>
<Button
tone="ghost"
onClick={onRevoke}
title={revokesRemotely
? t("Revokes the sign-in at {provider} and erases it from this computer.", { provider: provider.label })
: t("Erases the key from this computer. {provider} keeps accepting it until you revoke it in your account.", { provider: provider.label })}
>
{t("Disconnect")}
</Button>
</span>
</div>
);
@@ -408,3 +419,9 @@ function requireProviderRateLimit(
if (!rateLimit) throw new Error(`Provider rate limit state missing for ${provider.id}.`);
return rateLimit;
}
function requireCatalogEntry(catalog: ProviderCatalogEntry[], providerKey: string): ProviderCatalogEntry {
const entry = catalog.find((candidate) => candidate.key === providerKey);
if (!entry) throw new Error(`Provider ${providerKey} is not in the catalog.`);
return entry;
}