Skip to content

Optimizing Files And Run Tab - #294

Merged
arul28 merged 3 commits into
mainfrom
ade/optimizing-files-and-run-tab-7d224fc4
May 14, 2026
Merged

Optimizing Files And Run Tab#294
arul28 merged 3 commits into
mainfrom
ade/optimizing-files-and-run-tab-7d224fc4

Conversation

@arul28

@arul28 arul28 commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary

Describe the change.

What Changed

Key files and behaviors.

Validation

How you tested.

Risks

Anything to watch.

Greptile Summary

This PR optimizes the Files and Run tabs by splitting LaneRuntimeBar's single polling cycle into separate health (10 s) and routing (30 s) intervals, simplifying WorkStartSurface to delegate all draft kinds through AgentChatPane, and adding inline agent-CLI continuation UI so ended CLI sessions can be resumed without leaving the Work view.

  • LaneRuntimeBar splits refreshRuntimeState into refreshHealthState and refreshRoutingState, each with its own sequence counter and timer.
  • WorkViewArea gains ClosedCliSessionSurface with terminal-snapshot rendering, content-derived React keys, and WorkCliContinuationComposer with permission/model pickers position-computed from getBoundingClientRect.
  • WorkSidebar generalises context attachment to both chat (custom events) and PTY targets (bracketed paste) via a new contextTarget: WorkSidebarContextTarget prop.

Confidence Score: 5/5

Safe to merge; changes are largely additive and previous review concerns have been addressed.

The polling split, CLI continuation UI, and PTY context insertion are well-structured. Permission picker now uses getBoundingClientRect, React keys are content-derived, ANSI stripping reuses the canonical helper, and the permission-mode reset effect uses primitive string dependencies.

No files require special attention; the WorkSidebar PTY write error path could benefit from user-visible feedback but is non-blocking.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx Large addition of ClosedCliSessionSurface, WorkCliContinuationComposer, and WorkCliPermissionPicker; position picker now uses getBoundingClientRect; stable content-derived React keys via withStableDuplicateKeys.
apps/desktop/src/renderer/components/run/LaneRuntimeBar.tsx Health and routing state split into independent callbacks and intervals; clean refactor with correct sequence counters and cleanup.
apps/desktop/src/renderer/components/terminals/WorkSidebar.tsx Context attachment generalised to PTY targets via bracketed paste; contextTarget union type replaces attachChatSessionId; PTY write failures are console-only with no user feedback.
apps/desktop/src/renderer/components/terminals/WorkStartSurface.tsx Simplified to forward all draft kinds to AgentChatPane with forceDraftMode; 140 ms deferred mount for fast tab-switch performance; draftLaneId sync effect is stable.
apps/desktop/src/renderer/components/run/RunPage.tsx Removes the early if (normalized === ".") return undefined guard; "." is now stored explicitly as cwd in config; downstream normalizedCwd logic is unaffected.
apps/desktop/src/renderer/lib/sessions.ts Extracts and exports stripTerminalLabelControls; adds stripTerminalChromeFromLabel to clean Claude Code UI chrome from session labels.
apps/desktop/src/renderer/lib/visualContextFormatting.ts New file providing prompt-formatting helpers for iOS, App Control, macOS VM, and browser context items; used by WorkSidebar for PTY context insertion.

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/desktop/src/renderer/components/terminals/WorkSidebar.tsx:298-304
When `window.ade.terminal.write` fails the only feedback is a `console.error`. The user will click an "attach" button and see nothing happen, with no indication that the write failed. The PTY path swallows the error silently, unlike the chat path. Consider propagating the failure or showing a toast similar to `submitError` in `WorkCliContinuationComposer`.

```suggestion
      .catch((error: unknown) => {
        console.error("[WorkSidebar] Failed to insert context into PTY", {
          sessionId: target.sessionId,
          toolType: target.toolType,
          error,
        });
        throw error;
      });
```

Reviews (4): Last reviewed commit: "ship: iteration 1 — address Greptile rev..." | Re-trigger Greptile

@vercel

vercel Bot commented May 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview May 14, 2026 8:07am

@arul28

arul28 commented May 14, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 166 files, which is 16 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 57cc4f51-4eb6-40bf-97f1-5560b88680da

📥 Commits

Reviewing files that changed from the base of the PR and between 8638e70 and 91719b7.

⛔ Files ignored due to path filters (23)
  • apps/ade-cli/package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
  • apps/desktop/package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
  • docs/ARCHITECTURE.md is excluded by !docs/**
  • docs/codex-cli-passthrough-audit.md is excluded by !docs/**
  • docs/development/windows-port-lane.md is excluded by !docs/**
  • docs/features/ade-code/README.md is excluded by !docs/**
  • docs/features/chat/README.md is excluded by !docs/**
  • docs/features/chat/agent-routing.md is excluded by !docs/**
  • docs/features/computer-use/README.md is excluded by !docs/**
  • docs/features/lanes/README.md is excluded by !docs/**
  • docs/features/lanes/runtime.md is excluded by !docs/**
  • docs/features/project-home/README.md is excluded by !docs/**
  • docs/features/proof.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/README.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/ios-companion.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/remote-commands.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/README.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/pty-and-processes.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/runtime-isolation.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/ui-surfaces.md is excluded by !docs/**
  • docs/perf/files-run-tab-action-inventory.md is excluded by !docs/**
  • docs/perf/work-tab-action-inventory.md is excluded by !docs/**
  • docs/plans/ade-31-claude-agent-sdk-rewrite.md is excluded by !docs/**
📒 Files selected for processing (166)
  • apps/ade-cli/package.json
  • apps/ade-cli/pnpm-workspace.yaml
  • apps/ade-cli/src/adeRpcServer.test.ts
  • apps/ade-cli/src/adeRpcServer.ts
  • apps/ade-cli/src/cli.test.ts
  • apps/ade-cli/src/cli.ts
  • apps/ade-cli/src/headlessLinearServices.test.ts
  • apps/ade-cli/src/services/sync/syncHostService.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.ts
  • apps/ade-cli/src/tuiClient/__tests__/ChatView.test.tsx
  • apps/ade-cli/src/tuiClient/__tests__/HeaderFooter.test.tsx
  • apps/ade-cli/src/tuiClient/__tests__/Palettes.test.tsx
  • apps/ade-cli/src/tuiClient/__tests__/RightPane.test.tsx
  • apps/ade-cli/src/tuiClient/__tests__/TerminalPane.test.tsx
  • apps/ade-cli/src/tuiClient/__tests__/adeApi.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/aggregate.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/appInput.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/commands.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/feedback.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/format.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/highlightCache.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/keybindings.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/planMode.test.ts
  • apps/ade-cli/src/tuiClient/adeApi.ts
  • apps/ade-cli/src/tuiClient/aggregate.ts
  • apps/ade-cli/src/tuiClient/app.tsx
  • apps/ade-cli/src/tuiClient/commands.ts
  • apps/ade-cli/src/tuiClient/components/ChatView.tsx
  • apps/ade-cli/src/tuiClient/components/FooterControls.tsx
  • apps/ade-cli/src/tuiClient/components/RightPane.tsx
  • apps/ade-cli/src/tuiClient/components/SlashPalette.tsx
  • apps/ade-cli/src/tuiClient/components/TerminalPane.tsx
  • apps/ade-cli/src/tuiClient/connection.ts
  • apps/ade-cli/src/tuiClient/feedback.ts
  • apps/ade-cli/src/tuiClient/format.ts
  • apps/ade-cli/src/tuiClient/heartbeat.ts
  • apps/ade-cli/src/tuiClient/highlightCache.ts
  • apps/ade-cli/src/tuiClient/keybindings/index.ts
  • apps/ade-cli/src/tuiClient/planMode.ts
  • apps/ade-cli/src/tuiClient/spinTick.tsx
  • apps/ade-cli/src/tuiClient/theme.ts
  • apps/ade-cli/src/tuiClient/types.ts
  • apps/desktop/package.json
  • apps/desktop/scripts/audit-chat-model-runtime.mjs
  • apps/desktop/src/main/main.ts
  • apps/desktop/src/main/services/adeActions/registry.test.ts
  • apps/desktop/src/main/services/adeActions/registry.ts
  • apps/desktop/src/main/services/ai/tools/ctoOperatorTools.test.ts
  • apps/desktop/src/main/services/ai/tools/ctoOperatorTools.ts
  • apps/desktop/src/main/services/ai/tools/systemPrompt.test.ts
  • apps/desktop/src/main/services/chat/agentChatService.suggestLaneName.test.ts
  • apps/desktop/src/main/services/chat/agentChatService.test.ts
  • apps/desktop/src/main/services/chat/agentChatService.ts
  • apps/desktop/src/main/services/chat/claudeMcpServers.test.ts
  • apps/desktop/src/main/services/chat/claudeMcpServers.ts
  • apps/desktop/src/main/services/chat/claudeOutputStyles.test.ts
  • apps/desktop/src/main/services/chat/cursorSdkProtocol.ts
  • apps/desktop/src/main/services/chat/cursorSdkWorker.ts
  • apps/desktop/src/main/services/cto/ctoStateService.ts
  • apps/desktop/src/main/services/github/githubService.test.ts
  • apps/desktop/src/main/services/github/githubService.ts
  • apps/desktop/src/main/services/ipc/registerIpc.ts
  • apps/desktop/src/main/services/lanes/laneService.test.ts
  • apps/desktop/src/main/services/lanes/laneService.ts
  • apps/desktop/src/main/services/localRuntime/localRuntimeConnectionPool.ts
  • apps/desktop/src/main/services/opencode/openCodeRuntime.test.ts
  • apps/desktop/src/main/services/opencode/openCodeRuntime.ts
  • apps/desktop/src/main/services/orchestrator/coordinatorAgent.test.ts
  • apps/desktop/src/main/services/orchestrator/coordinatorAgent.ts
  • apps/desktop/src/main/services/orchestrator/delegationContracts.ts
  • apps/desktop/src/main/services/probeLocalhostPort.test.ts
  • apps/desktop/src/main/services/probeLocalhostPort.ts
  • apps/desktop/src/main/services/pty/ptyService.test.ts
  • apps/desktop/src/main/services/pty/ptyService.ts
  • apps/desktop/src/main/services/review/reviewRuleRegistry.ts
  • apps/desktop/src/main/services/sync/syncHostService.test.ts
  • apps/desktop/src/main/services/sync/syncRemoteCommandService.test.ts
  • apps/desktop/src/main/utils/ansiStrip.test.ts
  • apps/desktop/src/main/utils/ansiStrip.ts
  • apps/desktop/src/main/utils/sessionSummary.test.ts
  • apps/desktop/src/main/utils/sessionSummary.ts
  • apps/desktop/src/main/utils/terminalSessionSignals.test.ts
  • apps/desktop/src/main/utils/terminalSessionSignals.ts
  • apps/desktop/src/preload/global.d.ts
  • apps/desktop/src/preload/preload.test.ts
  • apps/desktop/src/preload/preload.ts
  • apps/desktop/src/renderer/browserMock.ts
  • apps/desktop/src/renderer/components/automations/adeActionSchemas.ts
  • apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatMessageList.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatMessageList.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.submit.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
  • apps/desktop/src/renderer/components/chat/ChatAppControlPanel.test.tsx
  • apps/desktop/src/renderer/components/chat/ChatAppControlPanel.tsx
  • apps/desktop/src/renderer/components/chat/ChatBuiltInBrowserPanel.test.tsx
  • apps/desktop/src/renderer/components/chat/ChatBuiltInBrowserPanel.tsx
  • apps/desktop/src/renderer/components/chat/ChatIosSimulatorPanel.tsx
  • apps/desktop/src/renderer/components/chat/ChatSubagentsPanel.test.tsx
  • apps/desktop/src/renderer/components/chat/ChatSubagentsPanel.tsx
  • apps/desktop/src/renderer/components/chat/ChatWorkLogBlock.tsx
  • apps/desktop/src/renderer/components/chat/missionControlTextTools.ts
  • apps/desktop/src/renderer/components/lanes/LaneWorkPane.tsx
  • apps/desktop/src/renderer/components/lanes/LanesPage.test.ts
  • apps/desktop/src/renderer/components/lanes/LanesPage.tsx
  • apps/desktop/src/renderer/components/lanes/lanePageModel.ts
  • apps/desktop/src/renderer/components/lanes/useLaneWorkSessions.test.ts
  • apps/desktop/src/renderer/components/lanes/useLaneWorkSessions.ts
  • apps/desktop/src/renderer/components/run/CommandCard.test.tsx
  • apps/desktop/src/renderer/components/run/LaneRuntimeBar.tsx
  • apps/desktop/src/renderer/components/run/RunPage.test.tsx
  • apps/desktop/src/renderer/components/run/RunPage.tsx
  • apps/desktop/src/renderer/components/run/processUtils.test.ts
  • apps/desktop/src/renderer/components/shared/ModelCatalogPanel.tsx
  • apps/desktop/src/renderer/components/terminals/MacosVmPanel.test.tsx
  • apps/desktop/src/renderer/components/terminals/MacosVmPanel.tsx
  • apps/desktop/src/renderer/components/terminals/SessionCard.tsx
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.tsx
  • apps/desktop/src/renderer/components/terminals/SessionInfoPopover.tsx
  • apps/desktop/src/renderer/components/terminals/SessionListPane.test.tsx
  • apps/desktop/src/renderer/components/terminals/SessionListPane.tsx
  • apps/desktop/src/renderer/components/terminals/TerminalsPage.tsx
  • apps/desktop/src/renderer/components/terminals/WorkCliSessionHeader.test.tsx
  • apps/desktop/src/renderer/components/terminals/WorkCliSessionHeader.tsx
  • apps/desktop/src/renderer/components/terminals/WorkSidebar.test.tsx
  • apps/desktop/src/renderer/components/terminals/WorkSidebar.tsx
  • apps/desktop/src/renderer/components/terminals/WorkStartSurface.test.tsx
  • apps/desktop/src/renderer/components/terminals/WorkStartSurface.tsx
  • apps/desktop/src/renderer/components/terminals/WorkViewArea.test.tsx
  • apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx
  • apps/desktop/src/renderer/components/terminals/cliLaunch.test.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.test.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.ts
  • apps/desktop/src/renderer/lib/sessions.test.ts
  • apps/desktop/src/renderer/lib/sessions.ts
  • apps/desktop/src/renderer/lib/terminalAttention.test.ts
  • apps/desktop/src/renderer/lib/terminalAttention.ts
  • apps/desktop/src/renderer/lib/visualContextFormatting.ts
  • apps/desktop/src/renderer/lib/workPtyContextEvents.ts
  • apps/desktop/src/renderer/state/appStore.ts
  • apps/desktop/src/shared/adeCliGuidance.ts
  • apps/desktop/src/shared/adeLayout.ts
  • apps/desktop/src/shared/adeRuntimeIpc.test.ts
  • apps/desktop/src/shared/adeRuntimeIpc.ts
  • apps/desktop/src/shared/cliLaunch.ts
  • apps/desktop/src/shared/ipc.ts
  • apps/desktop/src/shared/modelCatalog.ts
  • apps/desktop/src/shared/types/chat.ts
  • apps/desktop/src/shared/types/config.ts
  • apps/desktop/src/shared/types/sessions.ts
  • apps/desktop/src/shared/types/sync.ts
  • apps/ios/ADE/Models/RemoteModels.swift
  • apps/ios/ADE/Services/SyncService.swift
  • apps/ios/ADE/Views/Work/WorkPreviews.swift
  • apps/ios/ADE/Views/Work/WorkRootComponents.swift
  • apps/ios/ADE/Views/Work/WorkRootScreen+Actions.swift
  • apps/ios/ADE/Views/Work/WorkRootScreen+Selection.swift
  • apps/ios/ADE/Views/Work/WorkRootScreen.swift
  • apps/ios/ADE/Views/Work/WorkSelectionActionBar.swift
  • apps/ios/ADETests/ADETests.swift
  • scripts/dev-all.mjs
  • scripts/dev-code.mjs
  • scripts/dev-desktop.mjs
  • scripts/dev-shared.mjs
  • scripts/perf-cdp-helper.mjs
  • scripts/seed-perf-pass-files-run.mjs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/optimizing-files-and-run-tab-7d224fc4

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.

@arul28

arul28 commented May 14, 2026

Copy link
Copy Markdown
Owner Author

@greptile review

@capy-ai

capy-ai Bot commented May 14, 2026

Copy link
Copy Markdown

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

Copilot AI commented May 14, 2026

Copy link
Copy Markdown
Contributor

@copilot review but do not make fixes

Reviewed commits 12cd3a3 and 77b9b43 without applying fixes. I don’t see a new blocking issue from this pass; main remaining risk is regression surface due to breadth of runtime/session changes, so targeted follow-up validation around Files/Run flows is still recommended. Reference: 12cd3a3.

Copilot finished work on behalf of arul28 May 14, 2026 07:35
Comment thread apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx
Comment thread apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx
Comment thread apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx
Comment thread apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx Outdated
Comment thread apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx Outdated
@arul28

arul28 commented May 14, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

@arul28

arul28 commented May 14, 2026

Copy link
Copy Markdown
Owner Author

@greptile review

@arul28
arul28 merged commit 3233e16 into main May 14, 2026
5 of 6 checks passed
@arul28
arul28 deleted the ade/optimizing-files-and-run-tab-7d224fc4 branch May 14, 2026 08:25
arul28 added a commit that referenced this pull request Jun 15, 2026
ADE's Work-tab Claude chat (Agent SDK) locked MCP to managed-only
(allowManagedMcpServersOnly + empty allowlist) — a context/perf trim from
#294 that silently stripped the user's configured MCP servers
(~/.claude.json, project .mcp.json) from chats, making the SDK chat
strictly less capable than an `ade` CLI session for the same task (e.g.
iOS automation / WebDriverAgent). ENABLE_TOOL_SEARCH now keeps large tool
catalogs cheap, so the trim is no longer worth the capability loss.

- Remove the unconditional lock so normal chats load user MCP via settingSources.
- Keep lightweight side-jobs (auto-title / lane-naming) lean via strictMcpConfig.
- Orchestration sessions keep managed-only isolation in their own block.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arul28 added a commit that referenced this pull request Jun 15, 2026
)

* fix(chat): load user MCP servers in Claude chats (parity with CLI)

ADE's Work-tab Claude chat (Agent SDK) locked MCP to managed-only
(allowManagedMcpServersOnly + empty allowlist) — a context/perf trim from
#294 that silently stripped the user's configured MCP servers
(~/.claude.json, project .mcp.json) from chats, making the SDK chat
strictly less capable than an `ade` CLI session for the same task (e.g.
iOS automation / WebDriverAgent). ENABLE_TOOL_SEARCH now keeps large tool
catalogs cheap, so the trim is no longer worth the capability loss.

- Remove the unconditional lock so normal chats load user MCP via settingSources.
- Keep lightweight side-jobs (auto-title / lane-naming) lean via strictMcpConfig.
- Orchestration sessions keep managed-only isolation in their own block.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ship: iter 1 — harden normal-chat MCP test (Greptile P2)

Assert strictMcpConfig is absent in the normal-chat test, guarding against
it leaking into non-lightweight sessions (which would silently re-block the
user's MCP servers). Mirrors the lightweight test's positive assertion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ship: iter 2 — isolate MCP for orchestration lead sessions (Codex P1)

Removing the base MCP lock let draft / role-marked orchestration leads
(no bundle yet → orchestration MCP block skipped) load user/project MCP
servers, which could restore tool capability the read-only lead is denied
via disallowedTools. Apply strictMcpConfig whenever isOrchestrationLeadSession
is true, not only when the orchestration MCP server exists. strictMcpConfig
still permits the programmatic orchestration server for bundled leads.
Workers/validators do real work and keep user MCP.

Regression tests: draft-lead and role-marked-lead now assert strictMcpConfig.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants