Skip to content

fix(ci): recognize GUI token acquisition failures - #15449

Merged
teamleaderleo merged 2 commits into
manaflow-ai:mainfrom
Bortlesboat:codex/ci-gui-token-failures-20260928
Sep 29, 2026
Merged

teamleaderleo merged 2 commits into
manaflow-ai:mainfrom
Bortlesboat:codex/ci-gui-token-failures-20260928

Conversation

@Bortlesboat

@Bortlesboat Bortlesboat commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A runner that cannot acquire the GUI token fails before app-host tests start. CI currently classifies that hard error as unknown and suppresses otherwise eligible automatic retries; classify it as a machine failure.

Match the existing Could not take this Mac's gui token for the app-host tests error at the start of a log line or failure annotation. Quoted diagnostics and the ambiguous (or no passwordless sudo) warning do not override real test failures; a successful app-host shard prints that warning too.

Related: #15410. This covers direct GUI-token acquisition failures; the other environment faults and nested UI-dispatch attribution remain outside this patch.

Testing

  • python -X utf8 tests/test_ci_classify_failures.py: 3 expected failures at regression commit ca7517bd48; all 33 tests pass at fca9f4842e. Covers log and annotation inputs, retry eligibility, ambiguous warnings, echoed scripts, successful-step noise and diagnostics quoted in assertion failures.
  • WSL: python3 scripts/verify-local.py --all passes all 15 static checks.
  • WSL: python3 -m unittest discover -s tests -p test_ci_guard_attribution.py passes 35 tests; the same command with test_ci_ui_tests_dispatch.py passes 45 tests. The 33 classifier tests also pass under Linux.
  • Executed the existing workflow step with an isolated helper stub: statuses 0 and 2 succeed without a machine verdict; statuses 1 and 17 fail and produce machine/gui-token-unavailable.

Live macOS runner recovery was not exercised.

Post-Deploy Monitoring & Validation

On the next failed GUI-token acquisition, the attribution summary should show machine/gui-token-unavailable. Ordinary assertion failures containing the diagnostic must keep their code verdict.

Changelog

none

Checklist

  • Behavior changes have added or updated tests

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Fixes CI classifying a runner's GUI token acquisition failure as unknown, which suppressed otherwise eligible automatic retries. The failure is now classified as a machine failure and matches at the start of a log line or failure annotation.

  • Quoted diagnostics and the (or no passwordless sudo) warning do not override real test failures.
  • Adds regression tests covering log and annotation inputs, retry eligibility, ambiguous warnings, echoed scripts, and diagnostics quoted in assertion failures.

Written for commit fca9f48. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • CI runs that fail because a GUI token is unavailable are now classified as infrastructure failures and can be considered for reruns.
    • Test failures remain classified as test failures when logs also contain unrelated warnings or diagnostics.

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6bd44f23-7be3-4ff7-9cd2-288b2c8ec7f2

📥 Commits

Reviewing files that changed from the base of the PR and between 3d8bd6f and fca9f48.

📒 Files selected for processing (2)
  • scripts/ci/classify_failures.py
  • tests/test_ci_classify_failures.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The CI failure classifier now recognizes a GUI-token acquisition diagnostic as a machine failure. Tests cover classification precedence and rerun eligibility.

Changes

CI failure classification

Layer / File(s) Summary
Recognize GUI-token failures
scripts/ci/classify_failures.py, tests/test_ci_classify_failures.py
The classifier matches the GUI-token acquisition diagnostic as a machine failure. Tests check machine-failure classification, ensure other diagnostics do not override code-failure classification, and verify rerun eligibility.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: teamleaderleo

Merge Risk: ⚪ Minimal · up to fca9f

The app-host GUI-token setup failure is now recognized for existing retry handling without changing test-failure behavior. No material PR-introduced risk remains.

Security Architecture Review

Security architecture risk: 🔵 Low · up to fca9f

The change makes a GUI-token failure eligible for an existing automatic rerun path. It does not add rerun permissions or remove eligibility checks, but the decision still relies on text that a pull request can influence.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A pull-request author can influence failed-job output that reaches the classifier. A spoofed matching line can affect attribution and, if the existing eligibility checks pass, request a rerun of that CI run; the new signature does not grant a separate credential or rerun endpoint.

Trust Boundaries and Controls

  • observed — The existing trust transition is from job output to a workflow with rerun authority. Machine signatures are restricted to failed-step output or failure annotations, while open-PR, matching-head, all-machine, and attempt checks constrain the resulting write.

Resilience and Maintainability Implications

  • inferred — Repeated attribution follows the existing attempt checks and rerun-request failure handling. A successful rerun followed by failed UI dispatch can leave that dispatch absent, but the new signature does not change this shared partial-failure behavior.
🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (24 passed)
Check name Status Explanation
Description check ✅ Passed The description includes a clear Summary, detailed Testing results, a valid none Changelog entry for an internal CI change, monitoring notes, and the applicable checklist item. The Demo Video sectio…
Title check ✅ Passed The title clearly and concisely describes the primary change: recognizing GUI token acquisition failures in CI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Cloud Persistent Session And Early Input ✅ Passed PASS. The pull request changes only scripts/ci/classify_failures.py and its classifier tests. It adds a GUI-token failure signature and related test cases. It does not change Cloud terminal creation…
Cmux Swift Actor Isolation ✅ Passed PASS: The pull request changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. The authoritative diff contains no Swift files or production Swift changes, so it cannot…
Cmux Swift Blocking Runtime ✅ Passed PASS: The pull request changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. It introduces no production Swift changes and no blocking or timing-based Swift synchron…
Cmux Browser Automation Off-Main ✅ Passed The pull request changes only scripts/ci/classify_failures.py and its Python tests. The diff adds CI failure-signature classification for GUI-token errors. It does not change browser socket commands…
Cmux Expensive Synchronous Load ✅ Passed The pull request changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. The diff contains no Swift changes and no agent-history or synchronous load changes. The custo…
Cmux Cache Substitution Correctness ✅ Passed PASS: The review-scoped diff changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py, both Python files. It contains no production Swift, TypeScript, or JavaScript chan…
Cmux No Hacky Sleeps ✅ Passed PASS: The production diff only adds a regex-based GUI-token failure signature. It adds no sleep, timer, polling, delay, or wall-clock synchronization. The only timing-like text is --wait 1800 in a t…
Cmux Algorithmic Complexity ✅ Passed PASS. The production diff only adds one precompiled regex entry to the fixed SIGNATURES tuple in scripts/ci/classify_failures.py:100. The existing classifier scans log lines against this bounded s…
Cmux Swift Concurrency ✅ Passed PASS — The authoritative PR diff changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. It adds a Python failure signature and Python tests. It introduces no cmux-own…
Cmux Swift @Concurrent ✅ Passed PASS: The authoritative PR diff changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. It contains no Swift files or Swift concurrency changes, so `.github/review-bot…
Cmux Swift Package Boundaries ✅ Passed PASS: The pull request changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. The authoritative diff contains no Swift or app-target production changes, so the Swift …
Cmux Swiftpm Lockfiles ✅ Passed The PR changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. It does not change a SwiftPM package, Xcode project, .gitignore, workflow, dependency declaration, or …
Cmux Swift Logging ✅ Passed PASS: The pull request changes only Python CI classification code and Python tests. It adds no production Swift files or Swift logging statements. The added GUI-token text is a CI diagnostic signature…
Cmux User-Facing Error Privacy ✅ Passed PASS. The production change is confined to the internal CI failure classifier. It adds a machine-failure signature and an operator diagnostic for GUI-token acquisition. The workflow uses this output i…
Cmux Full Internationalization ✅ Passed PASS: The PR changes only CI failure classification and its Python tests. The added English text is a machine-failure signature and runner-attribution reason used in operational CI logs/PR attribution…
Cmux Swiftui State Layout ✅ Passed PASS: The pull request changes only Python files (scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py). The diff contains no Swift or SwiftUI changes, so the SwiftUI state-layou…
Cmux Architecture Rethink ✅ Passed PASS. The pull request changes only scripts/ci/classify_failures.py and its Python tests; it introduces no Swift code or Swift UI lifecycle wiring. The source change adds one local SIGNATURES entr…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS. The pull request changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. It contains no Swift changes and does not add or modify cmux-owned windows.
Cmux Source Artifacts ✅ Passed PASS. The PR changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. These are intentional hand-written source and test files. The diff adds a failure signature and re…
Cmux No Test Or Debug Seam In Production Source ✅ Passed The pull request changes only scripts/ci/classify_failures.py and tests/test_ci_classify_failures.py. It changes no Swift file under a production Sources/ path, so it cannot introduce a producti…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@teamleaderleo teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you :)

@teamleaderleo
teamleaderleo merged commit 799f906 into manaflow-ai:main Sep 29, 2026
49 of 50 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for fca9f4842e: every check was green at merge (10 verified; 14 skipped by policy). Full suite runs on main after merge.

rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 29, 2026
4e0f7d2 fix(bash): keep $? for PROMPT_COMMAND hooks after cmux's (manaflow-ai#15255)
ae49bf5 fix(examples): show custom description in Project Worktrees sidebar (manaflow-ai#15256)
a9a229d Add cross-provider token usage accounting for agent transcripts (manaflow-ai#15332)
860619f Add a .worktreeinclude reader for seeding new worktrees (manaflow-ai#15413)
3edbd83 Clear the stale Needs input badge when Claude's permission is decided in the terminal (manaflow-ai#15170)
9ed9294 CodeRouter: hold capacity errors on the same model instead of failing fast (manaflow-ai#15310)
56d4547 docs: add a front door for outside contributors (manaflow-ai#15263)
799f906 fix(ci): recognize GUI token acquisition failures (manaflow-ai#15449)
f118d43 ci: age parked builds by measured reuse distance (manaflow-ai#15616)
1f6744d ci: harden overflow switch recovery (manaflow-ai#15617)
9987778 Predicted echo: remote terminals only, withdraw on pasted and sent input (manaflow-ai#15211)
d9e199b Subtle selection follow-ups: group header hairline, no focus re-render for legacy rows, cmux.json test (manaflow-ai#15195)
c13afe1 test: cover UTF-8 workspace create commands (manaflow-ai#15622)
e76a660 fix: preserve Claude remote-control names on restore (manaflow-ai#15619)
900f248 feat: expose cmux-owned scratch metadata in session listing (manaflow-ai#15615)
b5604fa ci: say why compiled-product reuse refused an artifact (manaflow-ai#15553)

# Conflicts:
#	.github/workflows/ci-cloud-overflow-probe.yml
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