Skip to content

Fix /setup environment selection (render Markdown table instead of scraping terminal)#166

Open
amilandi wants to merge 1 commit into
mainfrom
amilandin/setup-env-selection-fix
Open

Fix /setup environment selection (render Markdown table instead of scraping terminal)#166
amilandi wants to merge 1 commit into
mainfrom
amilandin/setup-env-selection-fix

Conversation

@amilandi

Copy link
Copy Markdown
Contributor

Problem

Running /setup and choosing "Yes, list my environments" frequently shows no environment table (or a truncated one), and Copilot Chat often doesn't know how to proceed.

Root cause: step1.md ran discover.py --list-environments (which prints a plain-text ASCII table to the terminal) and then asked the model to read that terminal output, parse every row, and rebuild each environment into a vscode_askQuestions picker. Copilot Chat truncates terminal scrollback and never surfaces the ASCII table to the user, so the reconstruction lost rows or failed entirely.

Fix

Stop relying on the model scraping the terminal. discover.py --list-environments now also writes a complete, numbered Markdown table to workspace/onboarding/environments.md and prints an ENV_TABLE_MARKDOWN:<path> marker. step1.md reads that file, shows the full table to the user verbatim, asks them to type the row number, then runs --select N.

Benefits: no terminal scraping, no picker reconstruction, the user always sees the full table, and it scales to any number of environments.

Changes

  • list_environments.py: new write_environment_markdown() (pipe-escaped names, (no Dataverse linked) placeholder).
  • discover.py: write the Markdown file and emit the ENV_TABLE_MARKDOWN: marker on the list (non-select) path.
  • src/skills/onboarding/step1.md: §1.1/§1.1a/§1.1b now render the table from the file and use number-entry selection with an invalid-number retry.
  • tests/scripts/test_discover.py: cover the Markdown writer (numbering, placeholder, pipe escaping).

Validation

  • New + existing tests/scripts/test_discover.py pass (16).
  • Pre-existing failures in test_installer_maker_profile.py are unrelated (they also fail on main).

…scraping the terminal

The onboarding flow asked Copilot Chat to read discover.py's plain-text
terminal table and rebuild every row into a vscode_askQuestions picker.
Copilot Chat truncates terminal scrollback and never surfaces that table
to the user, so the picker came up empty or truncated and selection often
failed.

Now discover.py --list-environments also writes a complete, numbered
Markdown table to workspace/onboarding/environments.md (printed as
ENV_TABLE_MARKDOWN:<path>). step1.md reads that file, shows the full table
to the user verbatim, and asks them to type the row number, then runs
--select N. No terminal scraping, no picker reconstruction; scales to any
number of environments.

- list_environments.py: add write_environment_markdown() (pipe-escaped,
  placeholder for no-Dataverse rows).
- discover.py: write the Markdown file + emit ENV_TABLE_MARKDOWN marker on
  the list (non-select) path.
- step1.md: render the table from the file; number-entry selection with
  invalid-number retry.
- tests: cover the Markdown writer (numbering, placeholder, pipe escaping).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nehaoss

nehaoss commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

👋 Friendly reminder: This PR has been inactive for a while. Could the author or reviewers take a look and either push it forward, request changes, or close it if it's no longer needed? Let's keep our PR queue healthy! 🚀

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.

2 participants