Skip to content

Split automation dispatch event handling - #17155

Merged
nwparker merged 23 commits into
mainfrom
ra/max-lines-bottom-10-automation-dispatch-events
Aug 30, 2026
Merged

nwparker merged 23 commits into
mainfrom
ra/max-lines-bottom-10-automation-dispatch-events

Conversation

@nwparker

@nwparker nwparker commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​776 $\color{#cf222e}{\Huge{\mathbf{−}}}$​694 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​82

Summary

  • keep the React hook as the sole external dispatch subscription and cleanup owner
  • extract workspace/host validation, SSH readiness, precheck, and worktree preparation
  • extract completion observation and terminal ownership bookkeeping without changing event ordering
  • remove the resolved max-lines baseline entry

Validation

  • pnpm tc
  • pnpm tc:web
  • pnpm run check:code-quality:changed
  • pnpm check:max-lines-ratchet
  • pnpm test src/renderer/src/hooks/useAutomationDispatchEvents.test.ts

Stacked on #17152.

@greptile-apps

greptile-apps Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR splits automation dispatch handling into dedicated workspace, request-handling, and completion modules while retaining the React hook as the external subscription owner.

  • Extracts workspace resolution, host validation, SSH readiness, prechecks, and worktree preparation.
  • Extracts agent completion observation, output snapshots, observer cleanup, and terminal ownership finalization.
  • Moves dispatch orchestration and session reuse into a standalone request handler.
  • Removes the hook from the max-lines baseline.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/renderer/src/hooks/automation-dispatch-handler.ts Owns dispatch orchestration, reusable-session selection, fresh agent launch, result persistence, and focus restoration.
src/renderer/src/hooks/automation-dispatch-workspace.ts Encapsulates workspace and host resolution, SSH readiness, prechecks, and per-run worktree creation.
src/renderer/src/hooks/automation-dispatch-completion.ts Encapsulates output capture, status and exit observation, result settlement, cleanup, and terminal ownership finalization.
src/renderer/src/hooks/useAutomationDispatchEvents.ts Retains sole ownership of the external dispatch subscription while delegating each request to the extracted handler.
config/max-lines-baseline.txt Removes the now-split dispatch hook from the max-lines exception list.

Sequence Diagram

sequenceDiagram
    participant Hook as useAutomationDispatchEvents
    participant Handler as Dispatch handler
    participant Workspace as Workspace preparation
    participant Agent as Agent session
    participant Completion as Completion observer
    participant API as Automations API
    Hook->>Handler: dispatch request
    Handler->>Workspace: resolve and prepare workspace
    Workspace-->>Handler: worktree or terminal status
    Handler->>Agent: reuse or launch session
    Handler->>Completion: register output/status/exit observers
    Handler->>API: mark dispatched
    Agent-->>Completion: output, done, or exit
    Completion->>API: mark completed or failed
    Completion->>Completion: cleanup observers and terminal ownership
Loading

Reviews (2): Last reviewed commit: "Merge branch 'ra/max-lines-bottom-9-host..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown

Too many files changed for review (111 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@nwparker
nwparker changed the base branch from ra/max-lines-bottom-9-hosted-review-creation to main August 30, 2026 03:12
@nwparker
nwparker merged commit ca6401a into main Aug 30, 2026
3 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* Split speech session lifecycle

* Split terminal output scheduler pipeline

* Split mobile browser pane modules

* Prune resolved max-lines suppressions

* Split pane tree equalization logic

* Extract mobile troubleshoot screen styles

* Split external automation manager

* Split main window service attachments

* Split hosted review creation checks

* Split automation dispatch event handling

* Fix F3-speech for stablyai#17123

* Fix F1-cycle for stablyai#17131
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