Skip to content

projectless-chat-reliability -> Primary#900

Merged
arul28 merged 5 commits into
mainfrom
ade/start-skill-some-issues-saw-19e56cbe
Jul 25, 2026
Merged

projectless-chat-reliability -> Primary#900
arul28 merged 5 commits into
mainfrom
ade/start-skill-some-issues-saw-19e56cbe

Conversation

@arul28

@arul28 arul28 commented Jul 24, 2026

Copy link
Copy Markdown
Owner

ADE   Open in ADE  ·  ade/start-skill-some-issues-saw-19e56cbe branch  ·  PR #900

Summary by CodeRabbit

  • New Features
    • Personal chat sessions now repair legacy surface metadata and preserve correct session surface details when reopened.
    • Personal chats warm up in the background for faster access on existing setups.
    • Built-in browser link routing is improved, with cancelable navigation and clearer in-app vs external fallback behavior.
  • Bug Fixes
    • Personal chat listing and transcript/turn-active checks now reliably resolve the correct personal session.
    • Session history handling and byte estimation for trimming are more robust.
  • Tests
    • Added/expanded tests for browser navigation events, legacy metadata repair, session restoration, and isolated environment setup/teardown.

Greptile Summary

This PR improves projectless personal chat reliability. The main changes are:

  • Background warmup for existing personal chat runtimes.
  • Preservation and repair of personal session surface metadata.
  • Independent loading for the chat list and model catalog.
  • Personal-scoped ADE browser routing for transcript links.
  • Cleanup for chat history sizing, credential read state, terminal environment inheritance, tests, and docs.

Confidence Score: 5/5

Safe to merge with low risk.

The changes are targeted, covered by focused tests, and no current correctness or security issues were identified.

Files Needing Attention: No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The general-contract-validation-proof run executed the tests for the personal chats route, and all the relevant assertions about loading, session filtering, built-in routing, external fallback behavior, IME handling, and contrast behavior passed.
  • The test logs were inspected, confirming that the personal chats page loaded and that the UI asserted the expected page state and text content, including hasPage: true for the personal-chats-page and the provider unavailable notice.
  • UI capture artifacts were reviewed, showing the initial screenshot of the real desktop renderer personal chats route and a later screenshot after it settled.
  • A video artifact was examined to verify the run flow and transitions through the personal chats route across the test session.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
apps/ade-cli/src/services/personalChats/personalChatScope.ts Adds existing-state warmup and repairs non-automation legacy sessions to the personal surface before listing or acting on them.
apps/desktop/src/main/services/chat/agentChatService.ts Preserves persisted surface when reconstructing sessions and exposes internal surface repair for personal chat migration.
apps/desktop/src/renderer/components/personalChats/PersonalChatsPage.tsx Loads sessions independently from model catalog and routes transcript links into the personal browser collection with in-app failure handling.
apps/desktop/src/renderer/lib/openExternal.ts Makes built-in browser navigation cancelable by surfaces and factors bridge navigation with configurable fallback behavior.
apps/ade-cli/src/multiProjectRpcServer.ts Adds a personal chat scope factory that asynchronously warms existing personal chat state and reuses it for owned scopes.
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx Centralizes chat event resident-byte estimation and handles serialization failures consistently.

Sequence Diagram

sequenceDiagram
participant User as Personal Chats UI
participant Scope as PersonalChatScope
participant Runtime as Hidden chat runtime
participant Chat as AgentChatService
participant Browser as ADE Browser

User->>Scope: list / read / send personal chat
Scope->>Runtime: getRuntime() or background warmExisting()
Runtime->>Chat: listSessions/getSessionSummary
Chat-->>Scope: session summary with persisted surface
alt legacy non-automation surface
    Scope->>Chat: ensureSessionSurface(sessionId, "personal")
    Chat-->>Scope: repaired personal summary
end
Scope-->>User: personal chat results
User->>Browser: navigate link with tabCollection "personal"
Browser-->>User: personal browser tab opens or ADE error is shown
Loading

Reviews (5): Last reviewed commit: "ship: iteration 4 — prewarm shared perso..." | Re-trigger Greptile

@vercel

vercel Bot commented Jul 24, 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 Jul 25, 2026 12:12am

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Personal chat surface handling

Layer / File(s) Summary
Persisted surface restoration
apps/desktop/src/main/services/chat/agentChatService.*
Session surface metadata is restored, persisted when repaired, and covered by a reopen test.
Personal session resolution and repair
apps/ade-cli/src/services/personalChats/*
Legacy personal sessions are normalized, automation sessions excluded, and unresolved sessions handled explicitly.
Existing personal scope warm-up
apps/ade-cli/src/multiProjectRpcServer*, apps/ade-cli/src/services/personalChats/*
Existing personal-chat state is warmed during handler setup, with isolated test environment state.

Built-in browser navigation

Layer / File(s) Summary
Cancelable browser navigation and fallback
apps/desktop/src/renderer/lib/openExternal.*
Built-in browser navigation supports cancellation, failure callbacks, and conditional external fallback.
Personal browser page integration
apps/desktop/src/renderer/components/personalChats/*
Personal chat loading and browser-event handling are separated, with navigation errors shown in the page.

Runtime behavior and refactors

Layer / File(s) Summary
CLI promise and credential state handling
apps/ade-cli/src/headlessLinearServices.ts, apps/ade-cli/src/services/credentials/credentialStore.ts
Redundant awaits are removed and successful credential reads consistently report availability.
Desktop runtime and session state updates
apps/desktop/src/main/services/pty/ptyService.ts, apps/desktop/src/main/services/sessions/chatSessionProjection.ts
PTY environments omit ADE_DEFAULT_ROLE, and chat projection uses explicit collection construction.
History access and action wrappers
apps/desktop/src/main/services/adeActions/registry.ts, apps/desktop/src/main/services/storage/historyCompression.ts
History options and file-range reads use streamlined shared helpers.
Chat event byte estimation
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
Chat byte estimation and trimming reuse a shared resident-byte estimator.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • arul28/ADE#243: Earlier built-in browser URL routing and pending-navigation behavior.
  • arul28/ADE#291: Added the chat service surface persistence used by PersonalChatScope repair.
  • arul28/ADE#757: Introduced the PersonalChatScope extended by these surface and warm-up changes.

Suggested labels: desktop, docs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the PR, but the branch-style "-> Primary" suffix makes it noisy and not a clear summary. Rename it to a concise sentence like "Improve projectless chat reliability".
✅ Passed checks (3 passed)
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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 ade/start-skill-some-issues-saw-19e56cbe

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

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/desktop/src/renderer/components/personalChats/PersonalChatsPage.test.tsx`:
- Line 239: Remove the duplicate const bridge declarations in the affected test
scope, keeping a single bridge variable with the existing type and
initialization so the test compiles.

In `@apps/desktop/src/renderer/components/personalChats/PersonalChatsPage.tsx`:
- Around line 253-266: The openPersonalBrowser handler should claim valid
browser events before checking window.ade?.builtInBrowser, preventing fallback
handling when the bridge is unavailable. Preserve the existing URL guard, then
show the ADE-specific failure state when no bridge exists (or invoke
navigateUrlInAdeBrowser unconditionally so its failure callback handles it), and
add a regression test covering the missing-bridge path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4ea49965-58d5-40db-bbbc-93121881aa59

📥 Commits

Reviewing files that changed from the base of the PR and between 6a6a4e4 and 4635165.

⛔ Files ignored due to path filters (1)
  • docs/features/personal-chats/README.md is excluded by !docs/**
📒 Files selected for processing (17)
  • apps/ade-cli/src/headlessLinearServices.ts
  • apps/ade-cli/src/multiProjectRpcServer.test.ts
  • apps/ade-cli/src/multiProjectRpcServer.ts
  • apps/ade-cli/src/services/credentials/credentialStore.ts
  • apps/ade-cli/src/services/personalChats/personalChatScope.test.ts
  • apps/ade-cli/src/services/personalChats/personalChatScope.ts
  • apps/desktop/src/main/services/adeActions/registry.ts
  • apps/desktop/src/main/services/chat/agentChatService.test.ts
  • apps/desktop/src/main/services/chat/agentChatService.ts
  • apps/desktop/src/main/services/pty/ptyService.ts
  • apps/desktop/src/main/services/sessions/chatSessionProjection.ts
  • apps/desktop/src/main/services/storage/historyCompression.ts
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
  • apps/desktop/src/renderer/components/personalChats/PersonalChatsPage.test.tsx
  • apps/desktop/src/renderer/components/personalChats/PersonalChatsPage.tsx
  • apps/desktop/src/renderer/lib/openExternal.test.ts
  • apps/desktop/src/renderer/lib/openExternal.ts

@arul28

arul28 commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f872c502c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/lib/openExternal.ts Outdated
@arul28

arul28 commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ee7da52aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@arul28

arul28 commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1fac1293d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/ade-cli/src/multiProjectRpcServer.ts Outdated
@arul28

arul28 commented Jul 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 2898b3141e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@arul28
arul28 merged commit 3ffc58c into main Jul 25, 2026
35 checks passed
@arul28
arul28 deleted the ade/start-skill-some-issues-saw-19e56cbe branch July 25, 2026 04:27
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