Skip to content

fix(tool): preserve custom builtins across create_bash calls#461

Merged
chaliy merged 1 commit intomainfrom
claude/fix-422-Y2nIj
Mar 2, 2026
Merged

fix(tool): preserve custom builtins across create_bash calls#461
chaliy merged 1 commit intomainfrom
claude/fix-422-Y2nIj

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Mar 2, 2026

Summary

  • Changed BashTool.builtins from Vec<(String, Box<dyn Builtin>)> to Vec<(String, Arc<dyn Builtin>)>
  • create_bash() now clones Arc refs instead of std::mem::take which emptied builtins
  • Added Builtin impl for Arc<dyn Builtin> to enable Box wrapping

Test plan

  • test_create_bash_preserves_builtins — custom builtin available on second call
  • All lib tests pass

Closes #422

std::mem::take emptied builtins on first use. Switch to Arc<dyn Builtin>
so builtins are cloned (via Arc) on each create_bash call. Add Builtin
impl for Arc<dyn Builtin> to enable Box wrapping.

Closes #422

https://claude.ai/code/session_01WZjYqxm5xMPAEe7FSHJkDy
@chaliy chaliy merged commit cab46fb into main Mar 2, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M-8] BashTool::create_bash() loses custom builtins after first call

2 participants