Repository navigation
feat(#535): zero-file injection phases 2+3 — absolute-form forward proxy, hermes/dsh env routing - #537
feat(#535): zero-file injection phases 2+3 — absolute-form forward proxy, hermes/dsh env routing#537ranxianglei wants to merge 3 commits into
Conversation
…ipeline Standard HTTP forward-proxy request lines (POST http://host/path) are now routed by resolveUpstream with the same semantics as the /bili/ path form: full compression pipeline plus #409 destination admission (tunnel: true), which also rejects self/link-local targets. Previously an absolute-form request forwarded raw with no pipeline. This unlocks env-based proxying for clients whose HTTP stack honors HTTP_PROXY (hermes's httpx).
…ocumented exceptions - server: absolute-form http request lines ride the full pipeline with #409 destination admission (previous commit) - hermes: no more HERMES_HOME overlay — https upstreams MITM-whitelisted via HTTPS_PROXY + HERMES_CA_BUNDLE (combined-ca.pem), plaintext-http upstreams via HTTP_PROXY absolute-form; NO_PROXY loopback-sanitized in the child env; session-identity plugin installed idempotently into the REAL ~/.hermes/plugins (coexists with user plugins) - dsh: split by destination — non-loopback https MITM-whitelisted, non-loopback plaintext-http via HTTP_PROXY, built-in deepseek route captured by whitelisting api.deepseek.com (no DEEPSEEK_BASE_URL clobbering); loopback destinations keep the settings.yaml overlay rewrite (dsh bypasses proxies for localhost unconditionally) - DiscoveredRoutes += httpEnvRoutes/providerKeys; new exported helpers isLoopbackHost/stripLoopbackNoProxy - prepareHermesHome deleted; writeHermesIdentityPlugin now targets the real home
… > generated files hermes/dsh one-liners, per-client redirect table, discovery table and temp-config bullets updated in EN+ZH; injection-priority note added next to 'Two compression modes'. pi/omp doc lines intentionally left to PR #536.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-537Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr537.tgz
npm install -g packageThis comment is automatically updated on each push. |
[bot] 🏷 Review of PR #537 complete — LGTM (non-blocking findings only). Pre-flight re-verified on
Merge-ordering check: current master is exactly Security review highlights (commit
Findings (minor, non-blocking):
E2E caveat: I could not run Not merging — human-only. Ready for merge after #536 lands. |
|
Superseded by PR #538 (hermes/omp file-free routing), which the owner has designated as the vehicle for phases 2+3. This PR’s absolute-form + hermes hunks overlap #538 in src/server.ts / src/launcher.ts / tests/launcher.test.ts and would conflict on merge. Its remaining unique content — the dsh destination-split (loopback exception, api.deepseek.com MITM whitelist instead of DEEPSEEK_BASE_URL clobbering, full test coverage) — stays available on branch 2026-09-04_zero-file-injection as reference for the deferred phase 4. Closing to keep the merge path clean. |
What
Continues #535 (注入零文件化) after PR #536 (phase 1, pi). Three commits:
feat: absolute-form http forward-proxy requests ride the full pipeline(src/server.ts)resolveUpstreamnow recognizes standard forward-proxy request lines (POST http://host/path) and routes them exactly like the/bili/absolute-URL form: full compression pipeline +tunnel: true, so [SECURITY] /bili/<绝对URL> 零配置隧道无目标准入:可回环访问自家管理面、触达 link-local 元数据;0.0.0.0 部署下 LAN 可经 PUT 劫持全部流量凭据(架空自述的 loopback-only 防线) #409 destination admission applies (self/link-local denied, private per client locality). Malformed URLs fall through to passthrough. This is what lets hermes's httpx stack route plaintext-http upstreams through bili viaHTTP_PROXY.feat: hermes/dsh zero-file injection(src/launcher.ts + tests)prepareHermesHome/HERMES_HOMEoverlay deleted. https upstream hosts are MITM-whitelisted (HTTPS_PROXY+HERMES_CA_BUNDLE→combined-ca.pem, since httpx builds its own bundle from that env — combined keeps system roots for blind-tunnelled hosts); plaintext-http upstreams rideHTTP_PROXY(absolute-form). InheritedNO_PROXYis loopback-sanitized in the child env so local sglang still reaches bili. The session-identity plugin (会话身份不稳定:credential/upstream 维度导致长会话状态孤儿化(sessions 缺失) #286) is installed idempotently into the real~/.hermes/plugins/model-providers/bili-session-identity/(bili-owned subdir, coexists with user plugins; old skip-on-user-plugins guard removed).HTTP_PROXY; built-in deepseek route captured by whitelistingapi.deepseek.cominstead of clobbering$DEEPSEEK_BASE_URL. Loopback destinations keep the legacysettings.yamloverlay rewrite — documented exception: dsh bypasses proxies for localhost/127.0.0.1/::1 unconditionally (LOOPBACK_NO_PROXY, "the bypass is not optional"), so no env route exists there.isLoopbackHost,stripLoopbackNoProxy.DiscoveredRoutes+=httpEnvRoutes/providerKeys.x-bili-tunnelmarker assertion + self-destination 403 case.docs:EN+ZH launcher one-liners, redirect table, discovery table, temp-config bullets; injection-priority note (env > CLI/extension API > generated files) next to "Two compression modes".Deliberately NOT in this PR
reason/willRetrytoSessionBeforeCompactEvent(per issue; fix(launcher): merge omp overlay config.yml edits back into real home (#531) #533 also still open and touches that region).Ordering note
Best merged after #536 (doc hunks are adjacent but disjoint; code hunks don't overlap). Based on master fadfcdd.
Pre-flight
npm run typecheckcleannpm test: 1036/1037 — sole failure is the pre-existing sandbox-onlyresolveClientCommand: codex/claude resolve to themselves(sandbox has /usr/bin/codex), present on pristine masternpm run buildOK