## 已确认问题 WorkflowDefinition 暴露 inputSchema/outputSchema,但校验器只拒绝空白字符串;运行器未使用这两个字段。非法 Schema 可以进入可运行定义,缺少必填输入仍会执行工具,最终返回 COMPLETED。 代码:https://github.com/agentic-ai-java/argi/blob/b34835354b27f1f320ea8438edf2e9d170e69c84/argi-orchestration/argi-workflow-core/src/main/java/io/github/agentic/ai/workflow/WorkflowDefinitionValidator.java#L27;https://github.com/agentic-ai-java/argi/blob/b34835354b27f1f320ea8438edf2e9d170e69c84/argi-orchestration/argi-workflow-core/src/main/java/io/github/agentic/ai/workflow/WorkflowAgent.java#L218。 ## 最小复现场景与证据 1. 创建含一个假工具步骤的 WorkflowDefinition。 2. inputSchema 为 `{"type":"object","required":["requiredInput"]}`,outputSchema 为 `not-a-json-schema`。 3. 使用空 inputs 构造 AgentRequest,运行 Workflow,假工具记录执行次数。 实际:`outcome=COMPLETED, tool executed=1`。发布/构建时也没有发现 outputSchema 不是合法 JSON Schema。 ## 交付与验收 - [ ] 发布或实例化时检查已声明 Schema 的语法及支持方言;未声明 Schema 的调用保持现有可用行为。 - [ ] 明确 inputSchema/outputSchema 对应的数据边界,输入在进入步骤和发生工具副作用之前校验。 - [ ] 最终输出不符合声明时返回明确的验证失败,不能以 COMPLETED 交付;规定挂起/恢复及子流程的适用边界。 - [ ] 覆盖非法 Schema、缺少必填字段、类型错误、合法输入/输出、无 Schema、恢复和子流程。 - [ ] 错误包含可定位字段和错误类型;优先复用已有校验能力,不再建设竞争的通用定义体系,也不引入 Graph/Loop。 ## 关联与范围 关联 #197、#199、#209。该缺陷针对 Workflow 输入输出契约,不重复模型能力探测或单个 ToolCall 参数校验。 ## 验证基线与变更约束 审阅基线:Core `b34835354b27f1f320ea8438edf2e9d170e69c84` / Extensions `cb2635ab2fc338e8aade28a132a15f48b4e655fc`。以下为离线 stub、独立 Java 探针或候选工件编译验证的结果,不代表真实模型、外部服务或生产环境验收。 修复保持独立 ReAct/Workflow 不依赖 Graph/Loop,不向 Core 引入供应商 SDK。优先修正现有契约的执行行为;确需改变公开 API、配置或定义格式时,说明较小替代方案、收益、消费者影响、目标版本与迁移方式。不得以跳过测试或删除能力换取通过。
Activity
konlue commentedon Nov 8, 2026
您好,我想认领 #274。
方案
AgentResult.OutputValidationIssue(errorCode, fieldPath, message)的新WorkflowValidationException终止流,不以 COMPLETED 交付;AgentOutcome 公开 API 不动。ExecutionResult.continueWith包装丢失挂起点快照(data=null),挂起 outcome 构造必 NPE;②恢复时 continuation 被调用两次(executeSteps/Loop 的组合 lambda 重复 resume)——真实 agent 的 resumeToken 单次有效会拒绝第二次调用;组合步骤改为接收已恢复结果,恢复期 agent 恰好调用一次(测试断言)。测试
新增
WorkflowSchemaContractTest10 用例:非法 schema(input/output)、空白回归、无 schema 行为不变、缺必填输入(工具 0 执行,即 issue 复现场景反转)、类型错误 fieldPath 可定位、合法输入输出 COMPLETED、输出违规不交付、resume 合规完成 / resume 输出违规失败、子流程发布期校验 + 父运行不受重复把关。实现前同测试跑出 5F+2E(红),实现后 workflow-core 全模块 48/48 绿(含恢复期 agent 单次调用断言)。fix(workflow): validate declared input and output schemas at publish …
fix(workflow): resume the suspended continuation exactly once
fix(workflow): reject schemas that violate the draft 2020-12 meta-sch…
fix(workflow): validate declared input and output schemas at publish …
fix(workflow): resume the suspended continuation exactly once
fix(workflow): reject schemas that violate the draft 2020-12 meta-sch…
fix(workflow): preserve the remaining work across repeated suspension…
fix(workflow): keep the child resume token across repeated suspension…
Merge pull request #359 from konlue/feat/issue274-workflow-schema-con…