mateclaw/mateclaw-server/src/main/java/vip/mate/workflow/runtime
倪程伟 20014c72ff
fix(workflow): activate approval notify + resolve→resume bridge (ISSUE #413 P0) (#414)
Two P0 fixes from ISSUE #413 — both address workflow await_approval
approvals that silently failed in production:

B1 — AwaitApprovalStepAdapter now dispatches the approval notice to
every channel in approverChannels that carries a target. Previously
approverChannels was write-only metadata: a workflow that declared
["feishu:oc_xxx"] silently dropped the notice and the IM group never
learned an approval was waiting. Element format is "channelType"
(no push, operator uses admin console) or "channelType:targetId".
Each channel failure is logged and skipped — it must not fail the step.

B2 — requestWorkflowApproval now registers the wf- approval into the
in-memory map via registerRecovered. Previously it only did
approvalMapper.insert, so getPending("wf-...") returned null,
performResolve short-circuited at the not-pending guard, the
WorkflowApprovalResolvedEvent was never published, and
ApprovalResumeBridge was dead code. With this fix, resolving a wf-
approval walks the full two-phase contract and the bridge fires.

Tests:
- WorkflowApprovalResumeBridgeTest (3): map registration, event
  publish on resolve, safe no-op for unregistered wf- ids.
- AwaitApprovalNotifyTest (2): targeted channels dispatched, bare
  "web" skipped, channel failure non-fatal.

Regression: ApprovalWorkflowServiceResolveTest (13), AwaitApprovalRuntimeTest (3),
DispatchChannelRuntimeTest (3), GcTest (7), RecoveryTest (7) — all green.
2026-06-25 09:54:55 +08:00
..
mode fix(workflow): activate approval notify + resolve→resume bridge (ISSUE #413 P0) (#414) 2026-06-25 09:54:55 +08:00
AgentInvoker.java feat(workflow): add linear runtime for the four base step modes 2026-05-08 15:04:07 +08:00
AgentStepExecutor.java feat(workflow): add linear runtime for the four base step modes 2026-05-08 15:04:07 +08:00
ApprovalResumeBridge.java fix(workflow,trigger): fan_out isolation + workspace spoof + approval→resume bridge + payload strict + draft clear 2026-05-08 15:08:41 +08:00
ChannelDispatcher.java feat(workflow): add dispatch_channel adapter for multi-channel delivery 2026-05-08 15:04:26 +08:00
DefaultAgentInvoker.java fix(workflow): PublishContext arg order + drop workspace-agnostic agent fallback 2026-05-08 15:07:32 +08:00
DefaultChannelDispatcher.java feat(workflow): add dispatch_channel adapter for multi-channel delivery 2026-05-08 15:04:26 +08:00
DefaultMemoryWriter.java feat(workflow): add write_memory adapter with four merge strategies 2026-05-08 15:04:33 +08:00
MemoryWriter.java feat(workflow): add write_memory adapter with four merge strategies 2026-05-08 15:04:33 +08:00
MergeStrategies.java feat(workflow): add write_memory adapter with four merge strategies 2026-05-08 15:04:33 +08:00
PayloadStore.java feat(workflow,trigger): async dispatch + GC schedulers + trigger list polish 2026-05-08 15:07:55 +08:00
StepAdapter.java feat(workflow): add linear runtime for the four base step modes 2026-05-08 15:04:07 +08:00
StepAdapterRegistry.java feat(workflow): add linear runtime for the four base step modes 2026-05-08 15:04:07 +08:00
StepResult.java feat(workflow): add await_approval pause / resume to the runtime 2026-05-08 15:04:16 +08:00
WorkflowCompletionEvent.java feat(workflow,trigger): wire workflow_completion as a real event source 2026-05-08 15:06:53 +08:00
WorkflowResumer.java feat(workflow,trigger): wire workflow_completion as a real event source 2026-05-08 15:06:53 +08:00
WorkflowRunContext.java fix(workflow,trigger): fan_out isolation + workspace spoof + approval→resume bridge + payload strict + draft clear 2026-05-08 15:08:41 +08:00
WorkflowRunner.java fix(workflow,trigger): fan_out isolation + workspace spoof + approval→resume bridge + payload strict + draft clear 2026-05-08 15:08:41 +08:00
WorkflowRunRequest.java feat(workflow): add linear runtime for the four base step modes 2026-05-08 15:04:07 +08:00
WorkflowRunResult.java feat(workflow): add linear runtime for the four base step modes 2026-05-08 15:04:07 +08:00