From 78dedef9b34a4b8cd1dbc90e3bc76cded0394543 Mon Sep 17 00:00:00 2001 From: Durable Workflow Date: Mon, 31 Aug 2026 16:26:15 +0000 Subject: [PATCH] Fix child-workflow conformance worker registration --- scripts/conformance/child-workflows-runtime-probe.php | 11 +++++++++++ tests/Unit/ChildWorkflowRuntimeContractTest.php | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/scripts/conformance/child-workflows-runtime-probe.php b/scripts/conformance/child-workflows-runtime-probe.php index 1d68a312..775d48b1 100644 --- a/scripts/conformance/child-workflows-runtime-probe.php +++ b/scripts/conformance/child-workflows-runtime-probe.php @@ -267,10 +267,21 @@ function cw_require_child_event(array $history, string $eventType, string $child throw new RuntimeException(sprintf('%s did not reference child run %s', $eventType, $childRunId)); } +/** @return array */ +function cw_capability_manifest(): array +{ + return array_fill_keys(WorkerProtocol::PORTABLE_WORKER_AFFINITY_CAPABILITIES, [ + 'supported' => false, + 'minimum_protocol_version' => WorkerProtocol::PORTABLE_WORKER_AFFINITY_MINIMUM_PROTOCOL_VERSION, + 'reason' => 'not_implemented', + ]); +} + /** @param list $types */ function cw_register(string $workerId, string $queue, string $runtime, array $types): void { cw_request('POST', '/worker/register', [ + 'capability_manifest' => cw_capability_manifest(), 'worker_id' => $workerId, 'task_queue' => $queue, 'runtime' => $runtime === 'workflow-php' ? 'php' : 'python', diff --git a/tests/Unit/ChildWorkflowRuntimeContractTest.php b/tests/Unit/ChildWorkflowRuntimeContractTest.php index ffd75956..a4db1124 100644 --- a/tests/Unit/ChildWorkflowRuntimeContractTest.php +++ b/tests/Unit/ChildWorkflowRuntimeContractTest.php @@ -355,6 +355,14 @@ public function test_published_artifact_runner_routes_every_unexecuted_child_wor $this->assertStringContainsString('output_sample', $installProbe); $this->assertStringContainsString('WorkflowFiberRunner::forClass(', $runtimeProbe); $this->assertStringContainsString('cw_failure_cell(', $runtimeProbe); + $this->assertStringContainsString( + "'capability_manifest' => cw_capability_manifest(),", + $runtimeProbe, + ); + $this->assertStringContainsString( + 'WorkerProtocol::PORTABLE_WORKER_AFFINITY_CAPABILITIES', + $runtimeProbe, + ); $this->assertStringContainsString( '$parentRuntimeResult = $parentResume[\'observation\'][\'runtime_result\'] ?? null;', $runtimeProbe,