Skip to content

fix(ci): prevent hosted TUI PTY starvation - #119339

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ci-tui-pty-starvation
Aug 5, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ci-tui-pty-starvation

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

Closes #119327

What Problem This Solves

Fixes an issue where pull requests selecting the built local TUI PTY artifact lane could fail exact-head CI on GitHub-hosted runners even though the same TUI suite passed when run alone.

Four unrelated PR heads showed the same pattern: channel and core-support checks completed, then the real local Gateway fixture in the TUI suite stalled on request or connection deadlines. That leaves otherwise-correct contributor fixes unable to pass the native prepare/merge gate.

Why This Change Was Made

The built local TUI lane now runs after the other artifact checks and gets an explicit wait_checks boundary. Self-hosted runners retain their existing parallel channel, core-support, and Gateway-watch work; GitHub-hosted runners retain their existing serialized Gateway-watch path.

This does not change a timeout, assertion, retry, or product runtime. It gives the real Gateway fixture exclusive process and event-loop capacity, matching the workflow's existing hosted-runner treatment for Gateway watch.

User Impact

No product runtime behavior changes. Maintainers get reliable exact-head CI classification for TUI-touching pull requests instead of shared-runner starvation failures.

Production runtime LOC delta: 0.

Evidence

Observed concurrent failures:

Isolated controls:

Focused validation:

autoreview was attempted but its local Codex subprocess produced no review output; no clean autoreview result is claimed. The change was reviewed directly and is queued for exact-head ClawSweeper review.

AI-assisted: yes. The maintainer reviewed the exact diff, failure signatures, history, and validation evidence.

Punchcard-Session: cobalt-brook-meadow-m9

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Aug 4, 2026
@vincentkoc vincentkoc self-assigned this Aug 4, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 7:03 PM ET / 23:03 UTC.

ClawSweeper review

What this changes

The PR runs the built local TUI PTY smoke after other artifact checks, documents the ordering, and guards the three wait boundaries in workflow tests.

Regression provenance

Possible regression — probable (reproduction; failure trace; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking patch defect found. This is a focused, maintainer-owned CI repair with source-backed ordering coverage; keep it open for the current exact-head CI completion and maintainer merge decision.

Priority: P2
Reviewed head: 496ee23793541ea20ac4488441c60a357dc47586
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The small scheduling repair has strong source and reported hosted-CI evidence with no actionable patch defect; completion of the refreshed required checks remains the merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member, so external-contributor proof gating does not apply; the reported hosted exact-head CI output is still useful supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so external-contributor proof gating does not apply; the reported hosted exact-head CI output is still useful supplemental evidence.
Evidence reviewed 7 items Workflow owner boundary: The helper records each background check result and clears its PID/log arrays after each wait, so the new final wait captures the TUI result without changing the existing result aggregation.
Exclusive TUI ordering: The proposed head starts the built local TUI lane only after the initial artifact wait and any hosted Gateway-watch wait, then waits before publishing outputs.
Regression guard: The workflow guard asserts the initial wait, hosted Gateway-watch wait, final TUI wait, and all three wait calls rather than only counting a moved command.
Findings None None.
Security None None.

How this fits together

The build-artifacts CI job runs selected validation shards against the built CLI. Its TUI PTY smoke starts a real Gateway fixture, so it must not contend with other hosted-runner checks for process capacity.

flowchart LR
A[Preflight selection] --> B[Build artifacts job]
B --> C[Parallel channel and core checks]
C --> D[First wait boundary]
D --> E[Hosted Gateway watch if selected]
E --> F[Gateway wait boundary]
F --> G[Built local TUI PTY]
G --> H[Artifact check results]
Loading

Decision needed

Question Recommendation
After the current exact-head build-artifacts run completes, should this CI job accept the added serial TUI duration to preserve reliable hosted-runner classification? Merge after refreshed CI: Merge when the current head or clean merge result passes the workflow guard and build-artifacts job within the configured timeout.

Why: The patch deliberately trades CI wall time for deterministic fixture capacity, and this maintainer-authored, protected workflow change requires a human merge decision.

Before merge

  • Resolve merge risk (P2) - Serializing the TUI lane increases build-artifacts wall time; merge only after the current exact head completes the job within its timeout and remains clean against the current base.
Agent review details

Security

None.

PR surface

Tests +12, Docs 0, Config +3. Total +15 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 14 2 +12
Docs 1 2 2 0
Config 1 12 9 +3
Generated 0 0 0 0
Other 0 0 0 0
Total 3 28 13 +15

Review metrics

Metric Value Why it matters
Automation versus test delta workflow +12/-9; docs +2/-2; tests +14/-2 The only functional growth is explicit CI scheduling and its guard; no product-runtime code or configuration surface is added.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #119327
Summary: This PR is the candidate repair for the documented hosted build-artifacts TUI PTY contention.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Confirm exact-head capacity (recommended)
    Require the refreshed build-artifacts run and workflow guard to pass before merge so the new serial boundary is proven within the job budget.
  2. Accept the duration tradeoff
    Maintainers may accept the longer build-artifacts critical path if the hosted-runner reliability benefit remains the preferred CI policy.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Require the current-head workflow guard and build-artifacts job to pass after any base refresh.

Technical review

Best possible solution:

Keep the three-stage scheduling model: finish sibling artifacts, run hosted Gateway watch when selected, then run the real-Gateway TUI PTY smoke alone with the guard preserving those boundaries.

Do we have a high-confidence way to reproduce the issue?

Yes. The linked report gives a concrete hosted-runner path, while current source shows the TUI local smoke was launched beside sibling checks before this patch; the PR body supplies isolated and serialized-run evidence.

Is this the best way to solve the issue?

Yes. The workflow owns this resource-scheduling boundary, and moving only the real-Gateway TUI lane behind existing waits preserves the selected checks and avoids masking contention through timeout or retry changes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fb81d03d8eb2.

Labels

Label justifications:

  • P2: This is a bounded CI-reliability repair that affects pull-request validation rather than product runtime behavior.
  • merge-risk: 🚨 automation: The patch changes artifact-check scheduling, so an ordering or budget regression could alter CI classification after merge.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so external-contributor proof gating does not apply; the reported hosted exact-head CI output is still useful supplemental evidence.

Evidence

What I checked:

  • Workflow owner boundary: The helper records each background check result and clears its PID/log arrays after each wait, so the new final wait captures the TUI result without changing the existing result aggregation. (.github/workflows/ci.yml:1242, 496ee2379354)
  • Exclusive TUI ordering: The proposed head starts the built local TUI lane only after the initial artifact wait and any hosted Gateway-watch wait, then waits before publishing outputs. (.github/workflows/ci.yml:1294, 496ee2379354)
  • Regression guard: The workflow guard asserts the initial wait, hosted Gateway-watch wait, final TUI wait, and all three wait calls rather than only counting a moved command. (test/scripts/ci-workflow-guards.test.ts:4801, 496ee2379354)
  • TUI runtime contract: The TUI configuration includes the local smoke only when requested and is single-worker/non-file-parallel, confirming that this lane owns a real, timing-sensitive local run rather than an ordinary shard. (test/vitest/vitest.tui-pty.config.ts:25, 0d18bde84859)
  • Current-main comparison: The one current-main commit after the PR base changes command, QA, and environment-budget paths, not this workflow, docs page, or guard; the proposed scheduling fix remains distinct. (fb81d03d8eb2)
  • History and ownership: Workflow history places the TUI-related build-artifact change in commit cd4bd7c, while blame attributes the newly added exclusive block to this PR head. (.github/workflows/ci.yml:1294, cd4bd7c6c0ca)

Likely related people:

  • vincentkoc: Authored this repair and has multiple recent merged CI/workflow touches, including the current-main commit immediately after the PR base. (role: recent CI contributor; confidence: high; commits: 496ee2379354, 90a22b4f5022, 8f40fac955a6; files: .github/workflows/ci.yml, test/scripts/ci-workflow-guards.test.ts, docs/ci.md)
  • Peter Steinberger: History ties the original TUI-related build-artifact change to commit cd4bd7c, and shows repeated ownership of adjacent CI scheduling changes. (role: historic CI and TUI workflow contributor; confidence: high; commits: cd4bd7c6c0ca, 7a7c158210bc, 5a3c3b3f4f06; files: .github/workflows/ci.yml, docs/ci.md)
  • Shakker: Current blame attributes the existing Gateway-watch scheduling block immediately adjacent to this repair to commit a919f22. (role: recent surrounding workflow contributor; confidence: medium; commits: a919f22687f2; files: .github/workflows/ci.yml)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the current exact-head build-artifacts run complete, then merge only if it remains within the job budget after any base refresh.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-04T21:03:43.425Z sha 4b819fa :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T22:04:07.108Z sha 4b819fa :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc marked this pull request as ready for review August 4, 2026 21:25
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 4, 2026
Run the built local TUI PTY lane after the other artifact checks so its real Gateway fixture has exclusive process and event-loop capacity.

Punchcard-Session: cobalt-brook-meadow-m9
@vincentkoc
vincentkoc force-pushed the fix/ci-tui-pty-starvation branch from 4b819fa to 496ee23 Compare August 4, 2026 22:53
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 4, 2026
@vincentkoc
vincentkoc merged commit 9ff9aac into main Aug 5, 2026
118 of 120 checks passed
@vincentkoc
vincentkoc deleted the fix/ci-tui-pty-starvation branch August 5, 2026 00:00
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 5, 2026
Punchcard-Session: crisp-lantern-orchard-nv

* origin/main:
  perf(memory): defer session backfill runtime (#119372)
  fix(ci): isolate built TUI PTY fixture (#119339)
  fix(commands): restore tool inventory for dynamic models (#119306)
  fix(media): release rejected BytePlus and Runway video downloads under debug capture (#119257)
  docs: add ChromeOS (Crostini) platform install guide (#107663)
  test(msteams): serve JWKS from in-process server in auth coverage (#119354)
  fix(qa): enable OpenAI for stored audio scenario (#119349)
  test(agents): realpath apply-patch temp dir fixture (#119353)
  test(slack): drop redundant .js-suffixed system-event mock (#119352)
  fix(exec): leave safe builtins unrewritten in enforced mode (#119351)
  fix(sessions): keep gateway responsive while large transcript archives are built (#112424)
  fix(tui): restore provider auth in installed local mode (#119283)
vincentkoc added a commit that referenced this pull request Aug 5, 2026
…time

* origin/main:
  fix(ui): clear split-pane questions after answers and cancellations (#118787)
  fix(slack): authorize reaction and message reads before applying limits (#118736)
  fix(ci): isolate cache warmer configs (#119381)
  fix(slack): Fix bad escaping in slack tool commentary (#119373)
  feat(audit): add execution identity inspection (#117034)
  fix(fs): adopt fs-safe 0.5.2 untrusted filename sanitization (#119363)
  fix(ci): preserve release evidence across reruns (#119380)
  fix(telegram): keep commands responsive during Codex login
  perf(memory): defer session backfill runtime (#119372)
  fix(ci): isolate built TUI PTY fixture (#119339)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
Run the built local TUI PTY lane after the other artifact checks so its real Gateway fixture has exclusive process and event-loop capacity.

Punchcard-Session: cobalt-brook-meadow-m9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: built TUI PTY stalls under concurrent artifact shards

1 participant