Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs(cli): state installer design constraints inline instead of KD tags

jkomyno2655e30c70b0
diff --git a/install.sh b/install.sh
index c7ea46082..0d853e8d0 100755
--- a/install.sh
+++ b/install.sh
@@ -322,7 +322,9 @@ shell_quote() {
}
# Follows symlinks and resolves the parent directory physically, so two paths
-# compare equal exactly when they name the same executable (KD3).
+# compare equal exactly when they name the same executable: the final block's
+# installed-vs-shadowed verdict must not change just because one side reaches
+# the binary through a symlink alias.
resolve_physical_path() {
resolve_physical_target=$1
resolve_physical_steps=0
@@ -605,9 +607,10 @@ setup_requested_shell() {
return 1
}
-# Final action block for every non-failure flow (KD4 state matrix). KD7: this
-# is the last output; nothing prints after it. Suppressible because it only
-# covers normal success.
+# Final action block for every non-failure flow: one truthful ending chosen
+# from the inherited-resolution and setup-outcome state. It must be the last
+# output — the closing block is the instruction users copy, so nothing may
+# print after it. Suppressible because it only covers normal success.
print_post_install_help() {
[ "${COMPOSIO_INSTALL_HELP:-1}" != 0 ] || return 0
if is_true "${COMPOSIO_QUIET:-}"; then
diff --git a/test/install-sh-release-resolution.test.sh b/test/install-sh-release-resolution.test.sh
index 9a6614761..18119ecd3 100755
--- a/test/install-sh-release-resolution.test.sh
+++ b/test/install-sh-release-resolution.test.sh
@@ -30,7 +30,8 @@ assert_not_contains() {
}
# Asserts the exact final N lines of an output capture, proving nothing prints
-# after the final action block (KD7: the last block wins).
+# after the final action block: the ending is the instruction users copy, so
+# the last block must win.
assert_tail() {
local haystack=$1
local expected=$2
@@ -156,7 +157,8 @@ github_url='https://github.example.test'
archive_url="https://downloads.example.test/$stable_tag/$archive_name"
script_url='https://installer.example.test/install.sh'
-# KD4 exact endings: plain indented lines, no box drawing, nothing after them.
+# Exact endings the installer must close with: plain indented lines, no box
+# drawing, nothing after them, so the final instruction stays copy-paste safe.
case_a_tail=$'composio is ready.\n\n composio login'
case_b_tail=$'Open a new terminal, then run:\n\n composio login'
@@ -815,7 +817,7 @@ EOF
[[ ! -e "$base_failure_home/.zshrc" ]] || fail "$interpreter_name $base_mode download must not write rc"
done
- # --- Auto shell setup default (KD2/KD3) ---
+ # --- Auto shell setup default: $SHELL picks the shell, setup delegates to the CLI ---
# Every recognized default-flow shell delegates through the setup chain.
for auto_shell in zsh bash fish; do
@@ -1001,7 +1003,7 @@ EOF
assert_contains "$bash_login_only_output" 'Configured bash shell setup in ~/.bashrc and ~/.bash_login.' "$interpreter_name .bash_login disclosure"
assert_login_bash_path "$bash_login_only_home" "$bash_login_only_bin" "$interpreter_name .bash_login login shell"
- # --- Setup write failures stay non-fatal (KD3/KD4) ---
+ # --- Setup write failures stay non-fatal: the binary stays installed and the ending stays truthful ---
# Delegated path: CLI --shell fails, inline fallback also fails.
reset_case
@@ -1029,7 +1031,7 @@ EOF
assert_contains "$wf_inline_output" 'warning: Automatic PATH setup for bash failed' "$interpreter_name inline setup failure warning"
assert_tail "$wf_inline_output" $'To get started, run:\n\n '"$wf_inline_install/composio login" "$interpreter_name inline setup failure recovery tail"
- # --- Managed-block reconciliation (KD3) ---
+ # --- Managed-block reconciliation: a rerun replaces stale blocks instead of stacking duplicates ---
reset_case
CASE_SHELL_CAPABILITY=unsupported
@@ -1145,7 +1147,7 @@ export PATH=\"$malformed_bin:\$PATH\"" ]] || fail "$interpreter_name malformed b
grep -Fq 'alias stale-guard=1' "$stale_home/.zshrc" || fail "$interpreter_name stale reconcile preserves unmanaged content"
assert_tail "$stale_output" "$case_b_tail" "$interpreter_name stale delegation Case B tail"
- # --- Unsafe resolved bin dirs under the default flow (KD3) ---
+ # --- Unsafe resolved bin dirs under the default flow: shell metacharacters never reach rc files ---
unsafe_auto_index=0
for unsafe_character in ';' '$'; do
@@ -1183,7 +1185,7 @@ export PATH=\"$malformed_bin:\$PATH\"" ]] || fail "$interpreter_name malformed b
fail "$interpreter_name spaced recovery command must execute when pasted"
[[ $space_paste_output == 'composio fake 98.0.0' ]] || fail "$interpreter_name spaced recovery command output"
- # --- Final-block contract combinations (KD4/KD7) ---
+ # --- Final-block contract combinations: exactly one truthful ending, always last ---
# Plugin output completes before the final block.
reset_case
diff --git a/ts/packages/cli/src/commands/install.cmd.ts b/ts/packages/cli/src/commands/install.cmd.ts
index 4aaeb8ba4..6f88322b6 100644
--- a/ts/packages/cli/src/commands/install.cmd.ts
+++ b/ts/packages/cli/src/commands/install.cmd.ts
@@ -631,10 +631,11 @@ export const installShellIntegration = (params: {
return yield* new ShellSetupAbortError({ message });
}
- // KD7 (final-block contract): when install.sh delegates to this command it
- // passes COMPOSIO_CLI_INVOCATION_ORIGIN=installer and owns the final action
- // block itself. Keep the concise per-file status lines but suppress the
- // boxed restart hint so the CLI never prints a competing instruction.
+ // The installer owns the closing message: when install.sh delegates to
+ // this command it passes COMPOSIO_CLI_INVOCATION_ORIGIN=installer and
+ // prints the final action block itself. Keep the concise per-file status
+ // lines but suppress the boxed restart hint so the CLI never prints a
+ // competing instruction.
const invocationOrigin = yield* readOptionalEnv('COMPOSIO_CLI_INVOCATION_ORIGIN');
const installerOwnsFinalMessaging = invocationOrigin === 'installer';