Skip to content

AIR CLI Integration: show environment for AI Runtime runs in air get - #6244

Merged
riddhibhagwat-db merged 1 commit into
air-clifrom
air-get-environment-from-config
Aug 12, 2026
Merged

AIR CLI Integration: show environment for AI Runtime runs in air get#6244
riddhibhagwat-db merged 1 commit into
air-clifrom
air-get-environment-from-config

Conversation

@riddhibhagwat-db

@riddhibhagwat-db riddhibhagwat-db commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

air get's Environment cell always showed N/A for AI Runtime (serverless) runs — the kind air run submits.

The environment version those runs use lives on the run's environments[].spec.environment_version (keyed by the task's environment_key), but the typed SDK jobs.Run struct has no environments field, so w.Jobs.GetRun silently drops it and the cell fell back to N/A.

The cell is now resolved from that field via a raw GetRun request, matching the entry keyed "default" (aiRuntimeEnvironmentKey).

The previous gen_ai_compute runtime-image source (DlRuntimeImage) is dropped rather than special-cased — that path is deprecated, so gen_ai_compute runs now show N/A for the environment.

Changes

  • experimental/air/cmd/render.go: new aiRuntimeEnvironmentVersion helper — a raw GET to /api/2.2/jobs/runs/get that decodes only the environments[] array the typed SDK drops (same raw-call pattern as usagepolicy.go / aitraining.go). Best-effort: logs and returns "" on any error or when the run declares no environment. renderRunText sets the cell from it (empty → stays N/A).
  • experimental/air/cmd/get.go: buildGetData no longer seeds the cell from the gen_ai DlRuntimeImage; environment is resolved at render time (it needs an extra API call).
  • experimental/air/cmd/format.go: removed the now-unused environment(run) helper.

Testing

  • experimental/air/get-ai-runtime acceptance test: mock runs/get now returns an environments block; golden asserts Environment 4.
  • experimental/air/get (gen_ai) acceptance test: golden updated to Environment N/A (deprecated path).
  • render_test.go updated; go test ./experimental/air/... and go test ./acceptance -run TestAccept/experimental/air pass; package lints clean.
  • Verified live: air get 796253027111946 shows Environment 4.

Manual verification:
Screenshot 2026-08-11 at 5 09 28 PM

@riddhibhagwat-db riddhibhagwat-db changed the title air: show environment for AI Runtime runs in air get AIR CLI Integration: show environment for AI Runtime runs in air get Aug 11, 2026
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 4c43416

Run: 31641815400

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 291 1104 4:48
💚​ aws windows 4 4 293 1102 4:04
💚​ azure linux 4 4 290 1104 4:06
💚​ azure windows 4 4 292 1102 4:46
💚​ gcp linux 1 5 291 1104 4:57
💚​ gcp windows 1 5 293 1102 3:35
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 1 slowest tests (at least 2 minutes):
duration env testname
2:38 azure windows TestAccept

@riddhibhagwat-db
riddhibhagwat-db changed the base branch from main to air-cli August 12, 2026 00:46
@riddhibhagwat-db
riddhibhagwat-db force-pushed the air-get-environment-from-config branch from 8d0a6af to 71a6aed Compare August 12, 2026 02:25
@riddhibhagwat-db
riddhibhagwat-db changed the base branch from air-cli to main August 12, 2026 02:27
@riddhibhagwat-db
riddhibhagwat-db force-pushed the air-get-environment-from-config branch from 71a6aed to acbcdef Compare August 12, 2026 21:00
@riddhibhagwat-db
riddhibhagwat-db changed the base branch from main to air-cli August 12, 2026 21:13
`air get`'s Environment cell always showed "N/A" for AI Runtime
(serverless) runs. Their environment version lives on the run's
environments[].spec (keyed by the task's environment_key), but the typed
SDK Run struct has no environments field, so w.Jobs.GetRun drops it.

Resolve the Environment cell from that field via a raw GetRun request,
keyed by aiRuntimeEnvironmentKey. The gen_ai_compute runtime-image source
is dropped rather than special-cased: that path is deprecated, so gen_ai
runs now show "N/A" for the environment.

Co-authored-by: Isaac
@riddhibhagwat-db
riddhibhagwat-db force-pushed the air-get-environment-from-config branch from acbcdef to 4c43416 Compare August 12, 2026 21:15
@riddhibhagwat-db
riddhibhagwat-db merged commit e8b5d5f into air-cli Aug 12, 2026
42 checks passed
@riddhibhagwat-db
riddhibhagwat-db deleted the air-get-environment-from-config branch August 12, 2026 21:53
riddhibhagwat-db added a commit that referenced this pull request Aug 13, 2026
## Summary

**#6153 ("AIR CLI Migration: `--download-to` flag for logs") was lost
from `air-cli`.** It merged on 2026-08-06, but `air-cli` was later
rewound to `1fcb3c09a` before #6239 merged (08-12), and the rebuilt line
(#6239#6244#6241) bypassed #6153. As a result `air-cli` today
still carries the **pre-#6153 stub**:

- `logs.go`: `--download-to is not implemented yet` (the flag is
rejected)
- no `logdownload.go` / `logdownload_test.go`
- no `acceptance/experimental/air/logs-download/` test dir

This PR restores #6153's change set onto the current `air-cli` tip.

## How

Cherry-pick of #6153's original squash commit (`60cd876910cd`) onto
`air-cli`. Verified equivalence to the original:

- Every file except `logstream.go` is **byte-identical** to what #6153
landed.
- `logstream.go` is re-merged against #6241's later edits to that file
(git auto-merged it cleanly; both changes coexist).

## Testing

- `go build ./experimental/air/...` — ok
- `go test ./experimental/air/...` — 548 pass
- `go test ./acceptance -run TestAccept/experimental/air` — 29 pass
(incl. `logs` and the restored `logs-download`)
- Package lints clean
- Confirmed the `--download-to is not implemented` stub is gone and
`logs.go` now wires the real implementation

This pull request and its description were written by Isaac.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants