You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(python): wire custom builtins through BuiltinRegistry for parity with JS bindings #1724
PR #1721 added BuiltinRegistry to the bashkit core and wired it through the JS bindings: Bash.addBuiltin() / Bash.removeBuiltin() and BashOptions.customBuiltins that survive reset() and don't disturb the VFS.
The Python bindings still use the older build-time-only approach (introduced in #1315). BashOptions.custom_builtins is honored at construction but goes through BashBuilder::builtin(...) — there's no Bash.add_builtin() method, and entries do not flow through the new BuiltinRegistry.
This means Python lacks:
Post-construction registration / removal of custom builtins
The "register a builtin after execute() without rebuilding the interpreter" guarantee
Parity with the JS-side semantics
Breaking changes are acceptable here — Python custom_builtins is a small surface and we'd rather have one consistent design across bindings than carry two.
Scope
Replace apply_custom_builtins_to_builder (crates/bashkit-python/src/lib.rs:2668) with builder.builtin_registry(registry.clone()) + populate the registry with constructor-time entries
Add Bash.add_builtin(name, callback) and Bash.remove_builtin(name) methods
Mirror for BashTool if it exposes a similar API
Introduce PyCustomBuiltinAdapter (same shape as JsCustomBuiltinAdapter in crates/bashkit-js/src/lib.rs)
Decide on the sync/async story — Python callbacks are sync by default; the adapter should refuse rather than deadlock when invoked from a sync interpreter path (see related issue for the JS guardrail)
Update tests in crates/bashkit-python/tests/ to cover post-construction registration, VFS persistence, reset() survival, override precedence
Activity
feat(python): wire custom builtins through BuiltinRegistry (#1733)
feat(python): wire custom builtins through BuiltinRegistry (#1733)