fix: review feedback — credentials, cross-platform paths, runtime deps - #1
Open
antianqi wants to merge 1 commit into
Open
fix: review feedback — credentials, cross-platform paths, runtime deps#1antianqi wants to merge 1 commit into
antianqi wants to merge 1 commit into
Conversation
Addresses three review issues from 老板:
1. Credentials: removed read_token_from_server source-scraping; ACP_TOKEN is
now required (no default); server refuses to start without it; client raises
ACPTokenMissing; peer prompt template reads token from env var only; startup
banner prints token length, never the value.
2. Portability: introduced acp_paths.py as single source of truth for all
filesystem locations; removed all D:\\openclaw-acp and %USERPROFILE%\\.openclaw
hardcoding; default ACP_HOME=~/.openclaw-acp on every platform; added
Supported Platforms section to INSTALL.md (Win/macOS/Linux).
3. Runtime deps: pinned websockets>=16.0,<17; added docs/RUNTIME_DEPS.md with
full version contract; added tests/test_smoke.py (PR-reproducible, no Mavis
CLI required, <10s, all 47 checks passing).
Side fixes:
- _acp_default_db_path() ordering bug in acp_store / acp_inbox_store
- missing 'from pathlib import Path' in acp-server.py / acp_store.py /
acp_inbox_store.py
- removed print(f' Auth: {AUTH_TOKEN}') leak from server main()
- PITFALLS #9 marked RESOLVED (source-scraping was itself a credential leak)
Smoke test: 47/47 PASS (no D:/%USERPROFILE% literals; cross-platform
path resolution; server refuses empty ACP_TOKEN with exit 2; health +
auth + inbox roundtrip; token not in stdout).
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.
What
Addresses the 3 review comments from 老板 (2026-08-15):
Credentials disclosure contradiction — removed
read_token_from_server()(which scraped the token fromacp-server.pysource — itself a credential leak).ACP_TOKENis now required, no default value anywhere. Server refuses to start without it (exit 2 + stderr). Client raisesACPTokenMissingon construction. The peer prompt template now reads$ACP_TOKENfrom env at call time. Server startup banner prints onlylength=N, never the value.Portability claim was false — introduced
openclaw-skill/acp_paths.pyas the single source of truth for filesystem locations. Removed everyD:\\openclaw-acpand%USERPROFILE%\\.openclaw\\skills\\mavis-codinghardcoding. DefaultACP_HOME = ~/.openclaw-acpon every platform. macOS, Linux, and any Windows drive letter all work. INSTALL.md "Requirements" now lists the supported-platform matrix (Win 10/11, macOS 12+, Ubuntu 22.04+, Debian 12+, Fedora 38+, Python ≥3.10).External server/SDK was an undeclared runtime dependency — pinned
websockets>=16.0,<17inrequirements.txt. Documented Mavis Coding CLI subcommand contract in newdocs/RUNTIME_DEPS.md. Addedtests/test_smoke.py— PR-reproducible, no Mavis CLI required, runs in <10s, all 47 checks passing.Smoke test results
Reply to each review point
① 凭据披露互相矛盾
$ACP_TOKENenv var ONLY. No default, no source-code scraping, no runtime generation, no stdin input.Authorization: Bearer <token>header.?token=<token>query parameter (browser WebSocket APIs cannot set custom headers).length={len(AUTH_TOKEN)}.os.environ["ACP_TOKEN"]at request time.② 可移植性不成立
openclaw-skill/acp_paths.py(resolve_acp_home/resolve_openclaw_home/resolve_mcode_cmd/resolve_temp_dir/sessions_root).$ACP_HOMEoverrides the default; default~/.openclaw-acpon every platform..pyfiles; verified zeroD:\\openclaw-acp/%USERPROFILE%\\.openclaw/%USERPROFILE%\\AppDataliterals.③ 外部 server/SDK 是运行时依赖
requirements.txt:websockets>=16.0,<17(v16 introducedasyncio.serverAPI; v17+ may break).docs/RUNTIME_DEPS.md: full version contract — Python 3.10+, websockets 16.x, Mavis Coding CLI subcommand contract, mavis-coding skill relationship, complete env-var table.tests/test_smoke.py: PR-reproducible, 47/47 passing, does NOT require Mavis Coding CLI (uses temp DB + stub subprocess, <10s).Side fixes (encountered while testing)
_acp_default_db_path()was referenced before defined inacp_store.py/acp_inbox_store.py(NameError → server exit 1). Reordered; also added missingfrom pathlib import Path.from pathlib import Pathmissing inacp-server.pytop.print(f' Auth: {AUTH_TOKEN}')from servermain()(token leak).Files changed
14 files changed, +1200 / -396