fix(common_provider): implement onetime pipeline config delivery#2566
Open
cyberzz-dev wants to merge 3 commits into
Open
fix(common_provider): implement onetime pipeline config delivery#2566cyberzz-dev wants to merge 3 commits into
cyberzz-dev wants to merge 3 commits into
Conversation
CommonConfigProvider had the data structures and FeedbackStatus method for onetime pipeline configs, but GetConfigUpdate() never processed the onetime_pipeline_config_updates field from heartbeat responses. As a result, the agent silently discarded all onetime commands from the config server, and no files were ever written to the onetime_pipeline_config/<dir>/ directory. Two changes fix this: 1. Add AcceptsOnetimePipelineConfig to the capabilities bitmask in PrepareHeartbeat(), so the server knows this agent supports it. 2. Add UpdateRemoteOnetimePipelineConfig() and call it from GetConfigUpdate() to write received commands as .json files and register them with ConfigFeedbackReceiver. The skip-if-already-in-map guard preserves one-time delivery semantics: each named command is written at most once per agent lifecycle. Verified against v3.3.2: same bug exists in the released binary.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for receiving and applying one-time pipeline configuration updates from the config server via heartbeat responses.
Changes:
- Advertises
AcceptsOnetimePipelineConfigin heartbeat capabilities. - Processes
onetime_pipeline_config_updates()from the heartbeat response. - Persists received one-time pipeline configs to disk and registers them for feedback tracking.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| core/config/common_provider/CommonConfigProvider.h | Declares a new handler to apply one-time pipeline config updates. |
| core/config/common_provider/CommonConfigProvider.cpp | Implements fetching, persisting, and registering one-time pipeline configs and updates heartbeat capabilities. |
| { | ||
| ofstream fout(tmpFilePath); | ||
| if (!fout) { | ||
| LOG_WARNING(sLogger, ("failed to open onetime config file", filePath.string())); |
| } | ||
| fout << cmd.detail(); | ||
| } | ||
| error_code ec; |
| continue; | ||
| } | ||
| { | ||
| lock_guard<mutex> lockInfoMap(mInfoMapMux); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Collaborator
|
百炼自动化审查:建议保持开启。 本 PR 修复了 CommonConfigProvider 中未处理心跳响应 onetime_pipeline_config_updates 字段导致一次性管道配置被静默丢弃的核心缺陷。变更包含能力位声明与配置下发处理逻辑,并已根据审查意见重构锁顺序、修复跨平台文件重命名及日志路径问题。属于有效的核心功能修复,当前处于活跃迭代与待维护者评审状态,应保持开启。. 最佳落地路径: 保持开启。建议等待 CI 全量通过后由维护者进行最终代码审查。若测试验证无误且符合管控协议规范,可合并入 main 分支。后续可考虑补充相关单元测试或集成测试以覆盖一次性配置下发的边界条件。. 已核对内容:
百炼审查备注:模型 qwen3.6-max-preview;对照提交 8b91144f8a81。 |
…ipelineConfig - Eliminate deadlock risk: decouple mOnetimePipelineMux and mInfoMapMux so they are never held simultaneously; file I/O uses only mOnetimePipelineMux and info-map reads/writes use only mInfoMapMux - Fix cross-platform rename: call filesystem::remove(filePath) before rename so the target is absent on Windows (POSIX replaces atomically; Windows errors if destination exists) - Fix warning log: print tmpFilePath instead of filePath when ofstream open fails
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.
CommonConfigProvider had the data structures and FeedbackStatus method for onetime pipeline configs, but GetConfigUpdate() never processed the onetime_pipeline_config_updates field from heartbeat responses. As a result, the agent silently discarded all onetime commands from the config server, and no files were ever written to the onetime_pipeline_config/
/ directory.Two changes fix this:
The skip-if-already-in-map guard preserves one-time delivery semantics: each named command is written at most once per agent lifecycle.
Verified against v3.3.2: same bug exists in the released binary.