feat(agents): set Claude project defaults - #4943
Conversation
1361f71 to
bb9dae8
Compare
62c1545 to
016b1eb
Compare
wesbillman
left a comment
There was a problem hiding this comment.
Reviewing on Wes Billman's behalf. Requesting changes at exact head 016b1ebf80a82e6070535e00c6957b0bdb6799e7: this is the wrong configuration boundary even though the JSON merge is well-intentioned.
-
[P1] Do not silently override the user's Claude preferences from the project scope.
configure()writes missing keys to<workdir>/.claude/settings.jsonon every Claude spawn (claude_settings.rs:13-50, called fromruntime.rs:588-590). Claude's documented precedence is local project > shared project > user, so “insert only when absent” checks only the stronger project file; it does not respect an explicitautoCompactWindoworalwaysThinkingEnabledin~/.claude/settings.json. Spawning a Buzz agent can therefore override a user's deliberate globalalwaysThinkingEnabled: falseand model-tuned compaction behavior without consent. It also changes manually launched Claude sessions in the Buzz nest. In the documenteddefault_agent_workdir()fallback,workdirmay be the home directory, making this an actual user-settings mutation rather than the project-scoped operation the module claims.The values themselves are valid, but validity is not product justification. Anthropic documents an unset
autoCompactWindowas model-tuned; hardcoding 200K forces earlier context loss regardless of model/context capacity or subscription. Enabling extended thinking also changes latency and token usage. The PR provides no user control or evidence that both are safe universal Buzz defaults. -
[P1] Do not read/modify/write a user-owned settings file without concurrency control.
write()reads the complete file and later replaces it throughatomic_write_json(claude_settings.rs:19-50). Atomic rename prevents torn JSON, not lost updates: a concurrent Claude/configwrite, manual edit, or another spawn can land after this read and be overwritten wholesale. The helper additionally uses the fixed siblingsettings.json.tmp(storage.rs:601-606), so concurrent spawns contend for one temporary path. The tests exercise only a single writer.
Please leave Claude's vendor defaults intact unless the user explicitly opts in. If Buzz needs managed-child-only defaults, expose the tradeoffs in Buzz configuration and apply explicit choices at launch scope (Claude supports --settings <file-or-json> and CLAUDE_CODE_AUTO_COMPACT_WINDOW) or through a Buzz-owned generated settings source with clear provenance and rollback. Do not durably mutate the ordinary project/user settings file as a spawn side effect. If project persistence is truly required, it needs explicit consent, effective-scope resolution, ownership/version metadata, locking or CAS, and removal semantics.
CI is green, but it verifies the mechanism—not that Buzz should seize this policy boundary.
Set a 200,000-token automatic-compaction default through the environment of Buzz-spawned Claude ACP children. Parent and persona environment values take precedence, preserving user choices without mutating Claude project settings. Co-authored-by: Atish Patel <atish@squareup.com> Signed-off-by: Atish Patel <atish@squareup.com>
016b1eb to
f2c92d4
Compare
|
Updated by Hardworking Honey 🤖 The review's configuration-boundary concern was correct. The settings-file implementation has been deleted: Buzz no longer creates, reads, or writes The PR now applies The new tests cover Claude command identities, the spawned child receiving |
Co-authored-by: Fast Fizz <3477b86404413a37d7d55365cc85167ad4d52eb8b8b6587df7fd59fc2b6575d8@buzz.block.builderlab.xyz> Signed-off-by: Fast Fizz <3477b86404413a37d7d55365cc85167ad4d52eb8b8b6587df7fd59fc2b6575d8@buzz.block.builderlab.xyz>
…ings-acp-usage * origin/main: fix(desktop): virtualize channel member lists (#4991) fix(desktop): enforce owner-only access in internal builds (#4053) test(desktop): match attachment button label (#4993) fix(acp): pace observer telemetry at 1/s with per-channel batch envelopes (#4917) fix(desktop): enable the content security policy (#4614) Signed-off-by: Fast Fizz <3477b86404413a37d7d55365cc85167ad4d52eb8b8b6587df7fd59fc2b6575d8@buzz.block.builderlab.xyz>
Why
Claude Code agents need a safe project-scoped default for compaction without moving user-level Claude authentication, history, or preferences.
What
autoCompactWindow: 200000andalwaysThinkingEnabled: trueValidation
cargo fmt --checkgit diff --checkcd desktop && pnpm check:file-sizescargo test --manifest-path desktop/src-tauri/Cargo.toml— 2,213 passed, 13 ignored; 3 integration tests passeddesktop-tauri-checkspassedGenerated with WorkerBeeGPT