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
chore: refactor sandbox_create to use a builder pattern #1408
run::sandbox_create in crates/openshell-cli/src/run.rs has grown into a large positional-argument API. Call sites now pass many None, false, Some(false), empty slice, and empty map values, which makes tests and CLI dispatch hard to read and easy to break when parameters are added or reordered.
crates/openshell-cli/src/run.rs: sandbox_create currently takes 19 parameters and has #[allow(clippy::too_many_arguments)].
crates/openshell-cli/src/main.rs: CLI dispatch builds the positional call from parsed command state.
crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs: integration tests repeat long calls where only a few fields vary.
Proposed Work
Introduce a typed SandboxCreateOptions/SandboxCreateBuilder API for sandbox creation, then update the CLI and tests to construct options by field name instead of relying on positional arguments.
The exact type names and ownership model should follow the existing CLI code style. Preserve existing sandbox_create behavior while moving the argument list into a single structured config.
Definition of Done
Replace the large positional sandbox_create signature with a builder/options-based API.
Remove the local clippy::too_many_arguments allowance for this method.
Update crates/openshell-cli/src/main.rs to construct the request through named fields/builder methods.
Update integration tests to use the new builder or concise test helpers.
Preserve existing sandbox create behavior, including keep/no-keep, forwarding, provider inference, resource limits, labels, TLS, and command handling.
Run the relevant CLI tests, at minimum cargo test -p openshell-cli sandbox_create or the equivalent mise task.
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.
While digging through the CLI crate codebase, I noticed after this issue was filed, PR #1349 landed and introduced ProviderRefreshConfigInput (consumed by provider_refresh_config(server, input, tls)):
Activity
github-actions commentedon Jun 16, 2026
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.
lunarwhite commentedon Jun 16, 2026
Hi @drew, I'd like to take this task if it's still needed and open to external contribution
drew commentedon Jun 16, 2026
That'd be great, thanks.
lunarwhite commentedon Jun 17, 2026
While digging through the CLI crate codebase, I noticed after this issue was filed, PR #1349 landed and introduced
ProviderRefreshConfigInput(consumed by provider_refresh_config(server, input, tls)):OpenShell/crates/openshell-cli/src/run.rs
Lines 5115 to 5122 in f1245a3
which uses a struct-based config (plain struct with pub fields, no builder methods), not the builder pattern this issue originally sketched.
I consulted the spike agent, it suggests following
ProviderRefreshConfigInput's config-bundle precedent:Hi @drew. Which approach should we go with? Do you have a preference? Any inputs would be appreciated. :)