Skip to content

Fix background naming and remote runtime bootstrap#551

Merged
arul28 merged 2 commits into
mainfrom
ade/chat-20260610-105420-b2e74a31
Jun 10, 2026
Merged

Fix background naming and remote runtime bootstrap#551
arul28 merged 2 commits into
mainfrom
ade/chat-20260610-105420-b2e74a31

Conversation

@arul28

@arul28 arul28 commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Describe the change.

What Changed

Key files and behaviors.

Validation

How you tested.

Risks

Anything to watch.

ADE   Open in ADE  ·  ade/chat-20260610-105420-b2e74a31 branch  ·  PR #551

Greptile Summary

This PR makes two primary changes: (1) it extracts lane-name fallback logic into a new shared module (laneNameFallback.ts) and wires both the main process and renderer to use deterministic, prompt-derived fallback names instead of timestamp-based ones; and (2) it changes the remote runtime bootstrap to use an explicit socket path (--socket $ADE_HOME/sock/ade.sock) and removes the pre-connection runtime stop call.

  • Shared laneNameFallback module (apps/desktop/src/shared/laneNameFallback.ts): extracts deriveDeterministicLaneNameFromPrompt, GENERIC_LANE_FALLBACK_NAME, genericLaneFallbackName, and genericSuffixFromLaneFallbackName, resolving the duplicate-stopword-set drift risk flagged in previous reviews. Both agentChatService.ts (main) and AgentChatPane.tsx (renderer) now import from the single source of truth.
  • reasoningEffort propagation: titleReasoningEffort and summaryReasoningEffort are added to ResolvedChatConfig, plumbed through runSessionIntelligenceTask, and respected in ptyService.ts for CLI session title and summary generation. The legacy ai.chat.autoTitleReasoningEffort field is migrated into sessionIntelligence.titles.reasoningEffort on load.
  • Remote runtime bootstrap: stopRemoteRuntimeDaemon is removed; the RPC command now always includes --socket <channel-specific-socket> so a freshly uploaded helper CLI doesn't mismatch-recycle the desktop-owned brain.

Confidence Score: 5/5

Safe to merge; changes are well-scoped and thoroughly tested. The shared laneNameFallback module resolves the previously flagged stopword drift, and the remote bootstrap socket change has full test coverage across all channel variants.

All core paths (lane-name derivation, remote bootstrap, reasoning-effort plumbing, null-model-clear) have matching test updates. The only open question is timing of Claude's native vs. ADE-generated title for CLI sessions, but the worst outcome is a brief title flicker, not data loss or a broken flow.

apps/desktop/src/main/services/pty/ptyService.ts — the dual-title-generator path for Claude CLI sessions is new and worth watching in production.

Important Files Changed

Filename Overview
apps/desktop/src/shared/laneNameFallback.ts New shared module centralising lane-name derivation logic; fixes the duplicate-stopword-set problem. Logic is clean and well-tested.
apps/desktop/src/main/services/chat/agentChatService.ts Imports shared lane-name helpers, adds reasoningEffort to ResolvedChatConfig and runSessionIntelligenceTask, fixes titleModelId resolution to use hasOwnProperty so explicit null correctly clears overrides.
apps/desktop/src/main/services/remoteRuntime/remoteBootstrap.ts Removes stopRemoteRuntimeDaemon call and adds --socket flag to all rpc --stdio invocations via new remoteRuntimeRpcCommand helper.
apps/desktop/src/main/services/pty/ptyService.ts Removes the Claude CLI exclusion from first-prompt title generation so ADE now also generates titles for Claude sessions; adds titleReasoningEffort and summaryReasoningEffort plumbing.
apps/desktop/src/main/services/config/projectConfigService.ts Adds coerceFeatureReasoningOverrides, null-clear handling for sessionIntelligence model IDs, reasoningEffort fields, and legacy autoTitleReasoningEffort migration.
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx Replaces timestamp-based fallback with deterministic prompt slug, increases naming timeout to 10s, adds onFallback/namingModelId/warning plumbing, and respects titleSettings.enabled in the auto-create path.
apps/desktop/src/renderer/components/settings/AiFeaturesSection.tsx Migrates autoTitleReasoningEffort read/write to sessionIntelligence.titles.reasoningEffort, adds null-clear for feature model overrides, and wires summaries.reasoningEffort for terminal_summaries.
apps/desktop/src/main/services/ai/aiIntegrationService.ts Bypasses the feature-flag gate for session_title tasks (preventing titles from being silently skipped when the backing feature flag is absent) and threads reasoningEffort through summarizeTerminal.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User submits prompt] --> B[AgentChatPane: compute genericSuffix timestamp]
    B --> C{titleSettings.enabled?}
    C -- false --> D[createDeterministicAutoLaneName\nprompt + genericSuffix]
    C -- true / undefined --> E[suggestAutoLaneName\nwith 10s timeout]
    E --> F{AI model\nsucceeds?}
    F -- yes --> G[Use AI-generated name]
    F -- timeout / error --> H[onFallback warning message]
    H --> D
    D --> I[fallbackName = slug or\nparallel-task-TIMESTAMP]
    G --> J[suggestLaneName IPC call\nto main process]
    I --> J
    J --> K[agentChatService:\nsuggestLaneNameFromPrompt]
    K --> L{AI model\nsucceeds?}
    L -- yes --> M[normalizeSuggestedLaneName]
    L -- no --> N[uniquePromptFallbackLaneName\npromptFallback vs explicitFallback]
    N --> O{promptFallback ==\nGENERIC_LANE_FALLBACK_NAME?}
    O -- no --> P[Return prompt slug]
    O -- yes --> Q[genericSuffixFromLaneFallbackName\nextract timestamp from fallbackName]
    Q --> R[genericLaneFallbackName\nparallel-task-TIMESTAMP]
    M --> S[Final lane name]
    P --> S
    R --> S
Loading

Comments Outside Diff (1)

  1. apps/desktop/src/main/services/sync/syncService.test.ts, line 877-897 (link)

    P2 Retry expectations changed dramatically without a matching syncService.ts change

    The expected createSyncHostServiceMock call sequence grew from [8787, 8788] (one retry) to eight identical 8787 attempts before 8788, and disposeFirstAttempt expectations jumped from 1 to 8 — a 8× change in retry count. syncService.ts is not part of this PR's diff. If the sync service's retry behaviour was changed in a prior commit the test is now correctly documenting it, but if syncService.ts wasn't changed recently this test update may be masking a silent test failure or a hard-coded retry constant that was altered elsewhere. Worth confirming that the actual runtime retry count matches these expectations intentionally.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/desktop/src/main/services/sync/syncService.test.ts
    Line: 877-897
    
    Comment:
    **Retry expectations changed dramatically without a matching `syncService.ts` change**
    
    The expected `createSyncHostServiceMock` call sequence grew from `[8787, 8788]` (one retry) to eight identical `8787` attempts before `8788`, and `disposeFirstAttempt` expectations jumped from 1 to 8 — a 8× change in retry count. `syncService.ts` is not part of this PR's diff. If the sync service's retry behaviour was changed in a prior commit the test is now correctly documenting it, but if `syncService.ts` wasn't changed recently this test update may be masking a silent test failure or a hard-coded retry constant that was altered elsewhere. Worth confirming that the actual runtime retry count matches these expectations intentionally.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Claude Code

Fix All in Claude Code

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

---

### Issue 1 of 2
apps/desktop/src/main/services/pty/ptyService.ts:1417-1445
**Claude sessions may see competing title writes**

The old guard `if (isClaudeTrackedCliToolType(entry.toolTypeHint)) return` was deliberately keeping ADE's prompt summariser out of the Claude path so that Claude's own `ai-title` event wins. Removing it means both ADE's `tryCliUserTitleFromWrite` (fires immediately on first prompt) and Claude's native title pipeline run concurrently. Whichever `sessionService.updateMeta` call lands last determines the displayed title, so users may see the ADE-generated title briefly replaced by Claude's title (or vice-versa if the network is slow). The test passes because it only checks that `summarizeTerminal` was called — it does not assert a stable final title after both pipelines complete. If the intent is "ADE title first, Claude title overwrites when ready", the session update path for Claude's `ai-title` event should take precedence (e.g. set `manuallyNamed: true` or a higher-priority flag when applying Claude's title), otherwise the outcome is non-deterministic depending on network timing.

### Issue 2 of 2
apps/desktop/src/renderer/components/onboarding/AiRuntimesBand.tsx:1348-1354
**Previously-cleared `null` overrides are silently dropped during the rebuild loop**

The loop `for (const [k, v] of Object.entries(aiConfig?.featureModelOverrides ?? {})) { if (typeof v === "string" && v) overrides[k] = v; }` only re-emits non-null string values from the current local config snapshot. If `aiConfig.featureModelOverrides` already contains `{ terminal_summaries: null }` from a prior clear, that entry is skipped and the outgoing update omits it. Because `updateConfig` performs a merge, the persisted `null` survives in storage and the effective config remains correct — but the in-memory `overrides` object sent to the handler no longer reflects the full intended state. This is harmless today only because the merge is additive, but any future handler that treats the payload as a replacement would silently re-enable cleared features.

Reviews (2): Last reviewed commit: "Address lane fallback review" | Re-trigger Greptile

@vercel

vercel Bot commented Jun 10, 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 Jun 10, 2026 6:46pm

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@arul28, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 23 minutes and 26 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b719984b-c49f-4b42-bb50-c2404e002f94

📥 Commits

Reviewing files that changed from the base of the PR and between 8cb3d1e and eb231cf.

⛔ Files ignored due to path filters (5)
  • docs/features/chat/README.md is excluded by !docs/**
  • docs/features/chat/composer-and-ui.md is excluded by !docs/**
  • docs/features/onboarding-and-settings/README.md is excluded by !docs/**
  • docs/features/onboarding-and-settings/configuration-schema.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/ui-surfaces.md is excluded by !docs/**
📒 Files selected for processing (20)
  • apps/desktop/src/main/services/ai/aiIntegrationService.ts
  • apps/desktop/src/main/services/chat/agentChatService.test.ts
  • apps/desktop/src/main/services/chat/agentChatService.ts
  • apps/desktop/src/main/services/config/projectConfigService.test.ts
  • apps/desktop/src/main/services/config/projectConfigService.ts
  • apps/desktop/src/main/services/pty/ptyService.test.ts
  • apps/desktop/src/main/services/pty/ptyService.ts
  • apps/desktop/src/main/services/remoteRuntime/remoteBootstrap.test.ts
  • apps/desktop/src/main/services/remoteRuntime/remoteBootstrap.ts
  • apps/desktop/src/main/services/sync/syncService.test.ts
  • apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
  • apps/desktop/src/renderer/components/lanes/laneAgents.ts
  • apps/desktop/src/renderer/components/onboarding/AiRuntimesBand.tsx
  • apps/desktop/src/renderer/components/settings/AiFeaturesSection.tsx
  • apps/desktop/src/renderer/components/terminals/SessionCard.tsx
  • apps/desktop/src/renderer/lib/draftLaunchJobs.ts
  • apps/desktop/src/shared/laneNameFallback.test.ts
  • apps/desktop/src/shared/laneNameFallback.ts
  • apps/desktop/src/shared/types/config.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/chat-20260610-105420-b2e74a31

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 Jun 10, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

Comment thread apps/desktop/src/main/services/chat/agentChatService.ts Outdated
Comment thread apps/desktop/src/main/services/chat/agentChatService.ts
@arul28

arul28 commented Jun 10, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

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