Skip to content

ci: Drive Windows integration TUIs through ConPTY - #1058

Open
max-rozen-oss-db wants to merge 22 commits into
mainfrom
max-rozen-oss-db/stack/windows-conpty
Open

max-rozen-oss-db wants to merge 22 commits into
mainfrom
max-rozen-oss-db/stack/windows-conpty

Conversation

@max-rozen-oss-db

@max-rozen-oss-db max-rozen-oss-db commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Drives interactive agents through ConPTY on Windows so the integration suite's TUI modules run there instead of being filtered out.

  • tests/integration/utils/terminal.py: the PTY layer is PosixPty (pexpect, unchanged) or ConPty (pywinpty), picked by os.name. ConPTY reads on a daemon thread, launches .cmd/.bat through cmd.exe /c, and tears down with taskkill /T.
  • Codex on Windows: the harness seeds [windows] sandbox = "unelevated" before each Codex launch, so the TUI skips its sandbox picker. boot() matches the trust-directory dialog with either path separator and answers it again if it is still up after 10s (Codex can drop the first Enter during startup). Codex asks before every shell command there, so approve_windows_command approves each prompt (Codex on Windows only; any other agent's prompt still fails). This keeps these journeys testing ug rather than the model's choice of command; the task only reads a fixture on a throwaway runner with the non-admin sandbox. Approval waits until the prompt's options render.
  • Windows ports of Claude/Codex journeys: retry reading the Smart Router controls file while ug replaces it, split apiKeyHelper with split_command (CreateProcess rules), compare the helper without .EXE, read user settings where Linux reads /etc managed settings, seed the Codex sandbox in the lifecycle test's own config.toml, read transcripts as UTF-8.
  • scripts/run_integration.py: Windows live runs keep the PTY modules and install pywinpty==3.0.5; WINDOWS_UNSUPPORTED_NODES deselects the managed-settings seeding journey (ug has no Windows managed-settings path) and, until ug's session-env fix lands, the Codex Smart Router skill toggle (Codex's Windows sandbox can't read ug's owner-only session-env dir).
  • tests/test_e2e_cuj_helpers.py: the fake ug is a Python script with a ug.cmd or /bin/sh launcher, so the Terminal tests run on Windows. Two newer tests whose fakes drive the tty with termios stay skipped there.

Verification

  • Windows 11 VM (ARM64): the Codex configure and custom-OAuth journeys pass 15/15 across three runs; the full Codex live suite passed 35/35 earlier. tests/test_e2e_cuj_helpers.py, tests/test_integration_runner.py, and tests/test_integration_contract.py pass.
  • CI: Claude Windows full journeys pass. Codex Windows journeys kept failing on new command shapes from the model (pipes, ;/&& chains, scripts with if/throw, [IO.File]::ReadAllText); an allowlist couldn't keep up and approval_policy = "never" didn't stop the prompts, so the test now approves them.
  • Found along the way and fixed separately in Keep the current PATH ahead of saved Windows user entries #1073: ug's Windows PATH refresh put the saved user PATH first, so a second ug or agent install could win.

This pull request and its description were written by the Isaac LLM tool (Claude Code, session 053e9e2b-b4dd-41dc-9287-b081cc6ed1bc).

Base automatically changed from windows-ci to main October 8, 2026 21:29
Co-authored-by: Isaac <no-reply@databricks.com>
@max-rozen-oss-db
max-rozen-oss-db force-pushed the max-rozen-oss-db/stack/windows-conpty branch from 333f47d to 53aaef6 Compare October 8, 2026 21:38
max-rozen-oss-db and others added 4 commits October 8, 2026 17:42
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…ys on Windows

Co-authored-by: Isaac <no-reply@databricks.com>
@max-rozen-oss-db
max-rozen-oss-db marked this pull request as ready for review October 9, 2026 01:08
max-rozen-oss-db and others added 8 commits October 8, 2026 22:47
…uite node ID

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…ture reads

Co-authored-by: Isaac <no-reply@databricks.com>
The trust-directory dialog check was using strict regex patterns that relied on
exact character matching for the selection indicator. On Windows ConPTY, the
selection character may render differently, causing the dialog to not be
recognized and tests to timeout waiting for the usable prompt.

Simplify the dialog detection by checking for the dialog text and option text
using case-insensitive substring matching instead of strict regex patterns.

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

The regex pattern has no f-string placeholders, so it should use r""
instead of rf"".

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
max-rozen-oss-db and others added 9 commits October 9, 2026 11:53
The glyph is a real › on screen; U+FFFD only appeared in CI's cp1252 log output.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
The model's command shapes kept outrunning a read-only allowlist, so approve each
prompt and keep these journeys testing ug. Also retry the Smart Router controls read
while ug replaces the file on Windows.

Co-authored-by: Isaac <no-reply@databricks.com>
The sandbox picker's arrow-key navigation could land on Quit when keys arrived late, so
seed the choice before launch instead. Codex can drop the first Enter on the trust dialog
during startup, so answer it again if it stays up. Wait for approval options to render.

Co-authored-by: Isaac <no-reply@databricks.com>
…env fix

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant