Commit Graph
10 Commits
Author SHA1 Message Date
ci-check e5cdb09921 merge: sync master into pi-inline-default branch (PR #5491 conflict resolution)
Conflicts resolved (both sides kept):
- CHANGELOG.md: pi-inline default-on entry (#5428) + watermark fastpath GA entry (#5403/#5418)
- tests/cli-parseargs.test.ts: #5428/#5491 posture-flag tests + #5606 informational-flag tests
- CONFIGURATION.md / CONFIGURATION.zh-CN.md: regenerated from merged yaml seeds via
  tools/gen-config-docs.mjs (keeps BILI_PERSONA_SPLIT row + new pi.inline default row)
2026-11-04 09:32:46 +08:00
ci-check 3e7726c783 fix: drop nonexistent 'pack' rows from cli-parseargs help-precedence tests 2026-11-03 19:00:57 +08:00
dajiaohuang 7af07a1738 fix: preserve CLI help and version before dispatch (#5606) 2026-11-03 18:14:11 +08:00
ci-check 25a5db739f fix: deliver -s/--server posture pins to the launched child (PR #5491 review)
parseArgs records the -s pin in overrides, but the launch path skips the
generic env merge the start/update lanes use, so BILI_PI_INLINE=0 never
reached the child: with an ambient BILI_PI_INLINE=1 (shell export, alias, or
a nested bili session), 'bili -s pi' still flipped onto the inline lane and
the launcher proxy idled — the exact case the flag documents defeating.
applyPosturePins mirrors the env merge for the two posture keys in
runLaunch/runTestPi; a regression test pins the parse-to-env delivery.
2026-11-02 02:19:41 +08:00
ci-check 6065f3eeee test: pin -i/-s misuse messages in cli-parseargs (PR #5491 review nit)
The misuse test asserted exit code 2 but its per-case message regexes
were never matched against anything (assert.ok(re) is always true).
Capture console.error and assert.match each case's actual message.
2026-11-02 02:02:28 +08:00
ranxianglei a61765b217 cli: -i/--inline and -s/--server posture flags (#5428)
Human surface for the inline default: nobody types BILI_PI_INLINE=0.

  bili -i pi   == bili pi-inline (forced inline: env scrub + extension
                 preflight + BILI_PI_INLINE=1 preset, no proxy spawned)
  bili -s pi    proxy posture pinned: child gets BILI_PI_INLINE=0 so an
                 inherited/ambient inline env can't flip it while the
                 launcher proxy runs

Flags must PRECEDE the client name (everything after the client token
is forwarded verbatim — bili pi -i stays pi's own flag). opencode maps
the same way (-i -> opencode-inline, -s -> BILI_OPENCODE_INLINE=0).
Misuse exits 2 with a pointed message: other lanes, -s on the inline
lane, -i+-s together, or a posture without a client.
2026-11-02 01:36:10 +08:00
awork bc1b3c8145 fix(#3496 review): quote YAML-alias-leading specs in lockfile writes; pin zero-writes by mtime; cover doctor --fix flag parse 2026-10-17 20:34:05 +08:00
ework-agent c6d2cf0e16 feat: bili doctor — one-command audit of every install lane's version, owner, and freshness (#1235) 2026-09-26 08:24:18 +08:00
ework-agent 299e4eb732 feat: bili acp-cache diff — prefix-diff attribution over ACP_DUMP_BODY dumps (#1266)
New read-only diagnostic command 'bili acp-cache diff <dump-dir>': pairs
adjacent same-session requests from ACP_DUMP_BODY dumps (INCOMING = client
wire, REQ = proxy-rebuilt wire) and classifies each pair:

- pure-append         prefix stable, growth only at the tail (healthy)
- mid-stream-rewrite  first divergent byte inside the shared prefix; reports
                      byte offset + first divergent message and attributes
                      proxy vs client vs both by comparing where each side's
                      wire first diverged (#1249 shape = incoming append +
                      outgoing mid drift -> proxy)
- prefix-stable-miss  outgoing prefix append but provider usage shows the
                      cached prefix collapsed (--log / bili.log correlation;
                      upstream TTL/eviction, the unattributed bucket of
                      acp-kernel#393)

Comparison is two-tier: byte-prefix first, then JSON message-array-aware so
a healthy array append (which moves the closing bracket) is not misread as a
mid-stream rewrite. Output: per-pair lines + worst offenders; --json emits
the machine-readable report. --log FILE / --no-log control usage-log
correlation (default auto-discovers <dump-dir>/bili.log or defaultLogFile()).

Prerequisite fix in the same issue scope: INCOMING dump filenames now carry
the bound session id (<ts>-<sid>-INCOMING.txt; OUTGOING already had it) so
concurrent sessions can be paired; the dump moves from the pre-prepare site
to right after prepare, where the session is bound. Requests rejected before
prepare no longer get an INCOMING dump (they never got a REQ dump either);
legacy session-less INCOMING dumps still parse via timestamp proximity.

Tests: synthetic dump pairs for all three shapes + legacy filenames + usage
alignment + render modes (tests/acp-cache-diff.test.ts), parseArgs cases,
and a full-proxy harness test pinning the new INCOMING filename.

Behavior changes (disclosed):
1. INCOMING body-dump filename: <ts>-INCOMING.txt -> <ts>-<sid>-INCOMING.txt.
   Any external tooling keying on the old shape must adapt (none in-repo does;
   DUMP_FILE_RE regexes still match).
2. INCOMING dumps now written post-prepare instead of pre-prepare (content and
   masking unchanged); pre-prepare rejections (bypass/passthrough/unknown
   paths) no longer produce INCOMING dumps.
2026-09-25 23:43:11 +08:00
ranxianglei 5e35adbf1f fix: default upstream proxy to direct; add gost-style -F forward flag (#346)
- Unset upstreamProxyMode now resolves to "direct" (matches the web UI's
  直连(默认) and ZCode's default) instead of falling through to env/system
  proxy auto-detection. Set mode "auto" to follow the system/env proxy; an
  explicit proxy (-F / BILI_UPSTREAM_PROXY / config) still wins regardless.
- Add `-F <url>` (gost-style --forward) to set the upstream proxy for a run;
  works for launcher cmds (before the client name) and `start`. HTTP/HTTPS
  only for now (SOCKS5 is a follow-up).
- Log the resolved upstream-proxy decision once per unique (host, proxy,
  source) — `[upstream-proxy] <host> via <proxy> (source=<source>)` — with
  non-public hosts masked (#255), so a silently-picked env proxy is visible.
- Fix the misleading `bili pi --mitm-domain ...` help example (that form
  forwarded the flag to the client; the working form is `bili --mitm-domain ... pi`).

Tests: default-direct (unset mode ignores HTTPS_PROXY), auto-mode opt-in
still follows the env proxy, and parseArgs -F placement (before/after client,
start cmd, composition).
2026-08-30 22:05:26 +08:00