fix(agent): CPU 模式消费安全启动参数白名单(--disable-api-nodes)#92
Merged
Conversation
CPU 模式此前完全不消费 CUSTOM_BOOT_ARGS,导致 --disable-api-nodes 在 CPU
工作站/网关不生效(官方 API 节点仍可被搜索)。新增白名单机制:
- args.py: filter_allowed_args + build_boot_command(allowed_args=...)
- constants.py: _CPU_SAFE_BOOT_ARGS={'--disable-api-nodes'},CPU 分支启用
- GPU 路径不变(allowed_args 默认 None)
- 单测 45 passed
Change-Id: I74e1c8605a89d58cb23df52918ad38be334aa615
Co-developed-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: luling.zqj <luling.zqj@alibaba-inc.com>
27355bb to
cfce374
Compare
Collaborator
Author
|
Review 的两点都已处理,force-push 到 P1(DCO):已 P2(白名单安全边界):采纳「带 arity 的 spec」方案——白名单从
已补对应单测( |
cap Makefile 的 v0.3.77 分支默认 CAP_SYSTEM_VERSION=1.6.8 会引用不存在的 source image funart-comfyui:v1.6.8(实际是 v1.6.7),导致 1.x 构建拉错镜像。 修正为实际值 1.6.7。 Change-Id: Ied303c00148bda5720dc1762bcd8c8a796cb6c4f Co-developed-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: luling.zqj <luling.zqj@alibaba-inc.com>
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.
问题
CPU 模式此前完全不消费
CUSTOM_BOOT_ARGS(constants.pyCPU 分支直接用 base_cmd),导致--disable-api-nodes在 CPU 工作站/网关不生效——官方 API 节点仍可被搜索。GPU 模式正常。方案 B(CPU 安全白名单)
utils/args.py:新增filter_allowed_args;build_boot_command增加可选allowed_args(白名单收窄,先于受保护过滤)constants.py:新增_CPU_SAFE_BOOT_ARGS={'--disable-api-nodes'},CPU 分支带allowed_args调用--highvram)仍丢弃,避免 CPU 启动失败allowed_args默认 None)测试
args_test.py单测 45 passed(含 GPU 回归 + CPU 白名单/丢弃 GPU 参数/混合场景)。调查与设计文档:ai-codex MR(codereview/28115221)。
🤖 Generated with Claude Code