Skip to content

Commit 2b0f5e9

Browse files
authored
Improve agent runtime settings (#2026)
1 parent 2e936d4 commit 2b0f5e9

20 files changed

Lines changed: 918 additions & 619 deletions

File tree

‎crates/buzz-acp/src/setup_mode.rs‎

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub(crate) enum RequirementPayload {
113113
/// One-line stderr excerpt identifying the parse error.
114114
diagnostic: String,
115115
},
116-
/// Git for Windows is missing; open Doctor for the installation guide.
116+
/// Git for Windows is missing; open Agent runtimes for the installation guide.
117117
GitBash,
118118
}
119119

@@ -139,7 +139,7 @@ impl RequirementPayload {
139139
.map(String::as_str)
140140
.unwrap_or("the agent");
141141
format!(
142-
"install the {} ACP adapter (open Doctor in Settings to diagnose)",
142+
"install the {} ACP adapter (open Agent runtimes in Settings to diagnose)",
143143
harness
144144
)
145145
}
@@ -149,7 +149,7 @@ impl RequirementPayload {
149149
.map(String::as_str)
150150
.unwrap_or("the agent");
151151
format!(
152-
"reinstall the {} ACP adapter — the installed version is outdated (open Doctor in Settings to diagnose)",
152+
"reinstall the {} ACP adapter — the installed version is outdated (open Agent runtimes in Settings to diagnose)",
153153
harness
154154
)
155155
}
@@ -159,7 +159,7 @@ impl RequirementPayload {
159159
.map(String::as_str)
160160
.unwrap_or("the agent");
161161
format!(
162-
"install {} CLI (open Doctor in Settings to diagnose)",
162+
"install {} CLI (open Agent runtimes in Settings to diagnose)",
163163
harness
164164
)
165165
}
@@ -168,7 +168,10 @@ impl RequirementPayload {
168168
.first()
169169
.map(String::as_str)
170170
.unwrap_or("the agent");
171-
format!("install {} (open Doctor in Settings to diagnose)", harness)
171+
format!(
172+
"install {} (open Agent runtimes in Settings to diagnose)",
173+
harness
174+
)
172175
}
173176
},
174177
RequirementPayload::CliConfigInvalid {
@@ -184,7 +187,7 @@ impl RequirementPayload {
184187
)
185188
}
186189
RequirementPayload::GitBash => {
187-
"install Git for Windows (open Doctor in Settings to diagnose)".to_string()
190+
"install Git for Windows (open Agent runtimes in Settings to diagnose)".to_string()
188191
}
189192
}
190193
}
@@ -264,7 +267,7 @@ impl SetupPayload {
264267
.any(|r| matches!(r, RequirementPayload::CliConfigInvalid { .. }));
265268

266269
let footer = if has_doctor_requirement {
267-
"Open Doctor in the Buzz app, install Git for Windows, then re-check and restart the agent.".to_string()
270+
"Open Agent runtimes in Settings, install Git for Windows, then re-check and restart the agent.".to_string()
268271
} else if all_external {
269272
// All requirements are external config files — Edit Agent cannot
270273
// help. Don't send the user there.
@@ -743,6 +746,53 @@ mod tests {
743746
);
744747
}
745748

749+
#[test]
750+
fn nudge_body_runtime_install_copy_points_to_agent_runtimes() {
751+
for availability in [
752+
AcpAvailabilityStatus::AdapterMissing,
753+
AcpAvailabilityStatus::AdapterOutdated,
754+
AcpAvailabilityStatus::CliMissing,
755+
AcpAvailabilityStatus::NotInstalled,
756+
] {
757+
let payload = SetupPayload {
758+
agent_name: "Codex".to_string(),
759+
agent_pubkey: "test".to_string(),
760+
requirements: vec![RequirementPayload::CliLogin {
761+
probe_args: vec!["codex".to_string()],
762+
setup_copy: "run `codex login`".to_string(),
763+
availability,
764+
}],
765+
};
766+
let body = payload.nudge_body();
767+
assert!(
768+
body.contains("Agent runtimes in Settings"),
769+
"runtime install nudge must point to Agent runtimes; got: {body:?}"
770+
);
771+
assert!(
772+
!body.contains("Doctor"),
773+
"runtime install nudge must not point to the removed Doctor section; got: {body:?}"
774+
);
775+
}
776+
}
777+
778+
#[test]
779+
fn nudge_body_git_bash_copy_points_to_agent_runtimes() {
780+
let payload = SetupPayload {
781+
agent_name: "Buzz Agent".to_string(),
782+
agent_pubkey: "test".to_string(),
783+
requirements: vec![RequirementPayload::GitBash],
784+
};
785+
let body = payload.nudge_body();
786+
assert!(
787+
body.contains("Open Agent runtimes in Settings"),
788+
"Git Bash nudge must point to Agent runtimes; got: {body:?}"
789+
);
790+
assert!(
791+
!body.contains("Doctor"),
792+
"Git Bash nudge must not point to the removed Doctor section; got: {body:?}"
793+
);
794+
}
795+
746796
#[test]
747797
fn nudge_body_empty_requirements_falls_back_to_generic() {
748798
let payload = SetupPayload {
8.51 KB
Loading
14.3 KB
Loading
Lines changed: 6 additions & 0 deletions
Loading

‎desktop/src/app/AppShellContext.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type AppShellContextValue = {
4949
feedItemState: FeedItemState;
5050
// Open the Settings panel at the given section. Available on all surfaces
5151
// that render under AppShell (channel, home, projects, pulse, agents).
52-
// Used by config-nudge cards to deep-link to Settings → Doctor.
52+
// Used by config-nudge cards to deep-link to Settings → Agents.
5353
onOpenSettings: ((section: SettingsSection) => void) | null;
5454
};
5555

‎desktop/src/app/routes/settings.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ type SettingsRouteSearch = {
1212
function validateSettingsSearch(
1313
search: Record<string, unknown>,
1414
): SettingsRouteSearch {
15+
if (search.section === "doctor") {
16+
return { section: "agents" };
17+
}
18+
1519
return {
1620
section: isSettingsSection(search.section) ? search.section : undefined,
1721
};

‎desktop/src/features/agents/ui/AgentDefinitionDialog.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ export function AgentDefinitionDialog({
624624
: selectedRuntime.availability === "cli_missing"
625625
? `${selectedRuntime.label} ACP adapter is installed but the CLI is missing.`
626626
: `${selectedRuntime.label} is not installed.`}{" "}
627-
Visit Settings &gt; Doctor to set it up.
627+
Visit Settings &gt; Agents to set it up.
628628
</p>
629629
) : null;
630630
const advancedFieldsTransition = shouldReduceMotion

‎desktop/src/features/onboarding/ui/SetupStep.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,8 @@ function RuntimeProvidersSection({
815815
className="max-w-[560px] rounded-2xl bg-white/70 px-6 py-6 text-sm text-muted-foreground"
816816
data-testid="onboarding-acp-empty"
817817
>
818-
No compatible ACP runtimes detected yet. You can finish setup now
819-
and come back later in Settings &gt; Doctor.
818+
No compatible agent runtimes detected yet. You can finish setup now
819+
and come back later in Settings &gt; Agents.
820820
</p>
821821
)}
822822

‎desktop/src/features/profile/ui/ProfileAvatar.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type ProfileAvatarProps = {
1313
label: string;
1414
className?: string;
1515
iconClassName?: string;
16+
imageClassName?: string;
1617
plain?: boolean;
1718
testId?: string;
1819
};
@@ -23,6 +24,7 @@ export function ProfileAvatar({
2324
label,
2425
className,
2526
iconClassName,
27+
imageClassName,
2628
plain = false,
2729
testId,
2830
}: ProfileAvatarProps) {
@@ -67,7 +69,7 @@ export function ProfileAvatar({
6769
{src !== undefined ? (
6870
<AvatarImage
6971
alt={`${label} avatar`}
70-
className="object-cover"
72+
className={cn("object-cover", imageClassName)}
7173
data-testid={testId ? `${testId}-image` : undefined}
7274
onLoadingStatusChange={(status) => {
7375
if (status === "error") setFailedSrc(liveSrc);

0 commit comments

Comments
 (0)