Open
A2A pipeline drops scene user scope before personal runtime enqueue #503
明亮Add on  25 days ago
明亮
明亮Collaborators
25 days ago Create

Problem

In plugin mode, an A2A handoff can create a queued task that a healthy personal-scoped runtime can never claim. The task remains queued with no runtime assignment even though the event-bus caller supplied the scene owner user ID.

Root cause

dispatch_node(..., user_id=...) accepts the scene user ID, but does not pass it through _dispatch_emit, _dispatch_waterfall, _dispatch_serial, or _dispatch_parallel. _enqueue_via_pipeline then reconstructs a user ID from persisted scene metadata or repository membership. If the persisted scene user is absent and the event actor is empty, this can choose a different repository user. Personal runtime claim filtering rejects that task.

Expected behavior

Preserve the caller-provided user ID through all pipeline dispatch modes. Persisted non-zero issue scene ownership should remain authoritative; repository lookup should be only the final fallback.

Reproduction / acceptance

  • Call dispatch_node with a non-zero user_id and an empty event actor.
  • Use plugin mode with missing/zero persisted scene user ID.
  • Assert the enqueued task keeps the supplied user ID.
  • Existing A2A queue and personal runtime identity tests continue to pass.
likedislike
明亮明亮Collaborators
25 days ago Associated pull request
grape_bot
grape_botCollaborators
25 days ago Comments:

[VOD Agent] 需求已定位并完成收敛(Issue #503:A2A pipeline 在 personal runtime 入队前丢失 scene user scope)。

根因(已在 weekly-09 源码核实)

  • src/api/pipeline_executor.py 中 dispatch_node(..., user_id=0) 虽接受 scene user ID,但四个分发函数 _dispatch_emit / _dispatch_waterfall / _dispatch_serial / _dispatch_parallel 的签名均不含 user_id,调用时被丢弃。
  • 兜底链在 _enqueue_via_pipeline 内重建 user:先取 get_issue_scene() 持久化 scene_uid;若为 0 再 _repo_user_id(repo_key, issue_creator=evt.actor) 反查仓库成员。A2A 事件 actor 为空 + 持久化 scene user 缺失/为 0 时,会选中与 scene owner 不同的仓库用户,personal runtime 按 user 过滤 claim 时拒绝该任务 → 任务长期 queued、无 runtime 认领。

验收标准(交办 coding 实现)

  1. user_id 参数贯穿 dispatch_node → _dispatch_emit/_dispatch_waterfall/_dispatch_serial/_dispatch_parallel → _enqueue_via_pipeline,四种 mode 全部透传,不被中间层丢弃。
  2. user 选取优先级:dispatch_node 显式传入的非零 user_id > 持久化 issue scene 的非零 scene_user_id > _repo_user_id 仓库反查(仅最终兜底)。持久化的非零 issue scene ownership 保持权威。
  3. 复现验收:dispatch_node(user_id=<非零>, evt.actor="") + plugin 模式 + 持久化 scene user 缺失/为 0 时,断言入队任务 user_id 等于传入值;personal runtime claim 过滤可命中。
  4. 既有 A2A 队列与 personal runtime 身份测试保持通过(不得回归)。

下一步:A2A 交办 coding agent 实现(分支 weekly-09)。

likedislike
grape_bot
grape_botCollaborators
25 days ago Comments:

[issue agent] 已收到 PR #704(fix: preserve A2A user scope through pipeline dispatch),该 PR 对应 Issue #503 的修复。

深度可开发性分析

维度 结论
需求完整性 ✅ 完整 — Problem / Root cause / Expected behavior / Acceptance criteria 四要素齐全
技术可行性 ✅ 可行 — dispatch_node 的 user_id 参数透传至 _dispatch_emit / _dispatch_waterfall / _dispatch_serial / _dispatch_parallel 四种模式,改动范围明确
依赖就绪性 ✅ 就绪 — 无外部依赖,仅涉及 src/api/pipeline_executor.py + 新增测试
范围确定性 ✅ 清晰 — PR 变更 +17/-17(pipeline_executor.py)+58/-0(test_pipeline_executor_user_scope.py),与 Issue 验收标准一致

评级:ready

PR 与 Issue 对齐核验

  • PR 透传 user_id 至全部 dispatch 模式 → 对应 Issue Root cause ✓
  • persisted 非 zero scene ownership 保持权威 → 对应 Expected behavior ✓
  • repository membership 仅在两路均无 user_id 时回退 → 对应 Expected behavior ✓
  • 新增 dispatch/enqueue 边界回归测试 → 对应 Acceptance criteria ✓

后续动作:已 A2A 交办 QA Agent 对 PR #704 进行代码审查。

likedislike
grape_bot
grape_botCollaborators
25 days ago Comments:

[issue agent] 补充说明:A2A 交办 QA Agent 未成功——当前 Issue #503 的流水线尚未推进到 QA 阶段(pipeline nodes=[vod,issue]),QA 节点不在当前可路由范围内。场景配置中含 QA 节点,待 Issue 走完 vod → issue → coding 正常流转后即可自动到达 QA 审查环节。

鉴于 PR #704 已直接提交修复代码(跳过了 coding 阶段的 A2A 流转),建议:

  1. 由开发者或维护者手动在 PR #704 上发起代码审查请求;
  2. 或确认本 Issue 的流水线配置后,由 QA Agent 在后续事件中接管审查。

Issue 分析结论不变:评级 ready,PR #704 与 Issue 验收标准对齐。

likedislike
grape_botgrape_botCollaborators
25 days ago Modify description of issue
grape_botgrape_botCollaborators
25 days ago Added label: bugtriaged
grape_bot
grape_botCollaborators
25 days ago Comments:

[VOD Agent] 跨流水线移交复核完成。

复核结论

  • 需求四要素齐全(Problem / Root cause / Expected behavior / Acceptance criteria),清晰度达标,无需追加澄清。
  • 前序 VOD 结构化收敛有效:根因 src/api/pipeline_executor.py 四个分发函数(_dispatch_emit/_dispatch_waterfall/_dispatch_serial/_dispatch_parallel)丢弃 user_id,验收标准 4 条。
  • PR #704(fix: preserve A2A user scope through pipeline dispatch)已提交,Issue Agent 评级 ready,与验收标准对齐。
  • 当前开发流水线节点完整(vod→issue→coding→qa→sre),原流水线 QA 节点不可达的问题已随跨流水线移交消除。

下一步:A2A 交办 issue 节点确认 Spec;PR #704 已就绪,可同步推进 QA 审查。

likedislike
grape_bot
grape_botCollaborators
25 days ago Comments:

[issue agent] 📋 Spec Document

Generated by Issue Agent | Developability: ready | 2026-10-29 | PR #704 已提交

Objective

  • 构建什么:修复 A2A pipeline 在 personal runtime 入队前丢弃 scene user scope 的缺陷,使 user_id 贯穿全部 dispatch 模式直达 enqueue。
  • 为什么:plugin 模式下 A2A handoff 创建的 queued task 无法被健康 personal-scoped runtime 认领,任务长期 queued 无 runtime 分配,用户流程卡死。
  • 用户:使用 A2A 跨场景/跨流水线移交的开发者及其 personal runtime。
  • 成功标准:dispatch_node(user_id=<非零>, evt.actor="") + 持久化 scene user 缺失/为 0 时,入队任务 user_id 等于传入值,personal runtime claim 可命中。

Scope

In Scope

  • src/api/pipeline_executor.py:dispatch_node → _dispatch_emit/_dispatch_waterfall/_dispatch_serial/_dispatch_parallel → _enqueue_via_pipeline 四种 mode 全链路透传 user_id
  • user 选取优先级:显式传入非零 user_id > 持久化非零 scene_user_id > _repo_user_id 仓库反查(仅最终兜底)
  • 新增 dispatch/enqueue 边界回归测试

Out of Scope

  • personal runtime claim 逻辑本身的改动(仅验证可命中,不重构)
  • A2A 事件 actor 填充策略调整
  • 跨仓库成员权限模型变更

Technical Approach

方案概述

在 dispatch_node 及四个分发函数签名中增加 user_id 参数,透传至 _enqueue_via_pipeline,并在 enqueue 内按优先级选取 user。

实现路径

  1. _dispatch_emit/_dispatch_waterfall/_dispatch_serial/_dispatch_parallel 签名增加 user_id,调用处透传
  2. _enqueue_via_pipeline 接收 user_id,按优先级选取(显式非零 > 持久化非零 scene_uid > repo 反查兜底)
  3. 新增 tests/test_pipeline_executor_user_scope.py 覆盖 dispatch + enqueue 边界

关键设计决策

决策 选项 选择 理由
user_id 透传方式 新增参数 vs 全局上下文 新增参数 显式、可测试、不引入隐式依赖
持久化 scene ownership 权威性 保留 vs 覆盖 保留 持久化非零值代表已确认的 scene 归属
repo 反查触发条件 总是 vs 仅两路均无 user_id 仅两路均无 避免覆盖已有权威 user

Affected Modules

模块 改动类型 说明
src/api/pipeline_executor.py 修改 四分发函数 + enqueue 增加 user_id 透传与优先级选取
tests/test_pipeline_executor_user_scope.py 新增 dispatch/enqueue 边界回归测试

Acceptance Criteria

PR 对齐核验(PR #704)

  • 透传 user_id 至全部 dispatch 模式 → Root cause ✓
  • persisted 非 zero scene ownership 保持权威 → Expected behavior ✓
  • repository membership 仅在两路均无 user_id 时回退 → Expected behavior ✓
  • 新增 dispatch/enqueue 边界回归测试 → Acceptance criteria ✓
  • 变更:pipeline_executor.py +17/-17,test_pipeline_executor_user_scope.py +58/-0

Risks & Mitigations

Risk Impact Mitigation
优先级逻辑误覆盖持久化 scene user Med 显式非零 > 持久化非零 > 兜底,测试覆盖边界
既有 dispatch 调用点遗漏透传 Low 四函数统一签名,编译期可检出

Open Questions

  • 无

Spec 状态:已确认 ready。PR #704 已提交且与验收标准对齐,下一步 A2A 交办 QA Agent 进行代码审查。

likedislike
grape_botgrape_botCollaborators
25 days ago Assign grape_bot as responsible person
grape_botgrape_botCollaborators
25 days ago Added label: spec-ready
grape_botgrape_botCollaborators
25 days ago Associated pull request
grape_bot
grape_botCollaborators
25 days ago Comments:

[Coding Agent] ✅ QA 审查意见已处理完毕,修复见新 PR #706(承接 PR #704 全部改动 + 审查补充测试,base=weekly-09)。

权威语义澄清(对应 QA Required 项):user 选取优先级确认为 持久化非零 scene_user_id > 显式传入非零 user_id > _repo_user_id 仓库反查兜底。依据为本 Issue Expected behavior 原文(Persisted non-zero issue scene ownership should remain authoritative; repository lookup should be only the final fallback);Spec 中「显式非零 > 持久化非零」的表述与 Issue 正文及 Spec 设计决策表互斥,属笔误,以 Issue 正文为准。已补 stored≠forwarded 分歧场景测试锁定行为。

补充测试(对应 2 项 Suggestion):serial/parallel 模式透传断言、user_id=0 且 stored=0 时 repo 反查兜底被采用的断言。

验证:tests/test_pipeline_executor_user_scope.py 6 passed;既有 A2A 队列 7 passed;A2A/personal-runtime 关联集 33 passed(仅 #704 已记录的既有顺序依赖用例聚合失败、单独通过)。

备注:PR #704 head 位于个人 fork,机器人无推送权限,故以 #706 承接并 rebase 到最新 weekly-09(#704 为 non-ff),建议以 #706 取代 #704 合入。

likedislike