@@ -175,6 +175,7 @@ describe("cross-OS release checks workflow", () => {
175175 candidate_sha256 : "${{ needs.prepare_release_package.outputs.package_sha256 }}" ,
176176 candidate_source_sha : "${{ needs.prepare_release_package.outputs.source_sha }}" ,
177177 candidate_version : "${{ needs.prepare_release_package.outputs.package_version }}" ,
178+ candidate_artifact_json : "${{ inputs.candidate_artifact_json }}" ,
178179 } ) ;
179180
180181 expect ( job ( release , "docker_e2e_release_checks" ) . with ) . toMatchObject ( {
@@ -214,6 +215,7 @@ describe("cross-OS release checks workflow", () => {
214215 "candidate_sha256" ,
215216 "candidate_source_sha" ,
216217 "candidate_version" ,
218+ "candidate_artifact_json" ,
217219 ] ) {
218220 expect ( workflow . on ?. workflow_dispatch ?. inputs ?. [ inputName ] , inputName ) . toMatchObject ( {
219221 default : "" ,
@@ -238,6 +240,14 @@ describe("cross-OS release checks workflow", () => {
238240 candidate_artifact_run_id : "${{ github.run_id }}" ,
239241 candidate_sha256 : "${{ steps.candidate_metadata.outputs.sha256 }}" ,
240242 candidate_version : "${{ steps.candidate_metadata.outputs.version }}" ,
243+ codex_plugin_file_name : "${{ steps.codex_plugin_metadata.outputs.file_name }}" ,
244+ codex_plugin_sha256 : "${{ steps.codex_plugin_metadata.outputs.sha256 }}" ,
245+ prepublish_plugin_registry_artifact_id :
246+ "${{ steps.upload_generated_plugin_registry.outputs.artifact-id || fromJSON(inputs.candidate_artifact_json || '{}').prepublishPluginRegistryArtifactId || '' }}" ,
247+ prepublish_plugin_registry_artifact_run_attempt :
248+ "${{ steps.upload_generated_plugin_registry.outputs.artifact-id && github.run_attempt || fromJSON(inputs.candidate_artifact_json || '{}').prepublishPluginRegistryArtifactRunAttempt || '' }}" ,
249+ prepublish_plugin_registry_artifact_run_id :
250+ "${{ steps.upload_generated_plugin_registry.outputs.artifact-id && github.run_id || fromJSON(inputs.candidate_artifact_json || '{}').prepublishPluginRegistryArtifactRunId || '' }}" ,
241251 source_sha : "${{ steps.candidate_metadata.outputs.source_sha }}" ,
242252 } ) ;
243253 for ( const [ jobName , workflowJob ] of Object . entries ( workflow . jobs ) ) {
@@ -371,6 +381,65 @@ describe("cross-OS release checks workflow", () => {
371381 expect ( verify . run ) . toContain ( '"$actual_baseline_sha256" != "$EXPECTED_BASELINE_SHA256"' ) ;
372382 } ) ;
373383
384+ it ( "binds OpenAI onboarding to the exact prerelease Codex companion" , ( ) => {
385+ const workflow = readWorkflow ( WORKFLOW_PATH ) ;
386+ const prepare = job ( workflow , "prepare" ) ;
387+ const binding = step ( prepare , "Validate prerelease plugin registry artifact binding" ) ;
388+ expect ( binding . run ) . toContain ( 'verify-upload "Prerelease plugin registry"' ) ;
389+ expect ( binding . env ) . toMatchObject ( {
390+ ARTIFACT_ID :
391+ "${{ fromJSON(inputs.candidate_artifact_json || '{}').prepublishPluginRegistryArtifactId || '' }}" ,
392+ ARTIFACT_RUN_ID :
393+ "${{ fromJSON(inputs.candidate_artifact_json || '{}').prepublishPluginRegistryArtifactRunId || '' }}" ,
394+ MANIFEST_SHA256 :
395+ "${{ fromJSON(inputs.candidate_artifact_json || '{}').prepublishPluginRegistryManifestSha256 || '' }}" ,
396+ } ) ;
397+
398+ const sourceCheckout = step ( prepare , "Checkout public source ref" ) ;
399+ expect ( sourceCheckout . if ) . toContain ( "inputs.provider == 'openai'" ) ;
400+ expect ( sourceCheckout . with ?. ref ) . toBe (
401+ "${{ inputs.candidate_artifact_name != '' && inputs.candidate_source_sha || inputs.ref }}" ,
402+ ) ;
403+ expect ( step ( prepare , "Install companion plugin build dependencies" ) . run ) . toBe (
404+ "pnpm install --frozen-lockfile --prefer-offline --ignore-scripts" ,
405+ ) ;
406+ const pack = step ( prepare , "Pack exact Codex companion plugin" ) ;
407+ expect ( pack . run ) . toContain ( "prepublish-plugin-registry-artifact.mjs create" ) ;
408+ expect ( pack . run ) . toContain ( "--repo-root source" ) ;
409+ expect ( pack . run ) . toContain ( `--required-packages-json '["@openclaw/codex"]'` ) ;
410+
411+ const metadata = step ( prepare , "Resolve exact Codex companion plugin" ) ;
412+ expect ( metadata . run ) . toContain ( 'any(.name == "@openclaw/codex")' ) ;
413+ expect ( metadata . run ) . toContain ( "prepublish-plugin-registry-artifact.mjs verify" ) ;
414+ expect ( metadata . run ) . toContain ( '--source-sha "$SOURCE_SHA"' ) ;
415+ expect ( metadata . run ) . toContain ( '--candidate-version "$CANDIDATE_VERSION"' ) ;
416+ expect ( metadata . run ) . toContain ( "entry.tarball !== path.win32.basename(entry.tarball)" ) ;
417+ expect (
418+ step ( prepare , "Upload generated prerelease plugin registry artifact" ) . with ,
419+ ) . toMatchObject ( {
420+ name : "openclaw-cross-os-release-checks-plugins-${{ github.run_id }}-${{ github.run_attempt }}" ,
421+ "if-no-files-found" : "error" ,
422+ } ) ;
423+
424+ const consumer = job ( workflow , "cross_os_release_checks" ) ;
425+ const download = step ( consumer , "Download prerelease plugin registry artifact" ) ;
426+ expect ( download . with ) . toMatchObject ( {
427+ "artifact-ids" : "${{ needs.prepare.outputs.prepublish_plugin_registry_artifact_id }}" ,
428+ "run-id" : "${{ needs.prepare.outputs.prepublish_plugin_registry_artifact_run_id }}" ,
429+ } ) ;
430+ const verify = step ( consumer , "Verify release-check inputs" ) ;
431+ expect ( verify . run ) . toContain ( '"$actual_codex_sha256" != "$EXPECTED_CODEX_PLUGIN_SHA256"' ) ;
432+
433+ const run = step ( consumer , "Run cross-OS release checks" ) ;
434+ expect ( run . env ?. CODEX_PLUGIN_FILE_NAME ) . toBe (
435+ "${{ needs.prepare.outputs.codex_plugin_file_name }}" ,
436+ ) ;
437+ expect ( run . run ) . toContain ( "OPENCLAW_ALLOW_PLUGIN_INSTALL_OVERRIDES=1" ) ;
438+ expect ( run . run ) . toContain (
439+ "JSON.stringify({ codex: `npm-pack:${process.env.CODEX_PLUGIN_TGZ}` })" ,
440+ ) ;
441+ } ) ;
442+
374443 it ( "executes the release harness directly with Node" , ( ) => {
375444 const wrapper = readFileSync ( WRAPPER_PATH , "utf8" ) ;
376445 const script = readFileSync ( SCRIPT_PATH , "utf8" ) ;
0 commit comments