Repository navigation
fix(skills): empty-string env vars fall back to "unknown" in /skills/bundled envelope - #48
Merged
Merged
Conversation
PR #47 introduced `OPENCLAW_IMAGE_TAG` / `OPENCLAW_IMAGE_SHA` / `OPENCLAW_SOURCE_SHA` build args, but used `?? "unknown"` for the runtime read. The Dockerfile declares these as `ARG ... = ""`, so an unset --build-arg comes through at runtime as an empty string (not undefined) — and `??` only triggers on null/undefined, leaving the gateway envelope with `"imageTag": ""` etc. Adds a `buildEnvOr(name, fallback)` helper that treats undefined, null, and "" as missing, and uses it for all three fields. Also adds test (a2) asserting empty-string env vars produce "unknown" in the envelope. Also documents (inline comment + STATUS.md note) why `imageSha` specifically will remain "unknown" until Phase 3 of the canonical skill registry plan — the Artifact Registry digest isn't known inside a single-pass `docker build`, so we can't bake it in via --build-arg. Release-record join (plan §8) will populate it post-push. STATUS.md records the corresponding ops change applied on DevAgents to /opt/openclaw-ops/scripts/build-and-push.sh — it now passes the new build args (TAG + SOURCE_SHA), with backup file alongside. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Owner
Author
|
Codex review of PR #48 ( Confirmed:
Validation run on DevAgents in a disposable clone at
CI note: Ready to merge from review side. |
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.
Small follow-up to PR #47 — addresses the
OPENCLAW_IMAGE_SHAnuance Codex flagged in re-review and a related empty-string fallback bug.The bug
PR #47 added
OPENCLAW_IMAGE_TAG/OPENCLAW_IMAGE_SHA/OPENCLAW_SOURCE_SHAto the runtime envelope usingprocess.env.X ?? "unknown". The Dockerfile declares these asARG ... = "", so when a--build-argis unset, the resulting runtime env var is an empty string, not undefined.??only triggers on null/undefined, so the envelope would have returned"imageTag": ""instead of"unknown"— confusing rather than useful.The fix
buildEnvOr(name, fallback)helper that treatsundefined,null, and""as missing.buildEnvelopewith the helper.(a2)asserting empty-string env produces"unknown".imageShanuance (documented inline)Per Codex's re-review: the Artifact Registry digest is not known inside a single-pass
docker build— it's produced bydocker pushafterward. SoOPENCLAW_IMAGE_SHAcannot be baked in via--build-arg. The route'sbuildEnvelopenow has a comment explaining this; the field will stay"unknown"until Phase 3's release-record join (canonical-skill-registry plan §8) populates it from the post-push output.The DevAgents build script (
/opt/openclaw-ops/scripts/build-and-push.sh) was patched today to pass the two args that CAN be baked in (OPENCLAW_IMAGE_TAG,OPENCLAW_SOURCE_SHA) — recorded in STATUS.md.Validation
Test plan
🤖 Generated with Claude Code