Add SessionStart hook to provision Erlang/Elixir/SWI-Prolog in cloud sessions - #6
Merged
Merged
Conversation
…sessions Cloud sessions start from a bare Ubuntu VM with none of the toolchain mix.exs and mise.toml expect, so mix test could not run there. The hook installs Erlang and SWI-Prolog via apt (archive.ubuntu.com is on the default network allowlist), unpacks a precompiled Elixir release from a GitHub release asset (github.com is also allowlisted), and installs Hex + rebar3 by building them from source via GitHub rather than mix's usual local.hex/local.rebar, which hit builds.hex.pm — not allowlisted by default. It then runs mix deps.get/compile so the project is ready when Claude starts working. That step still needs repo.hex.pm reachable to fetch this project's actual dependencies (req, jason, bandit, ...); if the environment's network access doesn't include it, the hook logs what's missing and exits 0 rather than failing the session. No-op outside CLAUDE_CODE_REMOTE, so local dev (mise-managed toolchain per README.md) is untouched.
The session now starts immediately while the toolchain installs in the background, instead of blocking on the ~1 minute install. Trade-off: a tool call that runs before the hook finishes won't have elixir/mix/swipl on PATH or the project's deps compiled yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cloud sessions start from a bare Ubuntu VM with none of the toolchain mix.exs
and mise.toml expect, so mix test could not run there. The hook installs
Erlang and SWI-Prolog via apt (archive.ubuntu.com is on the default network
allowlist), unpacks a precompiled Elixir release from a GitHub release asset
(github.com is also allowlisted), and installs Hex + rebar3 by building them
from source via GitHub rather than mix's usual local.hex/local.rebar, which
hit builds.hex.pm — not allowlisted by default.
It then runs mix deps.get/compile so the project is ready when Claude starts
working. That step still needs repo.hex.pm reachable to fetch this project's
actual dependencies (req, jason, bandit, ...); if the environment's network
access doesn't include it, the hook logs what's missing and exits 0 rather
than failing the session.
No-op outside CLAUDE_CODE_REMOTE, so local dev (mise-managed toolchain per
README.md) is untouched.