[PR #292] [MERGED] fix(cli): reliably fall back to sh when bash is unavailable #325

Closed
opened 2026-10-29 14:22:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/292
Author: @zlzGithub-0801
Created: 9/15/2026
Status: ✅ Merged
Merged: 9/16/2026
Merged by: @yingdi-shan

Base: main ← Head: fix/connect-shell-fallback


📝 Commits (1)

  • 02417b4 fix(cli): reliably fall back to sh when bash is unavailable

📊 Changes

1 file changed (+22 additions, -33 deletions)

View changed files

📝 crates/aenv/src/commands/connect.rs (+22 -33)

📄 Description

What

Replace the CLI-side shell retry loop in aenv connect with a single BusyBox launch that picks the shell inside the guest.

Why

aenv start / aenv cn used to try /bin/bash then /bin/sh from the CLI side,

envd starts a wrapper process (nice) and returns its PID immediately, so the CLI treats bash as successfully started. Only afterwards does nice discover the image has no bash:

Because the CLI already accepted the PID, it never falls through to /bin/sh. On scratch-based images the session is dead on arrival.

N/A

Scope and non-goals

In scope: interactive shell selection in crates/aenv/src/commands/connect.rs.

Not in scope: AgentENV behavior.

Design and behavior changes

Always launch the BusyBox binary shipped on the tools disk, and let it choose the shell.

Compatibility and operations

  • Public API or generated protocol: N/A.
  • Configuration or defaults: N/A.
  • Snapshot manifest, artifact layout, or storage format: N/A.
  • Upgrade and rollback: N/A.
  • Host requirements, permissions, ports, or dependencies: N/A.

Validation

  • make fmt
  • make clippy
  • make test-unit
  • Relevant Rust integration tests
  • make -C services test (required when services/ changes)
  • Generated clients/server regenerated with the documented make target
  • Documentation updated
  • Benchmarks or performance comparison completed

Risks and reviewer notes

N/A

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • New behavior is covered by tests, or I explained why testing is impractical.
  • Logs and examples contain no credentials, tokens, or private registry information.
  • I did not manually edit generated code without updating its source and regenerating it.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/292 **Author:** [@zlzGithub-0801](https://github.com/zlzGithub-0801) **Created:** 9/15/2026 **Status:** ✅ Merged **Merged:** 9/16/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `fix/connect-shell-fallback` --- ### 📝 Commits (1) - [`02417b4`](https://github.com/kvcache-ai/AgentENV/commit/02417b4b8fe4cf5301f402c411aa4ab4bda64743) fix(cli): reliably fall back to sh when bash is unavailable ### 📊 Changes **1 file changed** (+22 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `crates/aenv/src/commands/connect.rs` (+22 -33) </details> ### 📄 Description ## What Replace the CLI-side shell retry loop in `aenv connect` with a single BusyBox launch that picks the shell inside the guest. ## Why `aenv start` / `aenv cn` used to try `/bin/bash` then `/bin/sh` from the CLI side, envd starts a wrapper process (`nice`) and returns its PID immediately, so the CLI treats bash as successfully started. Only afterwards does `nice` discover the image has no bash: Because the CLI already accepted the PID, it never falls through to `/bin/sh`. On scratch-based images the session is dead on arrival. ## Related issue N/A ## Scope and non-goals In scope: interactive shell selection in `crates/aenv/src/commands/connect.rs`. Not in scope: AgentENV behavior. ## Design and behavior changes Always launch the BusyBox binary shipped on the tools disk, and let it choose the shell. ## Compatibility and operations - Public API or generated protocol: N/A. - Configuration or defaults: N/A. - Snapshot manifest, artifact layout, or storage format: N/A. - Upgrade and rollback: N/A. - Host requirements, permissions, ports, or dependencies: N/A. ## Validation - [x] `make fmt` - [x] `make clippy` - [x] `make test-unit` - [ ] Relevant Rust integration tests - [ ] `make -C services test` (required when `services/` changes) - [ ] Generated clients/server regenerated with the documented `make` target - [ ] Documentation updated - [ ] Benchmarks or performance comparison completed ## Risks and reviewer notes N/A ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [x] New behavior is covered by tests, or I explained why testing is impractical. - [x] Logs and examples contain no credentials, tokens, or private registry information. - [x] I did not manually edit generated code without updating its source and regenerating it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:22:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#325
No description provided.