On polymarket-fetch bot boot, the bot sends a best-effort Telegram message announcing it started, embedding the short commit hash so the operator can confirm which build is live. A new build.rs captures that hash at compile time. Shipped 2026-06-04.
For Agents
- Message:
NA CSUMI CSUMI CSUMI, bot STARTED, REF: <short-sha>(theREF:segment is omitted entirely when no hash is available).- Bot-only — the
scheduled-runpath is untouched.notifier::startup_messagesends it;notifier::build_startup_messageis the pure message-builder (testable, no I/O).- Hash is baked at build time by
crates/polymarket-fetch/build.rs.
The startup ping
When the bot subcommand boots it fires a best-effort Telegram message:
NA CSUMI CSUMI CSUMI, bot STARTED, REF: <short-sha>
If no commit hash was captured at build time, the REF: segment is dropped and the message is just NA CSUMI CSUMI CSUMI, bot STARTED. build_startup_message is pure (takes the optional hash, returns the string) so the omit-when-empty logic is unit-testable.
build.rs SHA capture
A new crates/polymarket-fetch/build.rs resolves the short commit hash at build time, trying each source in order until one yields a value:
- env
BUILD_GIT_HASH - env
GIT_HASH - env
GITHUB_SHA git rev-parse --short HEAD- else empty →
REFomitted
Deploy gotcha
Docker images built without
.gitand without a build-arg report NO shaThe fallback
git rev-parse --short HEADonly works if.gitis present in the build context. A typical slim Docker build copies source without.git, so unless you pass one ofBUILD_GIT_HASH/GIT_HASH/GITHUB_SHAas an env/build-arg, the deployed bot will boot with an empty hash → noREF:in the startup ping.Fix for deploy: pass
GIT_HASHorGITHUB_SHAat image build soREFis populated. The CI release workflow already hasGITHUB_SHAavailable — thread it through as a build-arg. See polymarket-fetch-deploy.
Related
- pmv2-exit-alerts — shipped the same session
- polymarket-fetch-deploy — where the build-arg needs to be threaded so REF populates in prod
- bot-pmv2-native-v1-consensus-deleted — the bot surface this ping joins on boot
- polymarket-fetch