Repository navigation
fix(cli,i18n): warn after offline config writes when octop run is live; append root cause to stream errors (#952 方向 1+3) - #1001
Open
vicfei wants to merge 1 commit into
Conversation
…e; append root cause to stream errors (TencentCloud#952) - provider/channel/cron offline writes probe /api/health on the configured bind address and print a localized restart hint on stderr (never stdout, so --json stays parseable); replaces cron create's unconditional English hint - format_stream_error keeps surfacing the original cause (secrets redacted, clipped) instead of fully replacing it with generic localized guidance; shared by the HTTP / WS / CLI / gateway processor chat paths
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.
Summary
#952 的两个独立修复方向(与 #969 的 factory 同步正交,sxh313 在 issue 里明确留出的两块):
1. CLI 离线写后提示运行中的
octop run需重启cli/support/runtime_probe.py:读config.json的bind_host/port(octop run启动时已把解析后的地址写回 config.json,见run.py::_save_configfile_overrides),探测GET /api/health(0.5s 超时;0.0.0.0/::归一到127.0.0.1)。全部 best-effort:探测失败 = 不提示,绝不阻塞或拖慢 CLI 写命令provider create/delete、channel create/patch/delete、cron create/delete共 7 个离线写点接线:命中活实例时向 stderr 输出本地化提示(zh/en),不污染--json的 stdoutcron create原有的无条件英文提示(打到 stdout)为条件触发的本地化版本2. 对话错误透传真实根因
format_stream_error此前一旦命中分类(或model_call_failed兜底)就把原始异常文案整体替换成本地化通用文案——#952的现场里用户只看到「模型调用多次重试后仍失败」,提示去查模型配置,而配置页面显示一切正常,无从定位原因:{cause}(en:Cause: {cause}),凭证脱敏(sk-…/Bearer …)+ 截断 300 字符;send_file_to_user透传路径不动(fix(chat): prevent misclassifying send_file_to_user tool errors as model outages (#852) #925 的语义)Testing
tests/unit/cli/test_runtime_probe.py(9 用例:健康/无监听/非健康 JSON/wildcard 归一/无 config 不落盘/损坏 config/stderr 输出/静默)tests/unit/i18n/test_stream.py新增 6 用例(模型未找到根因、401 脱敏、Bearer 脱敏、长文案截断、guidance 去重、en 后缀),4 个锁定旧契约("原始文案不可见")的用例更新为新契约(guidance 首行 + 根因可见)make all全绿(format-all / lint / mypy --strict / 全量单测)Fixes #952 (方向 1+3;方向 2 由 #969 覆盖)