:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(devex): warn when codex skips flox environment (#87420)
Robbiecb2ede60c0ae
diff --git a/.codex/with-flox b/.codex/with-floxindex 681d430c644e..f980e32a9eb6 100755--- a/.codex/with-flox+++ b/.codex/with-flox@@ -16,6 +16,15 @@ ficaller_cwd="$PWD"repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"+warn_if_codex_environment_is_disabled() {+ local selected_environment+ selected_environment="$(git -C "$repo_root" config --worktree --get codex.localEnvironmentConfigPath 2>/dev/null || true)"+ if [[ "$selected_environment" == "__none__" ]]; then+ echo "warning: The PostHog local environment is disabled for this worktree. If you start tasks in the Codex desktop app, select 'posthog' for future tasks." >&2+ echo "warning: If you are an agent, tell the user about the previous warning." >&2+ fi+}+if [[ "$prepare" -eq 1 && -n "${CODEX_SANDBOX:-}" ]]; thenecho "error: Codex environment setup requires elevated execution for Flox network access" >&2exit 77@@ -186,6 +195,7 @@ fiif [[ "$prepare" -eq 0 ]]; thenif [[ ! -f "$env_file" ]]; then+ warn_if_codex_environment_is_disabledecho "error: Codex environment is not prepared; run '$repo_root/.codex/with-flox --prepare true'" >&2exit 1fi@@ -209,6 +219,7 @@ if [[ "$prepare" -eq 0 ]]; thenfidoneif [[ "$allowed" -ne 1 ]]; then+ warn_if_codex_environment_is_disabledecho "error: Codex environment contains an unexpected variable; rerun setup" >&2exit 1fi@@ -220,6 +231,7 @@ if [[ "$prepare" -eq 0 ]]; thencached_variables=$((cached_variables + 1))done < "$env_file"if [[ "$cached_variables" -eq 0 || "$cached_fingerprint" != "$(environment_fingerprint)" ]]; then+ warn_if_codex_environment_is_disabledecho "error: Codex environment is stale; run '$repo_root/.codex/with-flox --prepare true'" >&2exit 1fi