From 52c8df2322ecb76741de9509f696e6a20b736495 Mon Sep 17 00:00:00 2001 From: Doug Edgar Date: Fri, 3 Oct 2025 01:19:31 -0700 Subject: [PATCH] feat: auto-detect Console width (#3327) # What does this PR do? Addresses Issue #3271 - "Starting LLS server locally on a terminal with 120 chars width results in an output with empty lines". This removes the specific 150-character width limit specified for the Console, and will now auto-detect the terminal width instead. Now the formatting of Console output is consistent across different sizes of terminal windows. Closes #3271 ## Test Plan Launching the server with several different sizes of terminal windows results in Console output without unexpected spacing. e.g. `python -m llama_stack.core.server.server /tmp/run.yaml --port 8321` --------- Signed-off-by: Doug Edgar Co-authored-by: Matthew Farrellee --- .github/workflows/integration-auth-tests.yml | 2 ++ llama_stack/log.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-auth-tests.yml b/.github/workflows/integration-auth-tests.yml index 6787806e9..238fed683 100644 --- a/.github/workflows/integration-auth-tests.yml +++ b/.github/workflows/integration-auth-tests.yml @@ -84,6 +84,8 @@ jobs: yq eval '.server.auth.provider_config.jwks.token = "${{ env.TOKEN }}"' -i $run_dir/run.yaml cat $run_dir/run.yaml + # avoid line breaks in the server log, especially because we grep it below. + export COLUMNS=1984 nohup uv run llama stack run $run_dir/run.yaml --image-type venv > server.log 2>&1 & - name: Wait for Llama Stack server to be ready diff --git a/llama_stack/log.py b/llama_stack/log.py index 729b2b8c5..6f751b21d 100644 --- a/llama_stack/log.py +++ b/llama_stack/log.py @@ -128,7 +128,7 @@ def strip_rich_markup(text): class CustomRichHandler(RichHandler): def __init__(self, *args, **kwargs): - kwargs["console"] = Console(width=150) + kwargs["console"] = Console() super().__init__(*args, **kwargs) def emit(self, record):