Skip to content

air: Shorten MLflow run names and IDs the same way in air list - #7582

Merged
dimk0 merged 5 commits into
mainfrom
cnxt-2611-mlflow-label
Nov 13, 2026
Merged

dimk0 merged 5 commits into
mainfrom
cnxt-2611-mlflow-label

Conversation

@dimk0

@dimk0 dimk0 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Changes

  • In air list, the MLflow column shows the run's name, or its run ID when the name is unknown, and shortens both the same way: a label wider than the column keeps its end behind a leading …. For example, qwen-finetune-2026-10-23-lr-3e-5 shows as …ne-2026-10-23-lr-3e-5 instead of qwen-finetune-2026-10….
  • An unnamed run shows as much of the end of its run ID as fits the column (…bcdef0123456789abcdef) instead of ... plus the last 8 characters.
  • air get and the air list info pane have no column to fit, so an unnamed run's MLflow Run field now shows the whole run ID instead of ... plus its last 8 characters. A named run is unchanged there.
  • air list cells are cut by display width, so a value with wide (for example CJK) characters no longer overflows its column. This applies to every column, not only MLflow: the shared truncate measured display width but cut by character count. truncateStart is its keep-the-end variant, which the MLflow label uses.

The link target and the JSON output are unchanged.

Why

The column cut a long run name to its beginning but showed the end of the run ID for an unnamed run. Run names often share a prefix and differ at the end, so rows with long names looked the same while unnamed rows stayed distinguishable. The complete run ID is behind the cell's link and in the info pane's MLflow URL; the complete name is on the linked MLflow page. Internal ticket: CNXT-2611.

The unnamed-run label used to mirror the Python CLI's ... plus last-8 format (_get_mlflow_run_name). It now differs on purpose, so that names and IDs follow one rule.

Tests

  • TestMLflowRunLabel covers a long name, a short name, a name exactly at the width, an unnamed run, a short ID, wide characters, and no width limit.
  • TestUnnamedOlderRetryLabelFitsTheListColumnAndIsWholeInTheInfoPane covers a shortened label followed by a retry note in the list row, and the whole run ID in the info pane.
  • TestTruncateFitsDisplayWidth covers truncate and truncateStart with wide characters, a cut that lands inside a wide character, combining marks, and widths of 0 to 2.
  • go test ./cmd/air, go test ./acceptance -run TestAccept/air/, ./task lint-q.
  • Not run against a live workspace.

This pull request and its description were written by Isaac.

The MLflow column of `air list` cut a long run name to its first
characters, but showed the last characters of the run ID when the run
had no name. Rows with long names sharing a prefix looked identical.

The column now shows the run's name, or its ID when the name is unknown,
and shortens either one the same way: a label that doesn't fit keeps its
end behind a leading "…".

Co-authored-by: Isaac <no-reply@databricks.com>
@dimk0
dimk0 requested review from a team as code owners November 12, 2026 23:43
@dimk0
dimk0 requested a review from simonfaltum November 12, 2026 23:43
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the AIR Databricks AI Runtime CLI label Nov 12, 2026
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 5b94fb6

Run: 43388398323

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 15 6:03
💚​ aws-windows-latest-4core-16gb 1 272 13 4:12
💚​ azure linux-2core-8gb 1 269 15 7:10
💚​ azure-windows-latest-4core-16gb 1 271 13 4:27
💚​ gcp linux-2core-8gb 1 270 15 6:13
💚​ gcp-windows-latest-4core-16gb 1 272 13 5:19
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 6 slowest tests (at least 2 minutes):
duration env testname
3:59 gcp-windows-latest-4core-16gb TestAccept
3:56 aws-windows-latest-4core-16gb TestAccept
3:55 azure linux-2core-8gb TestAccept
3:53 azure-windows-latest-4core-16gb TestAccept
3:52 gcp linux-2core-8gb TestAccept
3:45 aws linux-2core-8gb TestAccept

@maggiewang-db

Copy link
Copy Markdown
Contributor

Non-blocking: the shared truncate in list_tui_render.go still cuts by rune count, so wide (e.g. CJK) text overflows in the other air list columns; consider making truncate width-aware with a keep-the-end option and reusing it here instead of a separate loop in mlflowRunLabel (could be a follow-up).

dimk0 and others added 2 commits November 13, 2026 07:00
Covers the list row's width budget when a retry note follows a shortened
label, and the whole run ID in the info pane. Also corrects the label's
doc comment and widens the changelog entry to cover run IDs.

Co-authored-by: Isaac <no-reply@databricks.com>
truncate measured display width but cut by character count, so a cell
with wide (for example CJK) text overflowed its column. It now cuts by
display width. truncateStart is the keep-the-end variant, and the MLflow
label uses it instead of its own loop.

Co-authored-by: Isaac <no-reply@databricks.com>
@dimk0

dimk0 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member Author

Done in 60bd00e rather than as a follow-up: truncate now cuts by display width (via ansi.Truncate), so wide text no longer overflows the other air list columns, and truncateStart is the keep-the-end variant that mlflowRunLabel now reuses in place of its own loop. TestTruncateFitsDisplayWidth covers both with CJK text and combining marks.

@dimk0
dimk0 enabled auto-merge November 13, 2026 07:47
@dimk0
dimk0 added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit d06516a Nov 13, 2026
28 checks passed
@dimk0
dimk0 deleted the cnxt-2611-mlflow-label branch November 13, 2026 08:24
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

❌ Integration test report

Commit: d06516a

Run: 43393131862

Env ❌​FAIL 🟨​KNOWN 💚​RECOVERED ✅​pass 🙈​skip Time
❌​ aws linux-2core-8gb 39 1 11 1512 1290 289:06
❌​ aws-windows-latest-4core-16gb 41 1 11 1429 1317 297:56
❌​ azure linux-2core-8gb 39 1 11 1492 1298 267:51
❌​ azure-windows-latest-4core-16gb 41 3 9 1409 1325 280:42
❌​ gcp linux-2core-8gb 41 1 11 1497 1296 291:02
❌​ gcp-windows-latest-4core-16gb 39 1 11 1418 1323 294:55
57 interesting tests: 45 FAIL, 9 RECOVERED, 3 KNOWN
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K
❌​ TestAccept/bundle/dms/stale-plan ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestAccept/bundle/dms/stale-plan/DMS=true/READPLAN= ✅​p ✅​p ✅​p ❌​F ✅​p ✅​p
❌​ TestAccept/bundle/invariant/no_drift ✅​p ❌​F ✅​p ✅​p ✅​p ✅​p
❌​ TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=job_pydabs_10_tasks.yml.tmpl/READPLAN=1 ✅​p ❌​F ✅​p ✅​p ✅​p ✅​p
💚​ TestAccept/bundle/resources/apps/lifecycle-started 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-omitted 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-omitted/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-toggle 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-toggle/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-toggle/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
❌​ TestAccept/bundle/resources/postgres_branches/update_protected ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_branches/update_protected/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_branches/update_protected/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_branches/update_ttl ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_branches/update_ttl/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_branches/update_ttl/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_databases/update ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_databases/update/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_databases/update/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/remove_suspend_timeout ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/remove_suspend_timeout/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/remove_suspend_timeout/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/update_autoscaling ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/update_autoscaling/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/update_autoscaling/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/update_pg_settings ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/update_pg_settings/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/update_pg_settings/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/update_suspend_timeout ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/update_suspend_timeout/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_endpoints/update_suspend_timeout/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/add_default_endpoint_settings ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/add_default_endpoint_settings/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/add_default_endpoint_settings/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/remove_history_retention ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/remove_history_retention/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/remove_history_retention/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/update_default_endpoint_suspend ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/update_default_endpoint_suspend/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/update_default_endpoint_suspend/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/update_display_name ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/update_display_name/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/update_display_name/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/update_history_retention ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/update_history_retention/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_projects/update_history_retention/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_roles/update ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_roles/update/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/bundle/resources/postgres_roles/update/DMS=true ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
🟨​ TestAccept/bundle/resources/postgres_synced_tables/recreate 💚​R 💚​R 💚​R 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS= 💚​R 💚​R 💚​R 🟨​K 💚​R 💚​R
💚​ TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
❌​ TestAccept/bundle/templates/default-python/combinations/serverless ✅​p ✅​p ✅​p ✅​p ❌​F ✅​p
❌​ TestAccept/bundle/templates/default-python/combinations/serverless/DLT=yes/DMS=/NBOOK=no/PY=yes/READPLAN=1 ✅​p ✅​p ✅​p ✅​p ❌​F ✅​p
Top 50 slowest tests (at least 2 minutes):
duration env testname
11:56 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
10:24 azure linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
10:02 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
9:39 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
9:39 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
9:39 aws linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
9:27 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
9:24 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
9:23 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
9:15 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
9:13 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
9:10 aws linux-2core-8gb TestAccept/bundle/deploy/spark-jar-task/DMS=
9:07 aws linux-2core-8gb TestAccept/bundle/deploy/spark-jar-task/DMS=true
9:06 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
8:52 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
8:22 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
8:08 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
8:07 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=
7:55 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
7:46 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
7:43 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=
7:43 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=true
7:42 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=true
7:38 aws-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
7:34 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=
7:33 aws linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=
7:32 aws-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
7:30 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
7:27 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=1
7:24 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=
7:23 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
7:19 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=true
7:05 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=1
6:55 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
6:49 gcp linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
6:49 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=cluster.yml.tmpl/READPLAN=1
6:42 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=true
6:41 gcp linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=
6:31 azure-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
6:23 aws-windows-latest-4core-16gb TestAccept/bundle/deploy/spark-jar-task/DMS=
6:08 aws-windows-latest-4core-16gb TestAccept/bundle/deploy/spark-jar-task/DMS=true
6:06 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started-omitted/DMS=true
5:52 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
5:52 azure linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
5:37 gcp linux-2core-8gb TestAccept/bundle/deploy/spark-jar-task/DMS=
5:37 azure-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
5:34 aws linux-2core-8gb TestAccept/pipelines/run/refresh-flags
5:24 azure-windows-latest-4core-16gb TestAccept/pipelines/run/refresh-flags
5:24 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
5:22 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=

idelafuente-oc pushed a commit to idelafuente-oc/cli that referenced this pull request Nov 14, 2026
…databricks#7583)

## Changes

In the interactive `air list` table, the Experiment and User columns now
shrink to fit the terminal width instead of pushing the columns to their
right past the window edge.

- The list tracks the terminal width from `WindowSizeMsg` and lays the
columns out against it, on resize and when a lazily loaded page arrives.
- When the table is wider than the terminal, Experiment and User give up
cells, widest first, down to floors of 12 and 8 cells.
- A shortened Experiment keeps its end behind a leading `…`, the rule
databricks#7582 uses for the MLflow column, because experiment names often share a
prefix. A shortened User keeps its start, since emails differ there.
- The one-shot table (piped output, `NO_COLOR`, `--limit`) is unchanged,
including which end of a long Experiment it keeps.

This PR builds on databricks#7582 (merged), which provides `truncateStart` and the
display-width `truncate`.

Known gaps:

- The other columns have fixed widths, so the table only fits from about
136 columns up (measured on real runs; it depends on the statuses and
durations shown). In narrower terminals it is narrower than before but
the rightmost columns are still cut off. Fitting those widths means
shrinking or hiding fixed columns, which this PR doesn't do. Tracked
internally as CNXT-2619.
- The full experiment name is meant to be read in the info pane (`i`),
which shows `N/A` for many runs today. databricks#7587 fixes that.

## Why

Every column was sized from its content, with Experiment and User capped
at 36 cells, and nothing looked at the terminal width. With long
experiment names the table was about 180 cells wide, so the columns to
the right of Experiment were unreadable in most terminals. Internal
ticket: CNXT-2610.

In a 133-column terminal against real runs, cutting 14 distinct
experiment names to 12 cells at their end left 7 distinct labels;
keeping the end leaves all 14 distinct.

## Tests

- Unit tests for the width allocation at 80, 120, 134, 160 and 200
columns, for relayout on resize and on a lazily loaded page, for which
end each column keeps, and for the unchanged one-shot table.
- `go test ./cmd/air`, `./task lint-q`.

## Manual test

`air list --all-status --all-users` against a staging workspace in a
133-column terminal: Experiment shrank to 12 cells and User to 8. All 20
Experiment cells kept their end behind a leading `…`, and all 20 User
cells kept their start. The table was 136 cells wide, so the
`Accelerators` header lost its last 3 characters.

The list model with fixture rows, long Experiment and User values:

160 columns, w/o fix (cut at the window edge):
```
   Run ID           Experiment                            Status     Started              Duration    Progress  MLflow                  User
▸  684127395104822  /Users/someone.longname@example.com…  ● SUCCESS  2026-10-23T17:32:39    1h 14m           -  qwen-run-001            someone.with.a.long.name.for
```

160 columns, w/ fix:
```
   Run ID           Experiment               Status     Started              Duration    Progress  MLflow                  User                     Accelerators
▸  684127395104822  …art/qwen-finetune-lora  ● SUCCESS  2026-10-23T17:32:39    1h 14m           -  qwen-run-001            someone.with.a.long.na…  8x H100
```

120 columns, w/ fix (Accelerators still cut off):
```
   Run ID           Experiment    Status     Started              Duration    Progress  MLflow                  User
▸  684127395104822  …netune-lora  ● SUCCESS  2026-10-23T17:32:39    1h 14m           -  qwen-run-001            someone…
```

This pull request and its description were written by Isaac.

---------

Co-authored-by: Isaac <no-reply@databricks.com>
idelafuente-oc pushed a commit to idelafuente-oc/cli that referenced this pull request Nov 14, 2026
…` and `air get` (databricks#7601)

## Changes

- A new `stripControl` helper in `cmd/air` removes terminal escape
sequences (CSI, OSC, DCS, ...) and C0/C1 control characters from a
string. Printable text, including non-ASCII, is kept.
- It is applied where server-supplied names become display values:
- the MLflow run name as it is fetched (`fetchMLflowRunName`), before it
is shortened to the column width or written to the `air list` cache;
- every `air list` table cell (`cell`), which also covers rows read from
a cache written before this change;
- the Experiment, MLflow Run and User fields of the `air get` box and
the `air list` info pane (`renderFields`).
- JSON output and link targets are unchanged.
- The logs pane and `air logs` are out of scope: training logs
legitimately contain colour codes.

## Why

`air list` and `air get` printed the MLflow run name, experiment name
and user name exactly as the server sent them. A name carrying a
set-window-title sequence (OSC 0), a clear-screen sequence (CSI 2J) or a
carriage return reached the terminal of anyone who listed the run, for
example with `--all-users`, so whoever named a run could clear the
screen, retitle the window, write the clipboard (OSC 52) or overwrite a
line so a fake row appeared. Not code execution; low to moderate
severity. Pre-existing before databricks#7582. Internal ticket: CNXT-2620.

## Tests

- `TestStripControl`: OSC terminated by BEL and by ST, OSC 52, CSI
clear-screen and colour, carriage return, tab and newline, DEL, C1
controls, NUL, a two-byte escape sequence, a trailing ESC; plain and
non-ASCII text are unchanged.
- `TestFetchMLflowRunName` gains a case where the MLflow API returns a
name with an OSC, a CSI and a carriage return.
- `TestRenderFieldsStripsControlCharacters` and
`TestRenderRowStripsControlCharacters` cover the `air get` box and the
`air list` row, and check that column widths still line up.
- New acceptance test `acceptance/air/control-chars`: `air get` and `air
list` text output with escapes in the run name, experiment name and
creator; `air list -o json` shows the strings passed through unchanged.
Verified to fail without the fix.

This pull request and its description were written by Isaac.

---------

Co-authored-by: Dima Kotlyarov <dima.kotlyarov@your.hostname.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIR Databricks AI Runtime CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants