From 143b9628977463f6edbc5075b14e6d71fce3b0d6 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 21 Jul 2026 08:33:05 +0000 Subject: [PATCH] Restore code_source_path wiring in the air run-submit command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Terraform provider (v1.122.0) and SDK (v0.160.0) bumps dropped `code_source_path` from `ai_runtime_task`, and #5982 temporarily disabled its use in the `air` command. Re-enable the typed CodeSourcePath assignment in buildSubmitPayload and re-instate the corresponding test assertions. This does not build against SDK v0.160.0, which lacks jobs.AiRuntimeTask.CodeSourcePath; it is staged so it can be merged after the next SDK bump re-adds the field. The generated files (TF schema, dabs map, bundle schema, Python bindings, acceptance goldens) are intentionally left untouched — they reappear on codegen once the field returns. Co-authored-by: Isaac --- experimental/air/cmd/runsubmit.go | 6 +----- experimental/air/cmd/runsubmit_test.go | 14 +++++++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/experimental/air/cmd/runsubmit.go b/experimental/air/cmd/runsubmit.go index 8dbeffc109..8c0be55260 100644 --- a/experimental/air/cmd/runsubmit.go +++ b/experimental/air/cmd/runsubmit.go @@ -57,11 +57,7 @@ func buildSubmitPayload(cfg *runConfig, commandPath, dlImage string, snap snapsh AcceleratorCount: cfg.Compute.NumAccelerators, }, }}, - // TEMP: CodeSourcePath was removed from jobs.AiRuntimeTask in SDK v0.160.0 and - // is expected to return in a later SDK bump. Until then the snapshot path - // (snap.CodeSourcePath) cannot be carried on the typed task. Re-wire it here - // once the field is regenerated. - // CodeSourcePath: snap.CodeSourcePath, + CodeSourcePath: snap.CodeSourcePath, // TEMP: git_state_path / git_diff_path are intentionally NOT sent. The typed // jobs.AiRuntimeTask (and its source proto, ai_runtime_task.proto) has no such // fields, so the typed SDK path cannot carry them. This is safe today because diff --git a/experimental/air/cmd/runsubmit_test.go b/experimental/air/cmd/runsubmit_test.go index cc39bdff89..fd5103599d 100644 --- a/experimental/air/cmd/runsubmit_test.go +++ b/experimental/air/cmd/runsubmit_test.go @@ -2,6 +2,7 @@ package aircmd import ( "encoding/json" + "path/filepath" "strings" "testing" @@ -192,13 +193,12 @@ code_source: require.NoError(t, err) at := got.Tasks[0].AiRuntimeTask - require.NotNil(t, at) - // TEMP: CodeSourcePath was removed from jobs.AiRuntimeTask in SDK v0.160.0 and is - // expected to return in a later SDK bump. Until then the snapshot path cannot be - // carried on the typed task, so these assertions are disabled (see the TEMP note in - // buildSubmitPayload). The git_state sidecar upload is still covered by TestRunSnapshot. - // assert.Contains(t, at.CodeSourcePath, "/.air/repo_snapshots/"+filepath.Base(repo)+"/") - // assert.True(t, strings.HasSuffix(at.CodeSourcePath, ".tar.gz"), at.CodeSourcePath) + // The tarball path is under the user's repo_snapshots dir. git_state_path / + // git_diff_path are not asserted: the typed jobs.AiRuntimeTask has no such fields + // (see the TEMP note in buildSubmitPayload), so they aren't sent. The git_state + // sidecar file is still uploaded next to the tarball — covered by TestRunSnapshot. + assert.Contains(t, at.CodeSourcePath, "/.air/repo_snapshots/"+filepath.Base(repo)+"/") + assert.True(t, strings.HasSuffix(at.CodeSourcePath, ".tar.gz"), at.CodeSourcePath) } func TestSubmitWorkloadGuards(t *testing.T) {