Skip to content

Commit 6a9a706

Browse files
committed
fix(setup): follow configured marketplace
1 parent b223103 commit 6a9a706

4 files changed

Lines changed: 35 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ cd <MARKETPLACE_ROOT>
6767
./gestalt-setup.sh
6868
```
6969

70+
You may also run `gestalt-setup.sh` from a development checkout. If Codex has a
71+
different marketplace snapshot configured, the script continues from that
72+
snapshot automatically and preserves its arguments.
73+
7074
The script defaults `CODEX_HOME` to `~/.codex-gestalt`, installs both plugins,
7175
prepares context-mode, generates `org-plan-reviewer` and `org-plan-executor`,
7276
and removes the retired `org-plan-supervisor`. It does not create, validate, or

USAGE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ cd <MARKETPLACE_ROOT>
1818
./gestalt-setup.sh
1919
```
2020

21+
When setup is launched from another checkout, it automatically continues from
22+
the marketplace snapshot configured in `~/.codex-gestalt`.
23+
2124
Marketplace installation does not run the setup script automatically. The
2225
script installs both plugins, prepares the exact installed context-mode cache,
2326
verifies its artifact manifest, generates the reviewer and executor profiles,

gestalt-setup.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ script_dir=$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
66
marketplace_file="$script_dir/.agents/plugins/marketplace.json"
77
context_source="$script_dir/plugins/context-mode"
88
org_plan="$script_dir/plugins/gestalt/skills/org-plan/scripts/org-plan"
9+
setup_args=("$@")
910
prepare_only=false
1011
force=false
1112
dry_run=false
@@ -117,7 +118,11 @@ else
117118
configured_root=$(CDPATH='' cd -- "$configured_root" 2>/dev/null && pwd -P) ||
118119
die "configured marketplace root is unreadable: $configured_root"
119120
if [[ $configured_root != "$script_dir" ]]; then
120-
die "marketplace '$marketplace_name' points to $configured_root; run $configured_root/gestalt-setup.sh instead"
121+
configured_setup="$configured_root/gestalt-setup.sh"
122+
[[ -f $configured_setup ]] ||
123+
die "configured marketplace setup script is missing: $configured_setup"
124+
printf 'gestalt-setup: continuing from configured marketplace %s\n' "$configured_root"
125+
exec bash "$configured_setup" "${setup_args[@]}"
121126
fi
122127
else
123128
run codex plugin marketplace add "$script_dir"

tests/repository/test-gestalt-setup.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,26 @@ output=$(env -u CODEX_HOME HOME="$tmp" bash "$script" --dry-run)
2020
[[ $output == *"org-plan-supervisor.toml"* ]]
2121
[[ ! -e $tmp/.codex-gestalt ]]
2222

23+
configured="$tmp/configured marketplace"
24+
mkdir -p "$configured" "$tmp/bin"
25+
cat >"$configured/gestalt-setup.sh" <<'SH'
26+
#!/usr/bin/env bash
27+
printf 'delegated home=%s args=' "$CODEX_HOME"
28+
printf '<%s>' "$@"
29+
printf '\n'
30+
SH
31+
cat >"$tmp/bin/codex" <<SH
32+
#!/usr/bin/env bash
33+
if [[ \$* == 'plugin marketplace list' ]]; then
34+
printf 'Marketplace Path\n'
35+
printf 'dyne-gestalt-agents %s\n' '$configured'
36+
exit 0
37+
fi
38+
exit 99
39+
SH
40+
chmod +x "$configured/gestalt-setup.sh" "$tmp/bin/codex"
41+
delegated=$(CODEX_HOME="$tmp/delegated-home" PATH="$tmp/bin:$PATH" bash "$script" --force)
42+
[[ $delegated == *"continuing from configured marketplace $configured"* ]]
43+
[[ $delegated == *"delegated home=$tmp/delegated-home args=<--force>"* ]]
44+
2345
printf 'gestalt setup script is valid\n'

0 commit comments

Comments
 (0)