Skip to content

air logs: print waiting status when stderr is not a terminal - #7651

Closed
anshul0713 wants to merge 2 commits into
databricks:mainfrom
anshul0713:air-logs-non-tty-status
Closed

anshul0713 wants to merge 2 commits into
databricks:mainfrom
anshul0713:air-logs-non-tty-status

Conversation

@anshul0713

Copy link
Copy Markdown
Contributor

Changes

When stderr isn't a terminal, databricks air logs and databricks air run --watch now print each new waiting status as one line on stderr, for example Waiting for accelerator compute capacity to become available.... Interactive terminals still get the spinner, unchanged.

Why

While waiting for the first log line, the streamer shows a spinner, and on a non-interactive stderr cmdio drops the spinner entirely. Coding agents, CI and pipes therefore saw no output at all while a run waited for a GPU or provisioned. In agent trials of a 1x A10 training task, agents repeatedly killed air logs with timeout after 25-30 s, treating it as hung, and then guessed at the run's state.

The server status message is already fetched and only updated when it changes, so this adds at most a few lines per wait.

Tests

  • New TestStreamBricklensPrintsWaitingStatusWithoutTTY. It fails on main (empty stderr) and passes with this change.
  • TestLogsCommandRepeatsRunLinkAfterStreaming captures stdout and stderr in one non-TTY buffer, so its expected output now includes the waiting line.
  • go test ./cmd/air/... and go test ./acceptance -run TestAccept/air pass.

This pull request and its description were written by Isaac.

The "waiting for run to start" spinner degrades to nothing on a
non-interactive stderr, so agents and CI saw no output at all while a run
provisioned, and killed `air logs` as hung. Print each new waiting status
as one stderr line instead.

Co-authored-by: Isaac <no-reply@databricks.com>
(cherry picked from commit 0a2112c46e3462e3a661a1313825a3e7a2e2683b)
@anshul0713
anshul0713 requested review from a team as code owners November 16, 2026 04:23
@anshul0713
anshul0713 requested a review from pietern November 16, 2026 04:23
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution! This pull request was opened from a fork.

If you're a member of the Databricks organization, please request access to the cli-contrib team and open your pull request from a branch in this repository instead of a fork — fork PRs don't run integration tests automatically and have reduced CI access.

If you're an external contributor, no action is needed; a maintainer will review your pull request.

@github-actions github-actions Bot added the AIR Databricks AI Runtime CLI label Nov 16, 2026
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 7651
  • Commit SHA: 5ce70fc5fccfe9211b64eff2b25e05d7ccb5ef65

Checks will be approved automatically on success.

@anshul0713

Copy link
Copy Markdown
Contributor Author

Superseded by #7657: the same change, opened from a branch in this repo so the full CI and integration tests can run.

@anshul0713 anshul0713 closed this Nov 16, 2026
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.

1 participant