Skip to content

fix: remove immediate foreground terminal bypass#4592

Closed
nwparker wants to merge 1 commit into
mainfrom
nwparker/simplify-opentui-foreground-fix
Closed

fix: remove immediate foreground terminal bypass#4592
nwparker wants to merge 1 commit into
mainfrom
nwparker/simplify-opentui-foreground-fix

Conversation

@nwparker

@nwparker nwparker commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Diagnosis

I did not complete a true historical bisect before merging #4585. That PR fixed the repros, but it stacked a budget on top of the suspect code. This follow-up narrows the bad code more directly.

Controlled replay results on a diagnosis branch:

So the bad hunk is #4039's immediate foreground bypass for <=2KB chunks / recent ANSI redraws, not the scheduler machinery as a whole.

Refs #4039, #4558, #4559, #4581, #4585.

Test plan

Rebased on origin/main at 843d969c7d; branch head bc424c9217.

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts src/main/git/status-upstream-probe-churn.test.ts
    • Passed: 116 tests
  • pnpm typecheck
  • pnpm exec oxfmt --check src/renderer/src/components/terminal-pane/pty-connection.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • pnpm exec oxlint src/renderer/src/components/terminal-pane/pty-connection.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • pnpm test
    • Passed: 13,550 tests; 11 skipped
  • npx playwright test tests/e2e/terminal-foreground-redraw-freeze.spec.ts --config tests/playwright.config.ts --project electron-headless -g "captured OpenCode/OpenTUI" --reporter=json > .tmp/simplify-rebased-terminal-captured.json
    • Passed: elapsed=363.9ms maxTimerDrift=334.1ms samples=1 foregroundWrites=74063 deferredForegroundEnqueues=74063 deferredForegroundWrites=1 scheduledDrains=2
  • SKIP_BUILD=1 npx playwright test tests/e2e/terminal-foreground-redraw-freeze.spec.ts --config tests/playwright.config.ts --project electron-headless -g "active OpenTUI-style" --reporter=json > .tmp/simplify-rebased-terminal-synthetic.json
    • Passed: elapsed=34.8ms maxTimerDrift=2.7ms samples=2 foregroundWrites=270 deferredForegroundEnqueues=270 deferredForegroundWrites=11 scheduledDrains=1
  • SKIP_BUILD=1 npx playwright test tests/e2e/git-no-upstream-polling-churn.spec.ts --config tests/playwright.config.ts --project electron-headless --reporter=json > .tmp/simplify-rebased-git-polling.json
    • Passed: elapsed=7201.8ms maxTimerDrift=4.2ms samples=450 noUpstreamFailures=1 missingOriginFailures=1

@nwparker
nwparker force-pushed the nwparker/simplify-opentui-foreground-fix branch from a976359 to bc424c9 Compare June 3, 2026 21:35
@nwparker

Copy link
Copy Markdown
Contributor Author

Closing as superseded by a better bounded design: #4585 shipped a rolling immediate-output budget and #7214 refined the scheduler. Current main deliberately preserves bounded input-latency handling; removing the classifier wholesale would regress it.

@nwparker nwparker closed this Jul 11, 2026
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