Repository navigation
fix(loopback): 运行时事件区分未知字段与客户端错误 - #266
Open
Jone888999 wants to merge 2 commits into
Open
Jone888999 wants to merge 2 commits into
Jone888999 wants to merge 2 commits into
Conversation
/healthz 的版本改读 metadata.yaml,返回 app_version/pid/ready/started_at,runtime_gate_enabled 读取本次启动的生效配置;正常退出(含 POSIX SIGTERM)删除本进程发布的 runtime.json,按端口与令牌核对,不删其它实例的文件。 不改变存储格式、公开配置与端点路径;Windows 不投递 SIGTERM 处理器,发现文件保留到下次启动覆盖。GitHub issue 编号待分配。
Jone888999
force-pushed
the
fix/runtime-event-boundaries
branch
from
December 3, 2026 04:04
ef918b4 to
d4250ce
Compare
accept_user 忽略未知字段并计入 /status 的 runtime_ingress.ignored_fields,不再整条拒绝;record_delivery 字段类型错误返回 400 而非 500;action_result 在未接动作账本前明确返回 501;非对象 JSON 返回 400 invalid_body。 不改变存储格式、公开配置与端点路径。GitHub issue 编号待分配。
Jone888999
force-pushed
the
fix/runtime-event-boundaries
branch
from
December 3, 2026 04:11
d4250ce to
a1d5499
Compare
This branch has not been deployed
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.
基于 #265。请先合并 #265;本 PR 目前显示 2 个提交,等 #265 合入 main 后会自动只剩「运行时事件」这一个提交。
Summary / 概述
/runtime/events把未知字段当致命错误、把格式错误报成 500,并对action_result返回成功却什么都不记:宿主加字段就整条断,调用方错误被伪装成服务故障,动作审计承诺与实际记录不符。Changes / 改动
runtime_ingress.py:accept_user忽略未知字段并计数;record_delivery类型校验前移,返回400 invalid_runtime_reply;action_result返回 501。runtime.py:/status暴露runtime_ingress.ignored_fields。server.py:非对象 JSON 返回400 invalid_body(原为 500)。action_result501、/capture数组 400。Compatibility, data and privacy / 兼容性、数据与隐私
无存储/配置变更。
action_result由 200 改为 501 是线上可见变化,当前 DSH 无调用方;后续应同步runtime-bridge.js的EVENTS列表,或在客户端把 501 映射为not_supported。错误体仍为{"error": "<code>"},不含正文或令牌。Risk and rollback / 风险与回滚
风险:
ignored_fields是以远端字段名为键的字典,异常宿主可让它增长(建议后续加上限)。回滚git revert,无数据影响。Checklist / 检查清单
maindocs/zh/anddocs/en/验证:
test_loopback_server_contract.py10 OK(1 skipped)、test_loopback_runtime_ingress.py9 OK、test_loopback_ingress.py11 OK。