Skip to content

Remove auto-hold typing detection from terminals#144

Merged
kjgbot merged 1 commit into
mainfrom
fix/remove-auto-hold-typing-detection
Jun 7, 2026
Merged

Remove auto-hold typing detection from terminals#144
kjgbot merged 1 commit into
mainfrom
fix/remove-auto-hold-typing-detection

Conversation

@kjgbot
Copy link
Copy Markdown
Contributor

@kjgbot kjgbot commented Jun 7, 2026

Summary

  • Remove the auto-HOLD-on-typing feature added in the Add repo picker to spawn dialog and auto-worktree on project collision #119 era (682fb80): typing in a terminal with multiple agents running no longer auto-switches delivery to hold mode (nor auto-releases on Enter/blur)
  • useTerminal loses the autoHold/onAutoHoldStart/onAutoHoldRelease params, the typing-active state machine, the held-input send path + input serialization queue, and the blur release listener — sendInput is a plain synchronous fast-path again
  • TerminalPane loses makeAutoHoldHandlers, the runningAgents > 1 computation, and all prop threading through TerminalProject / SplitTerminalTile / SplitTerminalPage; TerminalInstance loses the pass-through props

Why

The detection is buggy in practice (mode flapping on keystrokes). Removing it entirely; manual HOLD/LIVE control via the pending-messages delivery-mode menu is unchanged, and agent typing indicators (typing-store) are unrelated and untouched.

Validation

  • npm run build (electron-vite) ✓
  • npx tsc --noEmit
  • npm test (88/88) ✓
  • npx vitest run — 138/139; the 1 failure (broker.test.ts persona clone-safe payload) is a pre-existing flake that fails identically on clean origin/main under full-suite load and passes in isolation

🤖 Generated with Claude Code

The auto-HOLD feature (switch to hold mode on first keystroke when
multiple agents are running, release on Enter/blur) shipped in the #119
era (682fb80) but is buggy in practice. Remove it entirely:

- use-terminal: drop autoHold/onAutoHoldStart/onAutoHoldRelease params,
  the typing-active state machine, the held-input send path and its
  input serialization queue, and the blur release handler. sendInput is
  a plain synchronous fast-path again.
- TerminalInstance: drop the pass-through props.
- TerminalPane: drop makeAutoHoldHandlers, the runningAgents>1 autoHold
  computation, and all prop threading through TerminalProject,
  SplitTerminalTile, and SplitTerminalPage.

Manual HOLD/LIVE control via the pending-messages delivery-mode menu is
unchanged; agent typing indicators (typing-store) are unrelated and
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Jun 7, 2026

Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 7, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0e41df16-361b-4c33-8229-d5daabb63e10

📥 Commits

Reviewing files that changed from the base of the PR and between 6e66172 and 092d0d5.

📒 Files selected for processing (3)
  • src/renderer/src/components/terminal/TerminalInstance.tsx
  • src/renderer/src/components/terminal/TerminalPane.tsx
  • src/renderer/src/hooks/use-terminal.ts

📝 Walkthrough

Walkthrough

The PR removes auto-hold functionality from terminal rendering. The useTerminal hook signature is simplified by removing autoHold and related callbacks; input handling is refactored to use direct sendInputFast calls instead of queued async logic. Blur event listeners and handleBlur cleanup code are deleted. This change cascades through TerminalInstance, which drops auto-hold props, and TerminalPane, which removes makeAutoHoldHandlers and stops wiring auto-hold callbacks in split and tabbed layouts.

Changes

Terminal Auto-Hold Removal

Layer / File(s) Summary
useTerminal hook: remove auto-hold parameters and simplify input handling
src/renderer/src/hooks/use-terminal.ts
Hook signature drops autoHold and auto-hold callbacks. Input refactored: sendInput now performs predictive echo and calls sendInputFast directly (unless in view mode), replacing the previous queued/async hold-driven behavior. Blur event listener and handleBlur cleanup are removed.
TerminalInstance: remove auto-hold from props contract
src/renderer/src/components/terminal/TerminalInstance.tsx
Props interface removes autoHold, onAutoHoldStart, onAutoHoldRelease. Component signature and useTerminal invocation updated to accept only core parameters.
TerminalPane: cascade auto-hold removal through component tree
src/renderer/src/components/terminal/TerminalPane.tsx
TerminalProject, SplitTerminalTile, and SplitTerminalPage remove auto-hold props and handlers. makeAutoHoldHandlers factory is deleted. Split and tabbed layout renderers stop passing auto-hold props to child components.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A terminal stripped of its hold,
No more blur-driven delays to behold,
Input flies swift with predictive grace,
Auto-hold handlers removed from this place—
Simpler pipelines, cleaner and bold!

🚥 Pre-merge checks | ✅ 4 | ❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: removing the auto-hold typing detection feature from terminals, which is the primary objective of the changeset.
Description check ✅ Passed The PR description is well-structured and directly related to the changeset, detailing what was removed, why it was removed, and validation results.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-auto-hold-typing-detection

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 and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the "auto-hold" feature and its associated props and handlers (autoHold, onAutoHoldStart, onAutoHoldRelease, makeAutoHoldHandlers) across the terminal components (TerminalInstance, TerminalPane, TerminalProject, SplitTerminalTile, SplitTerminalPage) and the useTerminal hook. The sendInput logic in useTerminal has been simplified to directly invoke pear.broker.sendInputFast without input queuing or auto-hold transitions. The review feedback suggests adding error handling to the pear.broker.sendInputFast IPC call to prevent unhandled promise rejections or uncaught exceptions in the renderer.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

typingActiveRef.current = false
await onAutoHoldReleaseRef.current?.(true)
}
pear.broker.sendInputFast(projectId, agentName, data)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since pear.broker.sendInputFast is an IPC call that may return a Promise (or throw synchronously if the broker is disconnected), it is safer to handle potential errors or rejections to avoid unhandled promise rejections or uncaught exceptions in the renderer.

Suggested change
pear.broker.sendInputFast(projectId, agentName, data)
pear.broker.sendInputFast(projectId, agentName, data).catch((err) => { console.warn('[terminal] sendInputFast failed:', err); })

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not applicable: pear.broker.sendInputFast is typed => void (fire-and-forget ipcRenderer.send in the preload, src/shared/types/ipc.ts:869) — chaining .catch() on it would be a type error. This line restores the exact pre-auto-hold call shape; broker-disconnect handling lives on the main-process side of the channel.

@agent-relay-code
Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed the PR diff and traced the changed terminal input path across the renderer hook, terminal components, IPC typing, and related delivery-mode code. I did not find a current checkout defect or stale auto-hold call site that needed a code fix.

Validation run:
npm install
npm run build passed
npm test passed: 88 tests passing

I did not verify remote GitHub CI status, mergeability, or pending checks from this sandbox, so I’m not marking this as READY.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@kjgbot kjgbot merged commit 7187fee into main Jun 7, 2026
4 checks passed
@kjgbot kjgbot deleted the fix/remove-auto-hold-typing-detection branch June 7, 2026 07:54
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