Skip to content

Let automations run in Chat - #34332

Merged
brennanb2025 merged 31 commits into
mainfrom
brennanb2025/automation-chat-runs
Oct 30, 2026
Merged

brennanb2025 merged 31 commits into
mainfrom
brennanb2025/automation-chat-runs

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4648 $\color{#cf222e}{\Huge{\mathbf{−}}}$​479 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4169
Prod 67 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2613 $\color{#cf222e}{\Huge{\mathbf{−}}}$​440 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2173

Automations previously opened Terminal sessions. This adds Chat runs that retain output from their exact accepted turn and open the recorded Chat from Run Details. Busy Chat reuse uses its ordinary queue; restart recovery follows the accepted request without resubmitting it and reports an interrupted request truthfully.

Terminal automations retain integrated-main behavior. Only explicit Chat automations take the shared Chat launch/send path. An absent saved surface permanently means Terminal. The editor adds the approved Chat/Terminal choice, with the native default on the right and selected, and keeps the existing agent control and supplemental Terminal Arguments. The full picker is tracked in #35802.

Run Details and ordinary History share the existing-record opener: reveal the saved Chat on its owning host, apply its publication, then select that exact Chat. An unavailable Chat opens its workspace and keeps saved output in Run Details, without creating a replacement Chat or resending. The History wrapper preserves its navigation and refusal messages.

Full review is complete on 72fe71a8832d598c52b9e26c886ab5dcd0d2aa91: six historical rounds plus one expressly authorized reduced-cut round, with subsequent bounded fix/evidence checks. All 27 prescribed final cases and the normal commit hook passed. CI is green: 49 passed, 17 skipped. The first attempt hit an existing-main ACP fixture synchronization race; exactly one named failed-jobs-only retry passed. That P2/main/repeat test defect remains deferred, tracked in STA-12959.

Real QA, with isolated profiles and real Claude/Codex agents:

Flow Evidence and limits
Current-head saved Chat reopening, both agents Fully settled ordinary close, then the SAME saved Details → View run opens the exact existing Chat with readable transcript and selection retained after a later legitimate inventory. Both also reopen through ordinary Agent Session History. No new turn or request.
Current-head unavailable Chat, both agents The two existing records were made unreadable with an offline two-cell guarded fixture. Each normal View run reached its exact typed missing-identity refusal, showed its workspace and one observed unavailable notice, and retained the same Details/output. One normal-path notice emission per action is established by source, events and immediate DOM snapshots. The literal first-ten-second DOM trajectory and notice-visible PNG were NOT CAPTURED; fallback screenshots show the workspace after dismissal. No replacement Chat/send/Retry. Exact original cells were restored; restored journal tables match the private pre-fixture backup.
Current-head Spanish Loaded Claude Details showed enabled “Ver ejecución”; normal click selected its existing Chat. Language restored through Settings.
Current-head Terminal control A real Codex run completed with exact saved Details output; Open workspace returned to the recorded workspace. The completed record has no terminal/pane/PTY/model identity, so this does not certify reopening its original agent terminal.
Current-head form Loaded Chat default on the right/selected; existing agent control and Terminal Arguments retained; preferences restored. A separately labelled private production-component fixture proves selected/disabled unknown-support presentation; that transient state was not captured live. Its first resource404 attempt remains incomplete/unattributed; the corrected fixture passed DOM/pixel checks.
Earlier execution-owner evidence at 973de2 Carries only unchanged fresh/idle-reuse/busy-reuse completion and exact own output, accepted-active graceful restart without resend, UI Stop, and a later human followup after Stop settlement. Restart reattachment is not continuation-success proof; no active-human-Send or unverified Codex-timeout claim.

All owned apps/drivers stopped; the QA lead exited; tickets released; five real-config hash pairs unchanged. No cleanup-only launch. Ten saved runs/output and paused definitions were preserved. Histories intentionally refused during the unreadable-record fixture; durable journal preservation is established by offline restoration evidence, not a fresh readable-history comparison. Sanitized archives have exact archive-manifest hashes but omit designated raw/log entries from their original stage manifests; no complete console-error census is claimed. Startup census was not captured, and instrumented event times are identity/order evidence, not performance measurements.

Accepted compatibility limits:

  • Older paired servers retain Terminal; unsupported Chat authoring is refused before creation.
  • An outdated desktop moving a Chat automation to another host creates a Terminal automation because its protocol cannot carry the choice. An updated desktop preserves Chat.
  • Older phones show Chat status/output but cannot open the Chat.

Existing-main limitations remain deferred: mounted Runs history may need a genuine page reopen (tracked in #31375); an earlier close still in flight can retract a reopened Chat (tracked in #27583). Only fully settled closes are passing reopening evidence. Overlapping mobile/workspace work is tracked in #31617 and #31255; their behavior is preserved.

Earlier main form (6ee27ef6; retained comparison) Current branch form (72fe71a8)
Earlier main Terminal form Chat default right and selected
Terminal supplemental Arguments Completed Terminal Details
Terminal Arguments Completed Terminal run and saved output

Recorded workspace from Terminal run

Private production-component fixture: unknown support, Chat selected and both controls disabled. Presentation evidence only.

Private unknown-support presentation

Current Claude Details reopening Current Codex Details reopening
Claude same Chat after settled close Codex same Chat after settled close
Current Claude ordinary History Current Codex ordinary History
Claude History Codex History

Loaded Spanish Chat Details

Unavailable Claude: final workspace after notice dismissal Unavailable Codex: final workspace after notice dismissal
Claude fallback workspace Codex fallback workspace
Claude output retained after unavailable action Codex output retained after unavailable action
Claude retained output Codex retained output

Earlier fresh-flow screenshots (f4cec2b3, isolated profile upgraded from main 6ee27ef6) illustrate carried execution evidence; they are not current closed-Chat acceptance.

Earlier Claude fresh reply Earlier Codex fresh reply
Claude fresh reply Codex fresh reply

@brennanb2025
brennanb2025 marked this pull request as ready for review October 27, 2026 08:34
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

The changes add Chat and Terminal launch surfaces to automation setup and runtime execution. Runs can record chat session identity, and the runtime can recover accepted launches and observe chat completion. The renderer adds surface selection and can open a recorded run chat on its owning host. Dispatch and completion handling move from renderer event hooks to runtime automation services. Desktop terminal lifecycle handling adds coordinated ownership and stop authorization.

Priority: Normal

Merge Risk: High · up to e1a17

This change is not ready to merge. Two type errors would likely break the build. Stopping a Windows terminal could target the wrong process if its PID was reused. Terminal automation runs that started before the upgrade could be marked failed after a restart even though their terminal is still live.

Pre-merge checks: Passed 4
Check name Status Explanation
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.
Title check Passed The title clearly identifies the primary user-facing change: allowing automations to run in Chat. It is concise and related to the changeset.
Description check Passed The description is detailed and covers the change, rationale, user-visible behavior, compatibility limits, testing evidence, visual proof, known limitations, and remaining QA. It does not follow the t…
Full details: Description check

Explanation

The description is detailed and covers the change, rationale, user-visible behavior, compatibility limits, testing evidence, visual proof, known limitations, and remaining QA. It does not follow the template headings exactly and does not provide a clear Fixes #... issue reference, explicit AI Disclosure, or completed checklist sections, but the required information is mostly present.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f1b7a1b1-0258-4d7f-a201-b8104b7994bc
Commits

Reviewing files that changed from the base of the PR and between ab9532e and 9a37baa.

Files selected for processing: 73
  • src/main/automations/automation-chat-session-reuse.ts
  • src/main/automations/automation-dispatch-host-fence.test.ts
  • src/main/automations/automation-dispatch-request.ts
  • src/main/automations/automation-run-operation.ts
  • src/main/automations/automation-run-receipt.ts
  • src/main/automations/automation-worker-durability.test.ts
  • src/main/automations/dispatch-refusal.ts
  • src/main/automations/headless-automation-agent-launch.test.ts
  • src/main/automations/headless-automation-agent-launch.ts
  • src/main/automations/headless-dispatch-durability.test.ts
  • src/main/automations/headless-dispatch-runner.ts
  • src/main/automations/headless-dispatch.ts
  • src/main/automations/headless-workspace-create.test.ts
  • src/main/automations/headless-workspace-create.ts
  • src/main/automations/run-completion-watcher.test.ts
  • src/main/automations/run-completion-watcher.ts
  • src/main/automations/runtime-automation-service.test.ts
  • src/main/automations/runtime-automation-service.ts
  • src/main/automations/runtime-chat-run-observer.test.ts
  • src/main/automations/runtime-chat-run-observer.ts
  • src/main/automations/service.test.ts
  • src/main/automations/service.ts
  • src/main/persistence/applying-settings/persistence-automation-extra-agent-args.test.ts
  • src/main/persistence/applying-settings/persistence-legacy-automation-twin-host.test.ts
  • src/main/persistence/scheduling-automations/automation-definition-operations.ts
  • src/main/persistence/scheduling-automations/automation-run-operations.ts
  • src/main/runtime/rpc/methods/agent-launch-surfaces.ts
  • src/main/runtime/rpc/methods/agent-launch-worktree-creation.ts
  • src/main/runtime/rpc/methods/agent-launch.test.ts
  • src/main/runtime/rpc/methods/agent-launch.ts
  • src/main/runtime/runtime-automation-controller.ts
  • src/renderer/src/components/automations/AutomationEditorDialog.tsx
  • src/renderer/src/components/automations/AutomationEditorSettingsSidebar.test.tsx
  • src/renderer/src/components/automations/AutomationEditorSettingsSidebar.tsx
  • src/renderer/src/components/automations/AutomationSurfaceField.test.tsx
  • src/renderer/src/components/automations/AutomationSurfaceField.tsx
  • src/renderer/src/components/automations/automation-capability-probe.ts
  • src/renderer/src/components/automations/automation-draft-model.ts
  • src/renderer/src/components/automations/automation-edit-draft.ts
  • src/renderer/src/components/automations/automation-extra-agent-args-capability.test.ts
  • src/renderer/src/components/automations/automation-host-client.ts
  • src/renderer/src/components/automations/automation-launch-surface.ts
  • src/renderer/src/components/automations/automation-orca-save.ts
  • src/renderer/src/components/automations/automation-run-view-state.test.ts
  • src/renderer/src/components/automations/automation-run-view-state.ts
  • src/renderer/src/components/automations/automation-run-workspace-action.paired-server.test.ts
  • src/renderer/src/components/automations/automation-run-workspace-action.ts
  • src/renderer/src/components/automations/automation-save-action.ts
  • src/renderer/src/components/automations/automation-scoped-list-client.ts
  • src/renderer/src/components/automations/automations-page-test-harness.tsx
  • src/renderer/src/hooks/automation-dispatch-completion.ts
  • src/renderer/src/hooks/automation-dispatch-handler.ts
  • src/renderer/src/hooks/automation-dispatch-observer-test-probe.ts
  • src/renderer/src/hooks/automation-dispatch-unverifiable-loss.test.ts
  • src/renderer/src/hooks/automation-dispatch-workspace.ts
  • src/renderer/src/hooks/useAutomationDispatchEvents.test.ts
  • src/renderer/src/hooks/useAutomationDispatchEvents.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/automation-extra-agent-args-record.ts
  • src/shared/automation-launch-setup.ts
  • src/shared/automation-runtime-capabilities.ts
  • src/shared/automations-types.ts
  • src/shared/orcad-migration/orcad-migration-dormant-automation-validation.ts
  • src/shared/orcad-migration/orcad-migration-manifest.test.ts
  • src/shared/protocol-version.ts
  • src/shared/rpc-contract/automation-params-extra-agent-args.test.ts
  • src/shared/rpc-contract/automation-params.ts
Files with no reviewable changes: 7
  • src/renderer/src/hooks/automation-dispatch-completion.ts
  • src/renderer/src/hooks/useAutomationDispatchEvents.ts
  • src/renderer/src/hooks/automation-dispatch-unverifiable-loss.test.ts
  • src/renderer/src/hooks/automation-dispatch-handler.ts
  • src/renderer/src/hooks/automation-dispatch-workspace.ts
  • src/main/automations/headless-workspace-create.ts
  • src/renderer/src/hooks/automation-dispatch-observer-test-probe.ts

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Critical · Read run.automationId into a constant before the… · runtime-automation-service.ts:69-73

src/main/automations/runtime-automation-service.ts:69-73
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Read run.automationId into a constant before the find callbacks. The typecheck fails on lines 71 and 129.

run is a let. Line 102 assigns it after these closures are created. For this reason, TypeScript does not keep the run && narrowing inside the find callbacks. CI reports TS18048 on lines 71 and 129, so the packaged build cannot compile. Look up the automation outside the callback with a const.

Proposed fix
         let run = options.run
         let originalHandle: string | undefined
         if (run && (handle.startsWith('automation:') || run.sessionKind !== 'chat')) {
+          const automationId = run.automationId
+          const agentId = store.listAutomations().find((entry) => entry.id === automationId)?.agentId
           if (!run.chatSessionId) {
             ...
-            const agent =
-              tuiAgentDisplayName(
-                store.listAutomations().find((entry) => entry.id === run.automationId)?.agentId ??
-                  'Agent'
-              ) ?? 'Agent'
+            const agent = tuiAgentDisplayName(agentId ?? 'Agent') ?? 'Agent'
             ...
           }
           if (run.sessionKind === 'chat') {
             ...
-              const agent =
-                tuiAgentDisplayName(
-                  store.listAutomations().find((entry) => entry.id === run.automationId)?.agentId ??
-                    ''
-                ) ?? 'The agent'
+              const agent = tuiAgentDisplayName(agentId ?? '') ?? 'The agent'

Also applies to: 127-131

Source: Pipeline failures


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56a4eff3-569a-4d14-9a54-7ce7bf186396
Commits

Reviewing files that changed from the base of the PR and between 9a37baa and cf9d32c.

Files selected for processing: 61
  • src/main/automations/automation-run-receipt.ts
  • src/main/automations/desktop-run-terminal-lifecycle.ts
  • src/main/automations/desktop-run-terminal-stop.ts
  • src/main/automations/headless-automation-agent-launch.test.ts
  • src/main/automations/headless-automation-agent-launch.ts
  • src/main/automations/headless-dispatch-runner.ts
  • src/main/automations/headless-dispatch.ts
  • src/main/automations/precheck-runner.ts
  • src/main/automations/runtime-automation-service.test.ts
  • src/main/automations/runtime-automation-service.ts
  • src/main/automations/runtime-chat-run-observer.test.ts
  • src/main/automations/runtime-chat-run-observer.ts
  • src/main/automations/service-lifecycle.test.ts
  • src/main/automations/service.ts
  • src/main/daemon/daemon-pty-adapter-history-shutdown-admission.test.ts
  • src/main/daemon/daemon-pty-session-control.ts
  • src/main/daemon/daemon-pty-session-liveness.ts
  • src/main/ipc/pty/provider/shutdown-detect.ts
  • src/main/ipc/pty/runtime/controller-deps.ts
  • src/main/ipc/pty/runtime/kill.ts
  • src/main/native-chat/agent-session-wire/agent-session-subscriber-catch-up.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-actionable-prompts.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-background-task-channel.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-current-work.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-current-work.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
  • src/main/providers/local-pty-provider.ts
  • src/main/providers/local-pty-termination.ts
  • src/main/providers/pty-provider-contract.ts
  • src/main/pty-descendant-snapshot.ts
  • src/main/pty-descendant-stop-authorization.test.ts
  • src/main/pty-descendant-termination.ts
  • src/main/runtime/rpc/methods/agent-launch-replay.ts
  • src/main/runtime/rpc/methods/agent-launch-surfaces.ts
  • src/main/runtime/rpc/methods/agent-launch-target-authorization.ts
  • src/main/runtime/rpc/methods/agent-launch-worktree-creation.ts
  • src/main/runtime/rpc/methods/agent-launch.test.ts
  • src/main/runtime/rpc/methods/agent-launch.ts
  • src/main/runtime/runtime-pty-controller-contract.ts
  • src/main/runtime/terminal/stop/worktree-terminal-stop-targets.ts
  • src/main/window/runtime-window-lifecycle.ts
  • src/main/window/terminal-tab-close-request-relay.ts
  • src/preload/api/automation-api.ts
  • src/preload/api/automations-bridge.ts
  • src/renderer/src/components/automations/automation-run-workspace-action.paired-server.test.ts
  • src/renderer/src/hooks/ipc-events/terminal-presentation-ipc-bridge.ts
  • src/renderer/src/hooks/ipc-events/terminal-presentation-pane-title.test.ts
  • src/renderer/src/hooks/ipc-events/terminal-tab-mount-ipc-bridge.ts
  • src/renderer/src/lib/adopt-agent-background-session-tab.ts
  • src/renderer/src/lib/agent-background-session-contract.ts
  • src/renderer/src/lib/automation-terminal-ownership.test.ts
  • src/renderer/src/lib/automation-terminal-ownership.ts
  • src/renderer/src/lib/launch-agent-background-session-extra-args.test.ts
  • src/renderer/src/lib/launch-agent-background-session-launch-parity.test.ts
  • src/renderer/src/lib/launch-agent-background-session-remote.test.ts
  • src/renderer/src/lib/launch-agent-background-session.test.ts
  • src/renderer/src/lib/launch-agent-background-session.ts
  • src/renderer/src/store/terminals/terminal-actions.ts
  • src/renderer/src/store/terminals/terminal-pane-hibernation-commit.ts
  • src/renderer/src/store/terminals/terminal-pane-hibernation.ts
  • src/shared/automation-terminal-lifecycle.ts
Files with no reviewable changes: 7
  • src/renderer/src/lib/launch-agent-background-session-launch-parity.test.ts
  • src/renderer/src/lib/launch-agent-background-session-remote.test.ts
  • src/renderer/src/lib/agent-background-session-contract.ts
  • src/renderer/src/lib/launch-agent-background-session-extra-args.test.ts
  • src/renderer/src/lib/launch-agent-background-session.ts
  • src/renderer/src/lib/launch-agent-background-session.test.ts
  • src/renderer/src/lib/adopt-agent-background-session-tab.ts

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

Comment thread src/main/pty-descendant-snapshot.ts Resolved
Comment thread src/main/pty-descendant-termination.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9b12a9d2-a7ea-4424-83ef-62c7d30d28a2
Commits

Reviewing files that changed from the base of the PR and between cf9d32c and 62ca316.

Files selected for processing: 17
  • src/main/automations/automation-agent-run-result.ts
  • src/main/automations/automation-chat-session-reuse.ts
  • src/main/automations/desktop-run-terminal-lifecycle.ts
  • src/main/automations/headless-automation-agent-launch.test.ts
  • src/main/automations/headless-automation-agent-launch.ts
  • src/main/automations/runtime-chat-run-observer.test.ts
  • src/main/automations/runtime-chat-run-observer.ts
  • src/main/native-chat/agent-session-journal/journal-stop-marks.ts
  • src/main/native-chat/agent-session-journal/journal-store.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-client-delivery.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-conversations.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-conversations.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-publication-wiring.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-subscribers.test.ts
  • src/renderer/src/lib/automation-terminal-ownership-test-harness.ts
  • src/renderer/src/lib/automation-terminal-ownership.test.ts

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

Major · Recheck the Windows target after stop authorization. · pty-descendant-termination.ts:128-129

src/main/pty-descendant-termination.ts:128-129
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Recheck the Windows target after stop authorization.

If the original process exits while authorizeStop() awaits a reply, its PID can be reused. The cached preparedTarget === 'own' can then authorize killWindowsTree(rootPid) against a different process when owned-job termination is unavailable. Keep the preparation before the veto, but perform a fresh identity check after authorization and before the PID-based kill. The identity check proves ancestry only for the process observed at check time. (raw.githubusercontent.com)

Major · Continue observing pre-upgrade Terminal runs without a… · runtime-automation-service.ts:71-83

src/main/automations/runtime-automation-service.ts:71-83
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Continue observing pre-upgrade Terminal runs without a launch receipt.

If a dispatched Terminal run predates this launch path, readAutomationRunReceipt finds no operation row. This branch marks the run dispatch_failed even when its recorded pane still resolves to a live terminal. Keep receipt-based recovery for runs launched through the new path, but let legacy dispatched runs use their recorded terminal identity and the terminal observer. The retained-run watcher explicitly reattaches dispatched runs after restart. (raw.githubusercontent.com) As per coding guidelines, “Clients and servers update independently; preserve compatibility across mixed versions.”

Source: Coding guidelines


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2bd2e5a7-e648-4b79-964b-4ecb1d8ea873
Commits

Reviewing files that changed from the base of the PR and between 161d88e and e1a175d.

Files selected for processing: 11
  • config/flaky-test-pattern-baseline.txt
  • config/scripts/orcad-entry-build.test.mjs
  • src/main/automations/runtime-automation-service-retention.test.ts
  • src/main/automations/runtime-automation-service.test.ts
  • src/main/automations/runtime-automation-service.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-workspace-sleep.ts
  • src/main/pty-descendant-snapshot.ts
  • src/main/pty-descendant-termination.ts
  • src/main/startup/main-process-automations.ts
  • src/renderer/src/lib/automation-terminal-ownership.test.ts
Files with no reviewable changes: 1
  • config/flaky-test-pattern-baseline.txt

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

@brennanb2025 brennanb2025 changed the title Let automations run in Chat or Terminal Let automations run in Chat Oct 28, 2026
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The reviewed changes appear safe to merge; both numbered previous findings are addressed.

Summary

Adds explicit Chat automations while keeping saved automations without a surface on Terminal.

  • Automations can choose Chat or Terminal when they are saved.
  • Chat automations launch or reuse a Chat and save its exact reply.
  • Native Chat publishes updates that automation runs can follow.
  • Run Details can reopen the Chat saved on an automation run.
  • Server build checks now include a scan for Electron runtime imports.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Saved automation] --> B{Explicit Chat?}
  B -- No --> T[Existing Terminal dispatch]
  B -- Yes --> C[Launch Chat or queue in a compatible Chat]
  C --> R[Record accepted request and actual session]
  R --> O[Follow the exact accepted turn]
  O --> S[Save reply in run history]
  S --> D[Reopen the recorded Chat from Run Details]
Loading

Reviews (12) · Last reviewed commit: "Preserve admitted automation surface acr..." · Reviewed by Greptile

Comment thread src/renderer/src/i18n/locales/en.json Resolved
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Automations previously opened Terminal sessions. This PR adds Chat runs, records output from the exact accepted turn, and opens the recorded Chat from Run Details. Existing saved automations remain Terminal. Busy Chat reuse uses the ordinary queue, and Run Details and History share the same existing-record opener.

The full review is complete on 72fe71a8832d598c52b9e26c886ab5dcd0d2aa91: six historical rounds plus one expressly authorized reduced-cut round, followed by bounded verification. Repairs cover accepted-turn recovery, ordinary reuse, bounded observer ownership, atomic surface/Arguments saves and recorded-Chat reopening. Independent reference, performance and readiness source checks cover the final retained mechanisms. Required CI: 49 success, 17 skipped; the one named failed-jobs-only retry passed. The existing-main ACP fixture race remains P2/main/repeat, deferred and tracked in STA-12959.

QA by flow:

  • On72fe, Claude and Codex: fully settled ordinary close → same saved Details → View run → exact existing Chat/readable transcript, selection surviving later legitimate inventory. Ordinary History also reopened each exact Chat. No new turn/request.
  • On72fe, both unavailable Chats: actual typed missing-identity refusal → workspace/one observed notice → retained same Details/output; no replacement Chat, Retry or send. Source/event/immediate-DOM evidence establishes one normal-path notice emission per action. Literal ten-second DOM trajectory and notice-visible PNG NOT CAPTURED. The final screenshots below show the workspace after notice dismissal. The offline two-cell fixture was exactly restored; all journal tables matched the private pre-fixture backup.
  • On72fe: loaded Spanish “Ver ejecución” opened the existing Claude Chat; language restored. Real Codex Terminal completion retained exact output and opened its recorded workspace. That completed record has no terminal/pane/PTY identity, so original-terminal reopening is not claimed. Loaded form/preferences restored; unknown-support selected/disabled presentation is a labelled private production-component fixture, not live capability evidence.
  • Carried unchanged execution owners from973de2: fresh/idle and busy reuse completion with exact own output, accepted-active graceful restart without resend, Stop, and human followup after Stop settlement. No restart-continuation-success, active-human-Send or unverified Codex-timeout claim.

Known limits stay explicit: in-flight close retraction is deferred, tracked in #27583; fully settled close is the passing boundary. Mounted Runs freshness is deferred, tracked in #31375. Old paired servers remain Terminal; old desktops cannot preserve Chat on host move; old phones show status/output without Chat opening. Startup census was not captured; instrumented timestamps are not performance measurements. Sanitized archive manifests are exact, with designated original raw/log omissions; no complete console-error census is claimed. Histories intentionally refused during the fixture; offline restoration supports durable preservation without a fresh readable-history claim.

All owned copies/drivers stopped, exact originals restored, lead exited, slots released, five real-config hash pairs unchanged. Private ledger, bounded independent audits and original evidence are retained in ~/orca-qa/pr-34332/.

For Brennan’s review: main/current form, Terminal and earlier fresh-reply comparisons are in the PR body. Current affected opener flows:

Flow Claude Codex
Details after settled close Claude Details reopen Codex Details reopen
Ordinary History Claude History Codex History
Unavailable: workspace after notice dismissal Claude fallback Codex fallback
Unavailable: retained saved output Claude output retained Codex output retained

Loaded Spanish Details

Judgment spots: saved/default surface and atomic launch setup, Chat launch through the shared host entrypoint, recorded Chat opening and unavailable feedback.

@brennanb2025
brennanb2025 merged commit a682303 into main Oct 30, 2026
103 of 105 checks passed
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