Retrospective: expose management version headers and normalize local build metadata#2948
Retrospective: expose management version headers and normalize local build metadata#2948luyuehm wants to merge 14 commits into
Conversation
|
This pull request targeted The base branch has been automatically changed to |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b8c74f78a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - "11451:11451" | ||
| volumes: | ||
| - ${CLI_PROXY_CONFIG_PATH:-./config.yaml}:/CLIProxyAPI/config.yaml | ||
| - ${CLI_PROXY_CONFIG_PATH:-/Users/macbook/cli-proxy-config/config.yaml}:/CLIProxyAPI/config.yaml:rw |
There was a problem hiding this comment.
Revert machine-specific default config bind path
The new default bind mount uses /Users/macbook/cli-proxy-config/config.yaml, which breaks docker compose up for anyone who has not set CLI_PROXY_CONFIG_PATH and does not have that exact host path. In that case Docker either fails the mount or mounts an unexpected directory at /CLIProxyAPI/config.yaml, causing startup/config read failures; the previous ./config.yaml default was portable across environments.
Useful? React with 👍 / 👎.
| set -euo pipefail | ||
|
|
||
| HEALTH_URL="${CLI_PROXY_HEALTH_URL:-http://127.0.0.1:8317/health}" | ||
| SELF_HEAL_SCRIPT="${CLI_PROXY_SELF_HEAL_SCRIPT:-./scripts/self_heal_example.sh}" |
There was a problem hiding this comment.
Make self-heal path independent of current directory
The heartbeat script defaults CLI_PROXY_SELF_HEAL_SCRIPT to ./scripts/self_heal_example.sh, which is resolved against the caller’s working directory, not this script’s directory. This fails when running as documented via an absolute script path in cron or from any non-repo cwd, so self-heal is skipped even though the companion script exists.
Useful? React with 👍 / 👎.
|
Retrospective note:
|
There was a problem hiding this comment.
Code Review
This pull request introduces an OpenClaw-compatible autonomy layer, featuring comprehensive documentation, utility scripts for health monitoring and self-healing, and integration guides for local operations. It also updates the CORS middleware to expose versioning headers. The review feedback highlights a portability issue regarding a hardcoded absolute path in the Docker Compose configuration and suggests improving the self-healing script's effectiveness by using a restart command instead of a conditional up command.
| - "11451:11451" | ||
| volumes: | ||
| - ${CLI_PROXY_CONFIG_PATH:-./config.yaml}:/CLIProxyAPI/config.yaml | ||
| - ${CLI_PROXY_CONFIG_PATH:-/Users/macbook/cli-proxy-config/config.yaml}:/CLIProxyAPI/config.yaml:rw |
| SERVICE_NAME="${CLI_PROXY_SERVICE_NAME:-cli-proxy-api}" | ||
|
|
||
| $COMPOSE_CMD ps "$SERVICE_NAME" >/dev/null 2>&1 || true | ||
| $COMPOSE_CMD up -d "$SERVICE_NAME" |
|
Release linkage:
|
luispater
left a comment
There was a problem hiding this comment.
Summary:
This PR introduces an OpenClaw “autonomy layer” (docs + example scripts) and updates CORS to expose build/version headers so browser clients can read X-CPA-* management headers.
Blocking:
docker-compose.ymlnow defaultsCLI_PROXY_CONFIG_PATHto/Users/macbook/cli-proxy-config/config.yaml. That is a machine-specific path and will break the default compose experience for most users. Please restore a repo-local default (e.g../config.yaml) and keep migration-specific paths inLOCAL_OPERATIONS.mdor a local override file.- Several docs/READMEs are phrased as “This fork …” and hardcode fork-specific repos (
luyuehm/...). Sincerouter-for-me/CLIProxyAPIis not a fork, this is misleading for upstream. Please reword to be repo-agnostic and/or point to the canonical upstream repo, not a personal fork. openclaw/MIGRATION_FROM_CLIPROXYAPIPLUS.mdhardcodes/Users/macbook/...paths (including OpenClaw workspace script paths). Please replace these with placeholders (e.g./path/to/...) and/or environment variables.
Non-blocking:
- Consider aligning
Access-Control-Expose-Headersvalues with the actual management header names (X-CPA-VERSION,X-CPA-BUILD-DATE,X-CPA-COMMIT) for readability. - Translate the remaining English sentence in
README_CN.md’s OpenClaw section to keep the Chinese README consistent. - Optional: add a small safety guard in
scripts/install_openclaw_skill.shto ensure the computed target is sane beforerm -rf.
Test plan:
- Not run locally (review-only; no checkout).
- Suggested validation after fixes:
go build -o test-output ./cmd/server && rm test-outputdocker compose config(with no env overrides) to ensure defaults work- Verify a management response includes
X-CPA-*headers and that responses includeAccess-Control-Expose-Headers: ...so browsers can read them.
Summary
This is a retrospective PR submitted to the upstream repository to document and review backend release-governance changes that were already validated downstream and released as
v2026.04.21.What changed
Browser-readable version headers
Exposed management response headers for browser clients:
X-Cpa-VersionX-Cpa-Build-DateX-Cpa-CommitLocal compose rebuild metadata normalization
Prevented local
docker compose up -d --buildfrom falling back to:devunknownnoneLocal runtime version naming normalization
vYYYY.MM.DDvYYYY.MM.DD-betaValidation
X-Cpa-Version: v2026.04.21X-Cpa-Build-Date: normal UTC timestampX-Cpa-Commit: current short commitSuggested labels