Repository navigation
[PR] Added a one-click install feature for my plugin on the Codex side | [PR] 添加了codex端一键安装我插件功能 - #3176
[PR] Added a one-click install feature for my plugin on the Codex side | [PR] 添加了codex端一键安装我插件功能#3176El1mir wants to merge 29 commits into
Conversation
…vice Four faces written by `bili plugin install codex`: model route, [mcp_servers.bili], [[hooks.SessionStart]], and the bili skill. - src/codex-integration/*: hook/skill/route/status planners, each additive and ownership-scoped so a foreign entry (lean-ctx and friends) is never rewritten. - hooks.ts: the pre-write guard no longer mistakes Codex's own [hooks.state.'<config>:<stage>:<i>:<j>'] trust ledger for a malformed stage table. Matching a bare `hooks` prefix rejected the whole config, so the hook face was silently skipped on any config where a hook had ever been trusted — a self-closing deadlock, since that ledger only exists once Codex trusts us. - src/proxy-service/*: Windows (schtasks) and Linux (systemd --user) self-start backends behind one interface, so install starts the proxy and remove stops it. - Windows silence: the task action goes through wscript.exe + a hidden-mode .vbs launcher. <Hidden> only hides the Task Scheduler entry; a console-subsystem node.exe started under InteractiveToken still allocates a conhost window. The launcher waits (Run(cmd, 0, True)) so the task keeps owning the process, and uninstall reaps the recorded pid when /End cannot reach a reparented node.
Brings in 146 upstream commits. Conflicts in src/cli.ts, src/server/admin.ts and tests/codex-responses-ws.test.ts were formatting collisions: upstream reindented (tabs -> 4 spaces) across those files while adding real features (recordEngineBootstrap, memoryReport, buildSessionReportMd/Svg, bootReady). Resolution rule: take upstream wholesale, then re-apply only our genuine additions on top. - src/cli.ts: re-applied the `service` command (imports, Parsed type + serviceAction, parse branch, HELP line, execution block) and the codex dispatch through codexInstallWithService/codexRemoveWithService. - src/server/admin.ts: re-applied the isCodexClient import and the codexClient flag in sendStats. - tests/codex-responses-ws.test.ts: upstream only (our 7 test names are a strict subset of upstream's 9; our diff was pure reformatting). Typecheck delta from this resolution is zero. The 4 remaining isCompressTool errors are pre-existing on the fork tip itself (verified by typechecking a pristine worktree at 7f96abe); src/agent/pi-subagents.ts(11,93) was already failing before the merge.
|
ework接单 接冲突 同时创建一个对应issue |
(ai: vllm-qwen/qwen3.8-27b) 收到 owner 指示,ework-daemon 接单:接管冲突处理 + PR 清理,跟踪 issue 已建。 跟踪 issue:#3178(含待拍板清单与验收口径) 冲突处理方案:你的分支基于旧 master(7f96abe),与当前 master 冲突。我会把 master merge 进你的分支、解冲突后推到你的分支(你开了 allow edits);不走 rebase——那要重写你的 master 历史。 初审发现(详细结论稍后按八问回复):
我继续清理,完成后在本线程回结构化结论。 |
# Conflicts: # src/cache-ledger.ts
The branch diverged from master at 7f96abe and carried repo-wide whitespace-reformatted copies of files master advanced afterwards (ranxianglei#3063 egressTransportFields + WC-017 wire-contract entry, ranxianglei#2877 attachPolicy/attachUrl config surface, restart/instance/port-zone work, CHANGELOG/CONFIGURATION/TECHNICAL-NOTES updates). The merge kept the stale copies, so merging as-is would have reverted that work. Restore every such file verbatim from origin/master. None of these files carries any semantic edit from the branch (verified: zero ignore-whitespace footprint vs fork point). Part of ranxianglei#3176 (conflict takeover).
- Drop the repo-wide 4-space-to-tab reformat churn: touched core files (plugin-install, doctor, doctor test) restored to master layout with only the PR's own semantic edits reapplied. - Expand leading tabs back to 4 spaces in the new codex modules and their tests (repo style is 4-space; no formatter config). - Drop the unrelated .scratch/ .gitignore addition. - Keep the real wiring: bili service CLI family, codex install/ remove faces, bootstrap-hook build entry, admin stats field. Part of ranxianglei#3176 (conflict takeover, per owner directive).
- task-scheduler: checkedOptions used path.isAbsolute, which on
Linux rejects the Windows drive-letter paths the schtasks plans
(and their unit tests) legitimately use; accept POSIX,
drive-letter and UNC absolute forms.
- codex-integration-status test: the loopback/foreign-evidence
case expected 'configured' without ownership evidence, which
contradicts the deliberate record-strict policy asserted in
codex-route.test.ts ('a loopback-looking URL without ownership
evidence is foreign'). Give the case a CODEX_HOME fixture with
the sidecar route record (provider target), matching the setup
pattern of the neighboring passing test; the file also picks up
the 4-space style alignment.
Part of ranxianglei#3176 (review fixes found while aligning the PR).
Follow-up to the conflict takeover: master advanced (ranxianglei#3055 port-hop fixes, ranxianglei#3165 per-lane attach policy, ranxianglei#3072 codex WS egress fidelity) after the first merge. Conflicts confined to files the branch never semantically touched; resolved verbatim to origin/master.
(ai: vllm-qwen/qwen3.8-27b) @El1mir 感谢贡献!已按 @ranxianglei 指示完成冲突接管与 PR 清理,最新 head: 1. 是什么问题 2. 什么原因导致的 3. 影响范围与严重程度 4. 怎么修复的 5. 是否有回归问题 6. 是否破坏缓存 7. 是否改了设计方向 8. 是否引入了新的配置 结论:冲突已解、diff 收敛为 29 文件(+7781/−573,全部为功能内容)、本地定向验证全绿。剩余动作都在人这一侧:① 请在 GitHub 上对本 PR 点 Approve & pending checks(fork PR 需你批准后才跑 CI);② #3178 的方向确认;③ 人工合并。 |
(ai: vllm-qwen/qwen3.8-27b) 收到,三项指示均已完成(上方长回复为完整八问报告,此处确认状态):
当前卡在两个人工动作:① 请对本 PR 点 Approve & pending checks(fork PR 需批准后 CI 才跑);② #3178 里「常驻自启服务 + |
|
自启服务是一个最少调用的方案,源方案是启动codex时hook来启动bili,然后关闭时hook关闭bili服务。自启服务会直接挂载到全局静默,等待代理请求入站进行压缩 |
(ai: vllm-qwen/qwen3.8-27b) @El1mir 感谢说明设计动机。对照实现代码(src/proxy-service/service.ts)把两个方案摆一下——方向最终由 @ranxianglei 拍板,这里给出我的评估: Hook 方案(启动拉起/退出关闭)有三个固有可靠性问题:
常驻服务方案把这三个问题都消掉了:codex 只指向稳定的回环端口,压缩会话状态跨 codex 重启保持存活,不用每次重载。代价是一个常驻 Node 进程(几十 MB 量级内存)+ 一个永久回环监听器,对本地开发工具属可接受范围。 读代码核实到的关键事实:
结论:我的判断是常驻方案比 hook 方案更可靠,设计方向成立。合并前剩余三项(已列在 #3178):① owner 确认接受「常驻后台服务」这一产品形态(对本项目是新姿态,属产品决策);② CONFIGURATION.md en/zh 补 codex install/service 文档条目;③ Linux systemd --user 实测(你提到只测过 Windows)。 |
|
这个0外部服务是追求之一 看出来你审阅了代码并认为有不可靠之出 其他客户端都是这样玩的 如果codex也可以是最好的. 现在授权你接过这个分支以最严苛的方式进行重构 |
# Conflicts: # src/plugin-install.ts
Rebuild src/plugin-install.ts, src/doctor.ts and the CLIENTS docs on the current master base carrying ONLY the functional diff of the codex integration (multi-face install/remove/status, doctor sections); the whole-file prettier-style reformatting of pre-existing lines is reverted so every changed line relates to this feature (ranxianglei#3176). Labeled minor fixes included: - drop the unused pathToFileURL import (dead in master) - readKimiInstalledRegistry: report corrupt JSON with file path and cause instead of a bare SyntaxError
- decode runner output per platform (GBK on Windows schtasks, UTF-8 for systemctl): the hard-wired GBK label garbled Linux error text - report the real active state on the systemd already-installed path instead of a hard-coded "ready" - collapse the double record read in installSystemd - drop the systemdResult wrapper that only forwarded to describeFailure
- drop src/proxy-service/index.ts barrel: zero consumers import it - drop planTaskRegister flag-form planner (kept only for tests that asserted a shape production never uses; validation stays covered via renderTaskXml/renderTaskLauncherVbs) - drop unused CodexHookEntry/CodexHookStage types - toml-field: one parseTableHeader helper instead of three divergent inline header regexes; drop consumer-less replaceTable - route.ts: tabs to the repo 4-space style; status.ts: merge duplicate route.js imports
Import from service.ts directly (barrel deleted) and assert launcher command composition through renderTaskLauncherVbs, which exercises the same checkedOptions validation the removed planner used.
CLI Reference gains the `bili service <action>` row (en+zh) and the `bili plugin install codex` example now names the four managed faces plus the auto-start service instead of only the MCP block (ranxianglei#3176).
Delete three functions with zero consumers (route codexRouteFilePath / readCodexRouteFile, systemd planSystemdEnable) and strip the export modifier from module-internal types/helpers across the new codex integration and proxy-service modules. Behavior unchanged.
Add the SessionStart bootstrap-hook probe override (audience: test) to the env-only YAML seed and regenerate the config-docs blocks; add the matching detail-table row in both languages.
CI's test lanes run the TS sources without bundling, so the four-faces regression could not pass there: it hard-required dist/codex/bootstrap-hook.js. Materialize that single presence-checked file when absent and remove exactly what the test created, keeping the sibling skip-behavior test honest.
(ai: vllm-qwen/qwen3.8-27b) 按你的授权接过了分支,严格重构完成。当前 head 做了什么(每个 commit 独立可审)
结构化八问
剩余红灯(#3209,非本 PR diff 引起):4 个测试分片(ubuntu/windows × node22/24 的 shard 3)在两次完整运行 + 一次 rerun 中整片红,失败的全是 master 自有固定端口套件(auto-restart / claude-native / port-zone-live / plugin-bypass)。根因:runner 按测试文件行数做 LPT 装箱,本 PR 新增约 1500 行测试改变了装箱结果,把三个占固定端口的套件集中进了同一片,concurrency=4 下互踩端口;master 上它们恰好分布在三个分片(分离是装箱运气,不是调度保证)。证据:分区模拟对照表 + CI 日志(同一 pid 同时服务 18787/18788 两个端口)。修法选项 A/B/C 写在 #3209,请你拍板:等调度修复后再合本 PR,还是先接受这 4 个分片为已知问题。 判定:代码侧可合并(功能门禁 + e2e/native/registry/image 全绿,diff 每一行都与本 PR 目的相关);4 个红分片被 #3209 阻塞,与本 PR 的行为无关。 |
# Conflicts: # src/server/admin.ts
(ai: vllm-qwen/qwen3.8-27b) 上游冲突已处理:master 又前进了约 150 个提交(279 文件,含 kernel 0.0.126、CI 三层流水线重构、#3182 端口分带等),已合入 PR 分支并推送,新 head 冲突情况:只有 1 处文本冲突—— 顺手修掉一个文档缺陷:CLIENTS en/zh 的服务段落仍写着「注册 Windows Task Scheduler 登录任务」——但 service.ts 实际同时支持 Linux systemd 用户单元(上次重构时这处修正丢了,这次在合并树上重新改对:明确写 Windows Task Scheduler 和 Linux systemd 用户单元、其他平台报告不支持)。 合并后本地验证:typecheck 干净;定向 9 套件 83/83 过;三个门禁全过(unused-exports clean / docs-coverage 157 env + 54 keys / config-surface 140 fields)。依赖已按新 lockfile 同步(kernel 0.0.126、pi-subagents 0.2.0)并重新构建。 结构化八问
附带好消息:master 上的 判定:冲突已解、本地验证全绿、已推送;等本轮 CI(新三层流水线的 core matrix)结果。 |
(ai: vllm-qwen/qwen3.8-27b) CI 全绿了。上条回复后补一个结果更新:
最终判定:冲突已解、重构完成、CI 全绿、diff 每一行都与本 PR 目的相关——可以合并了。合并动作按规则由你执行:#3176 |
|
(ai: zhipuai-lb/glm-5.3) 孤儿票清理:提交两周未更新、无 issue 关联,且相关领域已有后续修复落地。为避免重复劳动关闭;如果你想继续推进,请 reopen 并补一个关联 issue(Fixes #N),我们会优先审查。感谢贡献! |
) Union-of-intent resolution of 8 conflicts: - tsup.config.ts / cli.ts / doctor.ts / plugin-install.ts: keep both sides' additions (PR's codex-integration + proxy-service surface alongside master's sessions/storage commands, dsh-ledger --fix, claude-mcp-entry, dsh-compaction-gate) - CLIENTS.md / CLIENTS.zh-CN.md: master's newer dsh web-profile rewrite (ranxianglei#3354/ ranxianglei#3662) supersedes the PR's incidental re-indentation of that same text; keep master's new ranxianglei#3203 concurrent-sessions paragraph plus the PR's four-faces one-click-install documentation - CONFIGURATION.md / CONFIGURATION.zh-CN.md: keep both new env rows (BILI_CODEX_HOOK_ORIGIN from the PR, BILI_DSH_MAX_TESTED_VERSION from master); also fix a missing trailing table cell on the master zh row in passing
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复——这是同一 PR 的第三次冲突唤醒(前两轮分别于 10-14、10-16 处理完毕,见上方楼层 17 与 20–21);跟踪 issue #3178 已存在,不另立项。 结论先行:本分支已无冲突可解——我开工前 master 已被合入分支;且你 10-24 14:04 的评论已把本票定为孤儿票待关,按规范我不再对它投入,停在此处等你拍板:执行关闭,或明确复活。 核查到的事实(逐项验证过):
等你拍板(两个选项):
八问:
判定:停止作业,等你拍板。推荐按你 14:04 的评论执行关闭(选项 A);若想继续推进,说一声我立即接手(选项 B)。 |
The codex SessionStart hook (src/codex/bootstrap-hook.ts) reads BILI_CODEX_HOOK_ORIGIN as its probe-target override, but the var was never registered in the lifecycle ledger, so lifecycle-ledger-guard failed on the PR head while master stayed green. Registered under §2.2 (internal spawn channel, next to the analogous BILI_STRICT_PORT host-hook knob). PR ranxianglei#3176
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复——同一 PR 的系统再唤醒(前几轮见楼层 17、20–21、27);跟踪 issue #3178 已存在,不另立项。顺带更正:楼层 23 的清理评论称「无 issue 关联」,但 #3178 正是本 PR 的跟踪 issue(10-14 创建,带来源标记),孤儿票前提不成立。 结论先行:本分支唯一属于我们自己的红已修复并推送(新 head head
结构化八问
等你拍板(延续楼层 27 的 A/B):
我的建议是 B:孤儿票前提不成立(#3178 在跟踪)、分支内容完整且 diff 每一行都与 PR 目的相关、唯一障碍是已在途的无关 master 红——此时关掉等于白扔一份做完的贡献。 判定:我方工作已完成(修复推送 + 本地验证通过);剩下的是一键决策 + 等 #4603。 |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复——本条派单是陈旧/乱序通知,指向旧 head 结论先行:点名失败( 复核证据(逐项实测,非转述):
结构化八问
剩余状态(非本车道职责,仅报备):
判定:点名 CI 红已解决(当前 head 上该门禁绿),本轮无新提交、停止作业;后续动作全部在人侧(owner 两项拍板)+ 等 #4606。 |
Inherited unused-exports red from master tip (ranxianglei#4545 train left this type-only declaration exported with zero external references). Same one-line de-export as PR ranxianglei#4606; the type is referenced only within this module.
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复——本次派单指向当前 head 做了什么:向分支推送独立标注 commit 级联放行后新显形的状态(非本 commit 引入):unused-exports 转绿后 fail-fast 放行 11 个 test 分片,全红——但每个分片都死在测试执行前的预检,零真实测试失败:统一报错
为何不继续叠 LIVE_FILES 登记:登记后分片将撞上 master 自身的 born-red 集群(#4537 本地复现 12 项、最新 master 17 项;总账见 #4599 floor 20),照样红;且等于把 #4606 的内容逐层搬进外部贡献者分支,偏离舰队惯例(#4617/#4623 均止步于「报继承、不叠修」)。唯一出口仍是 owner 对 #4606 合并死锁的拍板(#4599 floor 57:A=admin override 合入【推荐】/ B=先修 born-red 集群 / C=放宽 required checks);#4606 落地后本分支重同步重触发即可收敛。 结构化八问
判定:点名失败已解决(unused-exports 绿,live 验证);剩余 11 个分片红 = master 继承的 LIVE_FILES tripwire(#4604,修复含于 #4606),解锁等 owner 拍板;分支侧动作到此为止。 |
…aster # Conflicts: # CLIENTS.md # CLIENTS.zh-CN.md # CONFIGURATION.md # CONFIGURATION.zh-CN.md # LIFECYCLE.md # src/cli.ts # tsup.config.ts
iot-thinking issues its own extra compress/rewrite model call after every reply; both calls share one session lane, so the step keeps waiting seconds to tens of seconds after its first byte (measured: the extra request shape was 44% of one session's requests, p50 ~7s, and vanished when the plugin was disabled). Owners could not see the cause from bili's side. Register a fourth builtin notice (KDD ranxianglei#16 surface, no new channel): - src/notice-store.ts: iot-incompat id + dismissal allowlist - src/notices.ts: probeDshIotThinking scans dsh profile dirs for node_modules/dsh-plugin-iot-thinking (never throws; advisory) - src/web/i18n.ts: en/zh copy - tests: registry id/allowlist rows + hermetic detection/dismissal suite
…cumented one-observation loss Byte-identical mirror of in-flight PR ranxianglei#5990, inlined onto this PR branch per ranxianglei#4599 coordination for the inherited red: master commit 48f9e69 (ranxianglei#5989) added tests/issue5955-wedged-same-lane-takeover.test.ts without registering it in scripts/live-files.mjs, so the SPAWN_RE tripwire (ranxianglei#1248) in scripts/run-ci-tests.mjs killed all 11 test shards at pretest before any test ran. The second hunk tolerates the wedged-ledger's documented worst-case one-observation read-modify-write loss instead of turning an fs-timing hiccup into a CI flake. When ranxianglei#5990 merges to master these hunks dedup cleanly (byte-identical changes merge without conflict). Verified locally: tripwire scan clean (1147 test files / 62 live entries, zero unregistered spawning files); issue5955 suite 18/18 pass.
(ai: vllm-qwen/qwen3.8-27b) CI fix round (auto-fix lane, attempt 1/3) — pushed. What was red: all 11 test shards of run 42552123208 died at pretest before any test executed. Exact error from the job log (ubuntu 22 shard 1): What I did: per the few-lines-of-code small-fix discipline and this storm's fleet precedent (#5945 / #5178 sentinels), I inlined both hunks of #5990 byte-identical onto the PR branch as one labeled commit
Verified locally: tripwire scan clean (1147 test files / 62 live entries, zero unregistered spawning files) and the issue5955 suite 18/18 pass. When #5990 merges to master, these identical hunks dedup cleanly (same change on both sides merges without conflict). A new CI run is being triggered by the push; if anything else surfaces it will be triaged in the next wake (attempt 2/3 remains available). Ticket status unchanged on my side: the owner's close-vs-revive decision (floors 23–35) is still pending; I closed nothing. 查重:不重复——本条为 PR #3176 的 CI 自动修复轮次,非新 issue;与在途 PR #5990 同机制(#5989 新增 spawn 类测试未登记 LIVE_FILES),按本风暴先例逐字节内联而非另开条目;未开任何新 issue。 八问:
判定:修复已推送(El1mir:master @ 223bd27),等新 CI 跑完,绿则本轮收工。人工侧遗留两项:① owner 对本票 close/revive 的 A/B 决策仍待拍板(见 floors 23–35);② #5990 合入后内联 hunk 自动去重,无需人工操作。 |
Installed-but-disabled is the healthy state: the plugin's extra rewrite call is what produces the post-first-byte wait, and turning it off removes it. Gate the notice on the plugin's own effective switch instead of bare presence (missing/broken config keeps the plugin default, enabled). Verified on the owner's machine: installed=true, enabled=false ⇒ active=false.
tests/web-i18n.test.ts (ranxianglei#1024 'every referenced key exists in both locales') scans src/notices.ts for quoted dot-qualified identifiers and treats each as a catalog-key reference (the ranxianglei#5345 verbatim-acceptance design). The new iot-incompat notice probe carried the path literals "package.json" and "config.json" inside that scanned file, so the gate failed deterministically on every platform/shard ('referenced key missing from zh catalog: package.json'; 'config.json' was next in line). Relocated probeDshIotThinking + dshIotThinkingActive to src/dsh-channel.ts, next to the dshProfileDirs/resolveDshHome helpers they exclusively use; behavior is byte-identical, zero logic change. The iot-incompat test now imports them from their new home. Verified locally: web-i18n + iot-incompat-notice + notice-registry suites 21/21 pass; unused-export gate clean; tsc --noEmit clean.
(ai: vllm-qwen/qwen3.8-27b) CI fix round 2 — pushed (El1mir:master @ c2172ab), new run in progress. 查重: 不重复 — 这是本 PR 自动修复车道的延续;本次事件的第二条唤醒是同一失败的重复转发(同一 run 42577444976、同样 3 个 job)。机制与第一轮不同:第一轮是继承自 master 的红(LIVE_FILES 绊线),这一轮是本 PR 自己新增代码触发的 i18n 门禁误报。未开任何新 issue(CI 协调按政策留在 #4599)。 What was red: run 42577444976 @ 5ba1474 — exactly 3 test shards failed, all shard 1 across platforms (ubuntu-22-s1, windows-22-s1, ubuntu-24-s1). Each failed on the SAME single test: Root cause (this PR's own bug, NOT inherited): the i18n reference scanner treats any quoted dot-qualified identifier found in src/notices.ts as a catalog-key reference (tests/web-i18n.test.ts:129-133, #5345 design). The iot-incompat notice probes added by the Fix: relocated the two probe helpers VERBATIM into src/dsh-channel.ts (next to the Concurrency note: while this round ran, a parallel commit landed on the branch (bab610e "fix(web): show built-in notice banners (missing .show class)", +3 lines in src/web/client.ts — someone else's work, left untouched). Per push discipline I rebased my fix onto it (clean, disjoint files), re-ran verification, then pushed fast-forward. Verified locally before push: web-i18n + iot-incompat-notice + notice-registry suites 21/21 (the previously-failing #1024 case green), unused-export gate clean, tsc --noEmit clean. Mirror cache confirms the new run registered on c2172ab (30 checks, 0 failed, 11 pending at fetch time). Human-side items unchanged: your A/B decision on closing vs reviving this ticket is still pending; round 1's inline LIVE_FILES registration deduplicates cleanly once the identical hunk merges from master's side (#5990 / ci-fixes lineage). 八问:
判定: 修复已推送(El1mir:master @ c2172ab),新一轮 CI 运行中;本轮无需人工介入,等 CI 结果即可。 |
通过全局代理转发请求到bili后端做到这一点
安装命令让ai做了对linux的支持,但是没有环境测试linux
只做了windows的自动手动压缩的测试,暂未发现问题
添加命令
bili plugin install codex
bili plugin uninstall codex
bili service install|status|restart|enable|disable|remove
(注:原描述写的
bili server status,实际实现的命令是bili service status)严格审阅与重构(owner 授权,2026-10-15)
按 owner 授权对该分支做了一轮最严格重构(增量 commit,d5abc5223 → 2215592,不替换原作者提交):
piPackageStrings());分支上的旧.map(String)代码会把 packages 对象条目破坏成字符串。[x]与[[x]]);route.ts tab→4 空格;status.ts 重复 import 合并。测试同步改测 renderTaskLauncherVbs/renderTaskXml(同一套 checkedOptions 校验,覆盖面不变)。bili service命令行并更新 codex install 示例;CLIENTS 文档修正服务描述(Windows Task Scheduler 与 Linux systemd 用户单元均支持,原稿只写了 Windows)。顺手小修(独立标注,与功能无关的两处既有问题):删除 src/plugin-install.ts 未使用的 pathToFileURL import;readKimiInstalledRegistry 损坏 JSON 报错带上文件路径与 cause(原来是裸 SyntaxError)。
Config surface
bili service <action>(install|status|restart|enable|disable|remove):管理常驻的当前用户代理服务(Windows Task Scheduler 登录任务 / Linux systemd 用户单元;其他平台明确报不支持)。JSON 输出,未达预期状态退出码 1。既有命令面表达不了「注册/注销自启动」这件事(bili start只有前台运行),codex 零外部服务姿态需要它([PR] Added a one-click install feature for my plugin on the Codex side | [PR] 添加了codex端一键安装我插件功能 #3176 floor 14 owner 确认方向)。bili plugin install/remove codex语义变更(见下 Behavior changes)。无新配置文件字段、无新 env var;服务状态记录在~/.local/state/billion-context/proxy-service.json(0600,原子写),属共享 state 目录,与其他 bili 实例共用。迁移:从未安装过的人行为不变;已安装者重跑 install 幂等地补齐各面。bili doctor报告新增三个只读诊断段:codex model route / CC Switch / ChatGPT subscription & Desktop。Behavior changes(旧 → 新)
bili plugin install codex:仅写 MCP 块 → 托管四个面。① MCP+ACP 工具块(~/.codex/config.toml);② 模型路由(model_providers.<provider>.base_url指向 bili origin + 合成凭据标记 PROXY_MANAGED,内容判所有权,遇到外来值报 blocked/drifted,绝不覆盖);③ SessionStart hook(内容判所有权,attach-only,hook 只负责确保代理在跑,失败时 fail-open 不阻塞会话);④ ACP skill~/.codex/skills/bili/SKILL.md(绝不覆盖外来文件)。另尝试注册自启动代理服务——fail-soft:平台不支持或注册失败只警告,手动方式照常可用。bili plugin uninstall codex:即使没有 config.toml 也删 skill;若 bili 写过路由/模型值,从 sidecar 记录恢复原值;剥离 hook;注销服务注册并清理孤儿进程。codexClient布尔提示字段(增量字段,不影响既有消费者)。Tests / open items
本地定向套件全绿(proxy-service、codex-*、doctor、plugin-install-opencode:build 后 68/68 + 15/15 + 18/18);全量以远程 CI 为准(head 2215592)。遗留项在跟踪 issue #3178:Linux systemd --user 真机登录态实测(本机验证了 planner/注册逻辑,未验真实 login session)。
Fixes #3178