mirror of
https://github.com/block/buzz.git
synced 2026-11-02 15:31:27 +00:00
Replace per-worker desired_effort/startup_effort with ONE pool-level
desired_effort (AgentPool::desired_effort). Closes I-2 (queued-as-ok),
I-3 (first-idle-only), and I-5 (spawn-drift) together.
Rust (crates/buzz-acp):
- AgentPool gains desired_effort field; set_idle_agent_effort replaced
by set_pool_effort (stores pool-level, invalidates all idle sessions,
returns Stored { invalidated }) and clear_pool_effort (sets None,
invalidates all idle).
- try_claim always copies pool.desired_effort onto the claimed agent.
- return_agent propagates startup-resolved effort back to pool level.
- create_session_and_apply_model emits honest final control_result ack
(ok/failure) after the real ACP call; no pre-persist on queued state.
- handle_set_config_option_control: clear path emits "cleared"; non-empty
path emits "pending_session"; I-7 validates value against adapter-
advertised options and emits "invalid_value" on mismatch.
- M-1: restore damaged PoolStartup doc comment.
- Tests: set_pool_effort_stores_and_invalidates, multi-worker convergence,
clear_pool_effort, test_b5_empty_value_emits_cleared_ack,
test_b5_invalid_value_emits_invalid_value_ack_and_does_not_update_pool.
TypeScript (desktop/src):
- effortOutcome.ts: awaitEffortOutcome helper — subscribes before send,
awaits correlated final result (ok/failure/invalid_value/cleared), falls
back to pending_session on timeout.
- effortOutcome.test.mjs: 13 tests covering all statuses, correlation,
cleanup, and deferred-path (pending_session → final ok).
- EffortPicker: uses awaitEffortOutcome; empty value = clear (I-1);
effortOptions from adapter (I-7); surfaces pending_session / failure /
invalid_value status messages; invalidates queries on ok/cleared.
- observerRelayStore: persist on ok+thought_level (final applied ack) OR
cleared+thought_level (Auto clear); skip all other statuses.
- types.ts: SetConfigOptionResult named type; effortOptions field on
RuntimeConfigSurface.
agents_deploy.rs (I-4): project record.effort_level → BUZZ_ACP_EFFORT_LEVEL
into remote policy_env, mirroring local spawn; positive/negative tests.
config_bridge (M-2/M-3): direct test for mcp_config_file_path_for_runtime
with custom CLAUDE_CONFIG_DIR; treat empty/blank CLAUDE_CONFIG_DIR as unset
in agent_config.rs (matches Claude's || homedir() semantics).
reader.rs: effort_options populated from session cache for claude runtime.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>