diff --git a/architect/architect-run.sh b/architect/architect-run.sh index ff5caaa..d23b5b4 100755 --- a/architect/architect-run.sh +++ b/architect/architect-run.sh @@ -34,10 +34,11 @@ FACTORY_ROOT="$(dirname "$SCRIPT_DIR")" # Accept project config from argument; default to disinto export PROJECT_TOML="${1:-$FACTORY_ROOT/projects/disinto.toml}" +# Set override BEFORE sourcing env.sh so it survives any later re-source of +# env.sh from nested shells / claude -p tools (#762, #747) +export FORGE_TOKEN_OVERRIDE="${FORGE_ARCHITECT_TOKEN:-}" # shellcheck source=../lib/env.sh source "$FACTORY_ROOT/lib/env.sh" -# Override FORGE_TOKEN with architect-bot's token (#747) -FORGE_TOKEN="${FORGE_ARCHITECT_TOKEN:-${FORGE_TOKEN}}" # shellcheck source=../lib/formula-session.sh source "$FACTORY_ROOT/lib/formula-session.sh" # shellcheck source=../lib/worktree.sh diff --git a/gardener/gardener-run.sh b/gardener/gardener-run.sh index 9a7ad90..29036b6 100755 --- a/gardener/gardener-run.sh +++ b/gardener/gardener-run.sh @@ -26,10 +26,11 @@ FACTORY_ROOT="$(dirname "$SCRIPT_DIR")" # Accept project config from argument; default to disinto export PROJECT_TOML="${1:-$FACTORY_ROOT/projects/disinto.toml}" +# Set override BEFORE sourcing env.sh so it survives any later re-source of +# env.sh from nested shells / claude -p tools (#762, #747) +export FORGE_TOKEN_OVERRIDE="${FORGE_GARDENER_TOKEN:-}" # shellcheck source=../lib/env.sh source "$FACTORY_ROOT/lib/env.sh" -# Use gardener-bot's own Forgejo identity (#747) -FORGE_TOKEN="${FORGE_GARDENER_TOKEN:-${FORGE_TOKEN}}" # shellcheck source=../lib/formula-session.sh source "$FACTORY_ROOT/lib/formula-session.sh" # shellcheck source=../lib/worktree.sh diff --git a/planner/planner-run.sh b/planner/planner-run.sh index 227dd94..6c5bcb2 100755 --- a/planner/planner-run.sh +++ b/planner/planner-run.sh @@ -22,10 +22,11 @@ FACTORY_ROOT="$(dirname "$SCRIPT_DIR")" # Accept project config from argument; default to disinto (planner is disinto infrastructure) export PROJECT_TOML="${1:-$FACTORY_ROOT/projects/disinto.toml}" +# Set override BEFORE sourcing env.sh so it survives any later re-source of +# env.sh from nested shells / claude -p tools (#762, #747) +export FORGE_TOKEN_OVERRIDE="${FORGE_PLANNER_TOKEN:-}" # shellcheck source=../lib/env.sh source "$FACTORY_ROOT/lib/env.sh" -# Use planner-bot's own Forgejo identity (#747) -FORGE_TOKEN="${FORGE_PLANNER_TOKEN:-${FORGE_TOKEN}}" # shellcheck source=../lib/formula-session.sh source "$FACTORY_ROOT/lib/formula-session.sh" # shellcheck source=../lib/worktree.sh diff --git a/predictor/predictor-run.sh b/predictor/predictor-run.sh index 8400418..7c5d851 100755 --- a/predictor/predictor-run.sh +++ b/predictor/predictor-run.sh @@ -23,10 +23,11 @@ FACTORY_ROOT="$(dirname "$SCRIPT_DIR")" # Accept project config from argument; default to disinto export PROJECT_TOML="${1:-$FACTORY_ROOT/projects/disinto.toml}" +# Set override BEFORE sourcing env.sh so it survives any later re-source of +# env.sh from nested shells / claude -p tools (#762, #747) +export FORGE_TOKEN_OVERRIDE="${FORGE_PREDICTOR_TOKEN:-}" # shellcheck source=../lib/env.sh source "$FACTORY_ROOT/lib/env.sh" -# Use predictor-bot's own Forgejo identity (#747) -FORGE_TOKEN="${FORGE_PREDICTOR_TOKEN:-${FORGE_TOKEN}}" # shellcheck source=../lib/formula-session.sh source "$FACTORY_ROOT/lib/formula-session.sh" # shellcheck source=../lib/worktree.sh diff --git a/supervisor/supervisor-run.sh b/supervisor/supervisor-run.sh index b27293c..e04f328 100755 --- a/supervisor/supervisor-run.sh +++ b/supervisor/supervisor-run.sh @@ -25,10 +25,11 @@ FACTORY_ROOT="$(dirname "$SCRIPT_DIR")" # Accept project config from argument; default to disinto export PROJECT_TOML="${1:-$FACTORY_ROOT/projects/disinto.toml}" +# Set override BEFORE sourcing env.sh so it survives any later re-source of +# env.sh from nested shells / claude -p tools (#762, #747) +export FORGE_TOKEN_OVERRIDE="${FORGE_SUPERVISOR_TOKEN:-}" # shellcheck source=../lib/env.sh source "$FACTORY_ROOT/lib/env.sh" -# Use supervisor-bot's own Forgejo identity (#747) -FORGE_TOKEN="${FORGE_SUPERVISOR_TOKEN:-${FORGE_TOKEN}}" # shellcheck source=../lib/formula-session.sh source "$FACTORY_ROOT/lib/formula-session.sh" # shellcheck source=../lib/worktree.sh