Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/presentation/dashboard/src/data/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export const managerChannelBindingSchema = z.object({
schema_version: z.string(),
executor_endpoint: z.string(),
executor_endpoint_source: z.string(),
// Why the shipped default resolved the way it did. Present so a conditional
// default reads as a decision with a reason instead of an incidental
// environment value; empty when the operator selected the endpoint explicitly.
executor_endpoint_default_reason: z.string().optional(),
executor_kind: z.string(),
model: z.string(),
model_source: z.string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,30 @@
: t("header.managerExecutorKindRegistered")
: null;
const managerExecutionUnavailable = managerChannelBinding?.available === false;
// Name the reason instead of one hardcoded host: the channel can hold the
// managed host through its segment transport now, so "this channel needs
// codex" would be both wrong and unactionable. An unknown reason stays
// unclaimed rather than being rendered as a reason this build invented.
const managerExecutionUnavailableReason = managerChannelBinding?.available === false
? managerChannelBinding.unavailable_reason
: null;
const managerExecutionUnavailableKey = managerExecutionUnavailableReason === "operator_credential_unconfigured"
? "header.managerExecutionUnavailableCredential"
: managerExecutionUnavailableReason === "dsh_runtime_unavailable"
? "header.managerExecutionUnavailableRuntime"
: managerExecutionUnavailableReason === "invalid_reasoning_effort"
? "header.managerExecutionUnavailableEffort"
: "header.managerExecutionUnavailable";

Check warning on line 113 in apps/presentation/dashboard/src/features/personal-workspace/channel-header.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Extract this nested ternary operation into an independent statement.

See more on https://sonarcloud.io/project/issues?id=huangruiteng_loopx&issues=AaCmlPXWvdOsGv8pl7D0&open=AaCmlPXWvdOsGv8pl7D0&pullRequest=4470

Check warning on line 113 in apps/presentation/dashboard/src/features/personal-workspace/channel-header.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Extract this nested ternary operation into an independent statement.

See more on https://sonarcloud.io/project/issues?id=huangruiteng_loopx&issues=AaCmlPXWvdOsGv8pl7Dz&open=AaCmlPXWvdOsGv8pl7Dz&pullRequest=4470
// The shipped default is conditional, so the chip says which branch it took
// and why; without this a steward on codex looks identical whether the
// operator chose it or the machine simply had no credential.
const managerExecutionDefaultReason = managerChannelBinding
&& managerChannelBinding.executor_endpoint_source === "product_default"

Check warning on line 118 in apps/presentation/dashboard/src/features/personal-workspace/channel-header.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=huangruiteng_loopx&issues=AaCmlPXWvdOsGv8pl7D1&open=AaCmlPXWvdOsGv8pl7D1&pullRequest=4470
&& (managerChannelBinding.executor_endpoint_default_reason ?? "") !== ""
? managerChannelBinding.executor_endpoint_default_reason === "operator_credential_absent"
? "header.managerEndpointWithoutCredential"
: "header.managerEndpointFromCredential"

Check warning on line 122 in apps/presentation/dashboard/src/features/personal-workspace/channel-header.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Extract this nested ternary operation into an independent statement.

See more on https://sonarcloud.io/project/issues?id=huangruiteng_loopx&issues=AaCmlPXWvdOsGv8pl7D2&open=AaCmlPXWvdOsGv8pl7D2&pullRequest=4470
: null;

return (
<header className="personal-channel-header">
Expand All @@ -123,7 +147,15 @@
</span>
{managerExecutionUnavailable ? (
<span className="personal-execution-note">
{t("header.managerExecutionUnavailable", { executor: managerChannelBinding.executor_endpoint })}
{t(managerExecutionUnavailableKey, {
executor: managerChannelBinding.executor_endpoint,
credential: managerChannelBinding.credential_env_var,
})}
</span>
) : null}
{managerExecutionDefaultReason ? (
<span className="personal-execution-rule-note">
{t(managerExecutionDefaultReason, { executor: managerChannelBinding.executor_endpoint })}
</span>
) : null}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,12 @@ const en = {
"header.managerExecutorKindIndividual": "individual CLI login",
"header.managerExecutorKindManaged": "operator credential",
"header.managerExecutorKindRegistered": "registered endpoint",
"header.managerExecutionUnavailable": "Selected {executor} has no Chat transport yet; this channel needs codex, or run the managed host through loopx turn.",
"header.managerExecutionUnavailable": "Selected {executor} cannot start here; this channel does not fall back to an individual CLI login.",
"header.managerExecutionUnavailableCredential": "Selected {executor} needs the operator credential {credential} before this channel can start it.",
"header.managerExecutionUnavailableRuntime": "Selected {executor} cannot start here because its runtime is not installed on this machine.",
"header.managerExecutionUnavailableEffort": "Selected {executor} rejected the configured reasoning effort; set a supported effort and reload.",
"header.managerEndpointFromCredential": "Selected {executor} because the operator credential is configured.",
"header.managerEndpointWithoutCredential": "Selected {executor} because no operator credential is configured on this machine.",
"header.managerOverview": "Overview",
"header.managerView": "Manager view",
"header.openGoalNavigation": "Open Goal navigation",
Expand Down Expand Up @@ -1412,7 +1417,12 @@ const zhCN: Record<WorkspaceMessageKey, string> = {
"header.managerExecutorKindIndividual": "个人 CLI 登录",
"header.managerExecutorKindManaged": "operator 凭据",
"header.managerExecutorKindRegistered": "注册端点",
"header.managerExecutionUnavailable": "所选执行器 {executor} 尚无 Chat 通道;管家通道需要 codex,托管宿主请走 loopx turn。",
"header.managerExecutionUnavailable": "所选执行器 {executor} 无法在本机启动;该通道不会回落到个人 CLI 登录。",
"header.managerExecutionUnavailableCredential": "所选执行器 {executor} 需要 operator 凭据 {credential},配置后该通道才能启动它。",
"header.managerExecutionUnavailableRuntime": "所选执行器 {executor} 无法在本机启动:本机未安装其 runtime。",
"header.managerExecutionUnavailableEffort": "所选执行器 {executor} 拒绝了当前配置的推理档位;请改为受支持的档位后刷新。",
"header.managerEndpointFromCredential": "因为已配置 operator 凭据,当前选择 {executor}。",
"header.managerEndpointWithoutCredential": "因为本机未配置 operator 凭据,当前选择 {executor}。",
"header.managerOverview": "总览",
"header.managerView": "管家视图",
"header.openGoalNavigation": "打开 Goal 导航",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading