Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 17:15 UTC
fix(installer): resolve bin dir before shell setup
jkomyno committed
Aug 4, 2026 at 18:18 UTC
47ae5f30299445510cb4af9e49a3a36cb6ec43b5
2 files changed
+30
-5
install.sh
+3
-3
@@ -347,16 +347,16 @@ inline_shell_setup() {
347
setup_requested_shell() {
348
if "$exe" install --help 2>&1 | grep -q -- '--shell'; then
349
debug "delegating shell setup to $exe install --shell $requested_shell"
350
- if COMPOSIO_CLI_INVOCATION_ORIGIN=installer COMPOSIO_BIN_DIR="$COMPOSIO_BIN_DIR" "$exe" install --shell "$requested_shell"; then
350
+ if COMPOSIO_CLI_INVOCATION_ORIGIN=installer COMPOSIO_BIN_DIR="$resolved_bin_dir" "$exe" install --shell "$requested_shell"; then
351
shell_configured=cli
352
else
353
debug "falling back to inline $requested_shell shell setup"
354
- inline_shell_setup "$requested_shell" "$COMPOSIO_BIN_DIR"
354
+ inline_shell_setup "$requested_shell" "$resolved_bin_dir"
355
shell_configured=fallback
356
fi
357
else
358
debug "falling back to inline $requested_shell shell setup"
359
- inline_shell_setup "$requested_shell" "$COMPOSIO_BIN_DIR"
359
+ inline_shell_setup "$requested_shell" "$resolved_bin_dir"
360
shell_configured=fallback
361
fi
362
test/install-sh-release-resolution.test.sh
+27
-2
@@ -554,7 +554,8 @@ EOF
554
variant_install="$case_root/variant-$shell_name-install"
555
variant_bin="$case_root/variant-$shell_name-bin"
556
variant_output=$(run_variant "$shell_name" "$variant_home" "$variant_install" "$variant_bin" "$stable_tag" --no-plugins 2>&1)
557
- grep -Fq "|installer|$variant_bin|install --shell $shell_name" "$composio_log" ||
557
+ expected_variant_bin=$(cd "$variant_bin" && pwd -P)
558
+ grep -Fq "|installer|$expected_variant_bin|install --shell $shell_name" "$composio_log" ||
559
fail "$interpreter_name $shell_name variant delegation"
560
assert_contains "$variant_output" "Configured $shell_name shell setup (cli)." "$interpreter_name $shell_name variant confirmation"
561
assert_not_contains "$variant_output" 'Required next step' "$interpreter_name $shell_name variant must not print setup guidance"
@@ -566,11 +567,35 @@ EOF
567
direct_home="$case_root/direct-shell-home"
568
direct_bin="$case_root/direct-shell-bin"
569
direct_output=$(run_installer "$direct_home" "$case_root/direct-shell-install" "$direct_bin" "$stable_tag" 2>&1)
569
- grep -Fq "|installer|$direct_bin|install --shell zsh" "$composio_log" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL delegation"
570
+ expected_direct_bin=$(cd "$direct_bin" && pwd -P)
571
+ grep -Fq "|installer|$expected_direct_bin|install --shell zsh" "$composio_log" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL delegation"
572
assert_contains "$direct_output" 'Configured zsh shell setup (cli).' "$interpreter_name COMPOSIO_INSTALL_SHELL confirmation"
573
assert_not_contains "$direct_output" 'Required next step' "$interpreter_name COMPOSIO_INSTALL_SHELL must not print setup guidance"
574
[[ ! -e "$direct_home/.zshrc" ]] || fail "$interpreter_name COMPOSIO_INSTALL_SHELL CLI path must not write rc files"
575
576
+ reset_case
577
+ CASE_INSTALL_SHELL=zsh
578
+ relative_work="$case_root/relative-shell-work"
579
+ relative_home="$case_root/relative-shell-home"
580
+ relative_install="$case_root/relative-shell-install"
581
+ mkdir -p "$relative_work"
582
+ (cd "$relative_work" && run_installer "$relative_home" "$relative_install" relative-bin "$stable_tag" >/dev/null 2>&1)
583
+ expected_relative_bin=$(cd "$relative_work/relative-bin" && pwd -P)
584
+ grep -Fq "|installer|$expected_relative_bin|install --shell zsh" "$composio_log" ||
585
+ fail "$interpreter_name relative COMPOSIO_BIN_DIR delegation must receive the resolved absolute path"
586
+
587
+ reset_case
588
+ CASE_INSTALL_SHELL=zsh
589
+ CASE_SHELL_CAPABILITY=unsupported
590
+ relative_fallback_work="$case_root/relative-fallback-work"
591
+ relative_fallback_home="$case_root/relative-fallback-home"
592
+ relative_fallback_install="$case_root/relative-fallback-install"
593
+ mkdir -p "$relative_fallback_work"
594
+ (cd "$relative_fallback_work" && run_installer "$relative_fallback_home" "$relative_fallback_install" relative-bin "$stable_tag" >/dev/null 2>&1)
595
+ expected_relative_fallback_bin=$(cd "$relative_fallback_work/relative-bin" && pwd -P)
596
+ grep -Fq "export PATH=\"$expected_relative_fallback_bin:\$PATH\"" "$relative_fallback_home/.zshrc" ||
597
+ fail "$interpreter_name relative COMPOSIO_BIN_DIR fallback must persist the resolved absolute path"
598
+
599
reset_case
600
CASE_INSTALL_SHELL=zsh
601
CASE_SHELL_CAPABILITY=unsupported