Skip to content

fix(common_provider): implement onetime pipeline config delivery#2566

Open
cyberzz-dev wants to merge 3 commits into
alibaba:mainfrom
cyberzz-dev:fix/common-provider-onetime-pipeline-config
Open

fix(common_provider): implement onetime pipeline config delivery#2566
cyberzz-dev wants to merge 3 commits into
alibaba:mainfrom
cyberzz-dev:fix/common-provider-onetime-pipeline-config

Conversation

@cyberzz-dev
Copy link
Copy Markdown

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:

  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.

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.
Copilot AI review requested due to automatic review settings May 26, 2026 11:44
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 26, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AcceptsOnetimePipelineConfig in 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;
Comment thread core/config/common_provider/CommonConfigProvider.cpp Outdated
continue;
}
{
lock_guard<mutex> lockInfoMap(mInfoMapMux);
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Takuka0311
Copy link
Copy Markdown
Collaborator

Takuka0311 commented May 26, 2026

百炼自动化审查:建议保持开启。

本 PR 修复了 CommonConfigProvider 中未处理心跳响应 onetime_pipeline_config_updates 字段导致一次性管道配置被静默丢弃的核心缺陷。变更包含能力位声明与配置下发处理逻辑,并已根据审查意见重构锁顺序、修复跨平台文件重命名及日志路径问题。属于有效的核心功能修复,当前处于活跃迭代与待维护者评审状态,应保持开启。.

最佳落地路径:

保持开启。建议等待 CI 全量通过后由维护者进行最终代码审查。若测试验证无误且符合管控协议规范,可合并入 main 分支。后续可考虑补充相关单元测试或集成测试以覆盖一次性配置下发的边界条件。.

已核对内容:

  • pr_implementation: PR 在 GetConfigUpdate 中新增 onetime_pipeline_config_updates 处理逻辑,并在 PrepareHeartbeat 中补充 AcceptsOnetimePipelineConfig 能力位,直接修复静默丢弃指令的缺陷。. (core/config/common_provider/CommonConfigProvider.cpp:264, de5788fae387)
  • review_iteration: 最新提交已拆分 mOnetimePipelineMux 与 mInfoMapMux 锁作用域消除死锁隐患,增加 filesystem::remove 保证跨平台 rename 安全,并修正警告日志路径打印。. (core/config/common_provider/CommonConfigProvider.cpp:505, de5788fae387)
  • pr_status: PR 状态为 open,可合并 (mergeable: true),最近更新于 2026-05-27,已签署 CLA,无冲突,等待 CI 验证与维护者最终审查。. (de5788fae387)

百炼审查备注:模型 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants