mirror of
https://github.com/block/buzz.git
synced 2026-11-14 05:12:27 +00:00
feat(desktop): offer Claude effort levels in agent edit and create (#8059)
Claude Code agents now get a thinking-effort dropdown in the agent Edit and Create dialogs, matching the one buzz-agent and Codex agents already have. ## Behavior - **Where levels come from:** Claude effort levels come from the Claude model data for the model that will actually run after Save, resolved in order: explicit model, then inherited default (linked definition or global), then adapter default. Stored Claude session levels are not used, because the stored session data does not record which model produced them. - **Edit:** for an agent linked to a definition, effort follows the definition's model, which stays authoritative. Save never sends a model for linked agents. - **Create:** effort is offered for local agents only and is stored on the instance. Allowed levels are recomputed on every render, so collapsing Advanced and then switching to a model without effort (e.g. Haiku) drops effort from the request. Non-local effort is rejected before any create side effects. - **Persistence:** `create_managed_agent` sets the picked effort when it builds the record and drops stale effort env aliases. Its body runs over any Tauri runtime, so a mock-app test drives the real create path and reads the record back from disk. That test runs in a child process with temp app-data and nest folders, and a test-only switch turns keychain use off so agent keys stay inline in the temp agent file and the OS keychain is never touched. - **Observer store:** live session-config captures are written to the store before the dialog refreshes; archived captures are read-only. - **Codex:** its existing session-native effort picker is unchanged. --------- Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Co-authored-by: Hayt <211b96e6a2b7f45fd4047988976c7bbbeeda0c15f3ae7b32eec20834b5a55118@buzz.block.builderlab.xyz>
This commit is contained in:
@@ -120,6 +120,8 @@ export type MockManagedAgentSeed = {
|
||||
personaId?: string | null;
|
||||
/** Harness/runtime id pin; `null` = inherit from persona (native default). */
|
||||
runtime?: string | null;
|
||||
/** Model pinned on the instance record. */
|
||||
model?: string | null;
|
||||
status?: RawManagedAgent["status"];
|
||||
channelNames?: string[];
|
||||
channelIds?: string[];
|
||||
@@ -679,6 +681,10 @@ type E2eConfig = {
|
||||
* returning a catalog.
|
||||
*/
|
||||
discoverAgentModelsError?: string;
|
||||
/** Delay (ms) before `discover_agent_models` settles. */
|
||||
discoverAgentModelsDelayMs?: number;
|
||||
/** Config surface returned for every agent instead of the per-runtime mocks. */
|
||||
agentConfigSurface?: Record<string, unknown>;
|
||||
/** ACP commands returned by the discovery IPC in mock mode. */
|
||||
acpCommands?: Array<{ command: string; binaryPath: string }>;
|
||||
// Backend provider mocks for the create-agent "Run on" section. See
|
||||
@@ -2540,7 +2546,7 @@ function buildSeededManagedAgent(seed: MockManagedAgentSeed): MockManagedAgent {
|
||||
parallelism: 1,
|
||||
system_prompt: null,
|
||||
avatar_url: seed.avatarUrl ?? null,
|
||||
model: null,
|
||||
model: seed.model ?? null,
|
||||
env_vars: { ...(seed.envVars ?? {}) },
|
||||
status,
|
||||
pid: status === "running" ? 42000 + mockManagedAgents.length : null,
|
||||
@@ -14175,6 +14181,10 @@ export function maybeInstallE2eTauriMocks() {
|
||||
supportsSwitching: false,
|
||||
};
|
||||
case "discover_agent_models": {
|
||||
const discoverDelayMs = activeConfig?.mock?.discoverAgentModelsDelayMs;
|
||||
if (discoverDelayMs) {
|
||||
await new Promise((resolve) => setTimeout(resolve, discoverDelayMs));
|
||||
}
|
||||
const discoverError = activeConfig?.mock?.discoverAgentModelsError;
|
||||
if (discoverError) {
|
||||
throw new Error(discoverError);
|
||||
@@ -14280,6 +14290,8 @@ export function maybeInstallE2eTauriMocks() {
|
||||
}
|
||||
case "get_agent_config_surface": {
|
||||
const configArgs = payload as { pubkey: string };
|
||||
const surfaceOverride = activeConfig?.mock?.agentConfigSurface;
|
||||
if (surfaceOverride) return surfaceOverride;
|
||||
return buildMockConfigSurface(configArgs.pubkey);
|
||||
}
|
||||
case "get_runtime_file_config": {
|
||||
|
||||
Reference in New Issue
Block a user