Skip to content

feat: add default chat workspace#1799

Merged
zerob13 merged 6 commits into
devfrom
codex/default-workspace-sdd
Jun 22, 2026
Merged

feat: add default chat workspace#1799
zerob13 merged 6 commits into
devfrom
codex/default-workspace-sdd

Conversation

@zerob13

@zerob13 zerob13 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add first-run default chat workspace registration and typed renderer metadata.
  • Show built-in/no-project sessions under Chats with chat icons, separate from user project folders.
  • Preserve explicit no-project session creation and bound slow AGENTS.md reads with cache.

Closes #1795

Tests

  • pnpm run format
  • pnpm run i18n
  • pnpm run lint
  • pnpm run typecheck
  • pnpm exec vitest run test/main/lib/agentRuntime/systemEnvPromptBuilder.test.ts
  • pnpm exec vitest run test/main/presenter/agentRuntimePresenter/agentRuntimePresenter.test.ts
  • pnpm exec vitest run test/renderer/components/NewThreadPage.test.ts test/renderer/components/WindowSideBar.test.ts
  • git diff --check

Summary by CodeRabbit

  • New Features
    • Automatic built-in “Chats” workspace initialization for first-run sessions, with safe fallback paths.
    • “No project” session selection now preserves an explicitly empty project (null directory).
  • Bug Fixes
    • More reliable session title generation and correct “no-project” chat rendering by waiting for persisted first-turn readiness/content.
  • Performance Improvements
    • Faster system-prompt building via cached, deduplicated AGENTS.md reads with timeout budgeting.
    • Slow-step instrumentation for prompt composition and pre-stream setup.
  • Localization
    • Added “Chats” sidebar label translations across supported languages.
  • Tests
    • Expanded coverage for default workspace setup, readiness timing, and sidebar/new thread “Chats” behavior.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 09778e02-9254-4f6b-afea-4a38bdc9411d

📥 Commits

Reviewing files that changed from the base of the PR and between bc3ce59 and da3e8a9.

📒 Files selected for processing (2)
  • src/main/presenter/agentRuntimePresenter/index.ts
  • test/main/presenter/agentRuntimePresenter/agentRuntimePresenter.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/presenter/agentRuntimePresenter/index.ts

📝 Walkthrough

Walkthrough

Adds a built-in default chat workspace (~/Documents/DeepChat) created on first run via ProjectPresenter.ensureDefaultWorkspace(), propagated through bootstrap as defaultChatWorkspacePath. The sidebar and NewThreadPage render it as a non-reorderable "Chats" group. projectDir is widened to accept explicit null. First-turn readiness tracking is added to AgentRuntimePresenter to gate session-title generation. AGENTS.md reads gain stale-while-revalidate caching with bounded-wait timeout and slow-step timing throughout pre-stream phases.

Changes

Default Chat Workspace + First-Turn Readiness

Layer / File(s) Summary
Shared contracts and type widening
src/shared/contracts/common.ts, src/shared/contracts/routes/sessions.routes.ts, src/shared/types/agent-interface.d.ts, src/shared/types/presenters/project.presenter.d.ts
StartupBootstrapShellSchema gains optional nullable defaultChatWorkspacePath; CreateSessionInputSchema.projectDir and CreateSessionInput.projectDir widened to string | null; IAgentImplementation gets optional waitForFirstTurnReady; IProjectPresenter gets ensureDefaultWorkspace().
ProjectPresenter.ensureDefaultWorkspace()
src/main/presenter/projectPresenter/index.ts
Implements candidate path resolution (Documents → Home → userData), guarded mkdirSync, project upsert, environment-preference marking, and conditional setDefaultProjectPath with helpers getDefaultWorkspaceCandidates, isDefaultWorkspaceCandidate, hasExistingWorkspaceHistory, createFirstAvailableDefaultWorkspace.
Startup bootstrap route wiring
src/main/routes/index.ts
Both coordinator and non-coordinator startupGetBootstrapRoute paths await ensureDefaultWorkspace() and include defaultChatWorkspacePath in the returned bootstrap payload.
Renderer store and bootstrap hydration
src/renderer/src/stores/ui/project.ts, src/renderer/src/views/ChatTabView.vue
Adds defaultChatWorkspacePath ref to useProjectStore and exports it; updates applyBootstrapDefaultProjectPath signature to accept optional chatWorkspacePath; ChatTabView passes both paths from bootstrap.
First-turn readiness tracking
src/main/presenter/agentRuntimePresenter/index.ts, src/main/presenter/agentRuntimePresenter/process.ts, src/main/presenter/agentRuntimePresenter/types.ts
Adds firstTurnReadySessions/firstTurnReadyWaiters state, public waitForFirstTurnReady with timeout, plus internal helpers; clears readiness on initSession, destroySession, clearMessages; wires one-time onFirstProviderRoundReady callback in processStream after first non-empty flush.
Pre-stream timing and slow-step logging
src/main/presenter/agentRuntimePresenter/index.ts
Adds PRE_STREAM_SLOW_STEP_MS (500ms) constant, logSlowPreStreamStep helper, and per-step stepStartedAt timing across processMessage phases (generation-settings, active-skills, tool-definitions, system-prompt, compaction-prepare, memory-injection, context-build) and buildSystemPromptWithSkills phases (skills-metadata-load, active-skills-load, fingerprint, pinned-skills-load, env-prompt, tooling-prompt, compose); adds boundary timing for pre-stream-provider-start in runStreamForMessage.
Session projectDir resolver and title generation
src/main/presenter/agentSessionPresenter/index.ts
Adds resolveCreateSessionProjectDir preserving explicit null; refactors generateSessionTitle to await waitForSessionTitleMessages which polls for idle/readiness via waitForFirstTurnReady (when available) before fetching persisted messages.
Sidebar Chats group and NewThreadPage
src/renderer/src/components/WindowSideBar.vue, src/renderer/src/pages/NewThreadPage.vue
WindowSideBar detects "Chats" groups by NO_PROJECT_GROUP_ID or normalized defaultChatWorkspacePath match, adds getGroupLabel/getGroupIcon helpers, manages defaultCollapsedChatGroupIds. NewThreadPage renders dynamic project icon, labels clear-project as "Chats" with chat icon, computes selectedSessionProjectDir (null for explicit no-project), and passes it to session creation.
i18n sidebar.chats translations
src/renderer/src/i18n/*/chat.json
Adds sidebar.chats key to all 20 locale files (da-DK, de-DE, en-US, es-ES, fa-IR, fr-FR, he-IL, id-ID, it-IT, ja-JP, ko-KR, ms-MY, pl-PL, pt-BR, ru-RU, tr-TR, vi-VN, zh-CN, zh-HK, zh-TW).
Tests: default workspace, session, dispatcher, renderer
test/main/presenter/projectPresenter/projectPresenter.test.ts, test/main/routes/dispatcher.test.ts, test/main/presenter/agentSessionPresenter/agentSessionPresenter.test.ts, test/main/presenter/agentRuntimePresenter/agentRuntimePresenter.test.ts, test/renderer/...
Covers ensureDefaultWorkspace scenarios (first-run, idempotency, custom-path guard, fallback, archived); dispatcher bootstrap shape; createSession with projectDir: null; title generation gating on messages-ready and waitForFirstTurnReady; processStream flush/ready/tool ordering; renderer store hydration/clearing; sidebar Chats group; NewThreadPage no-project creation.
Default workspace and session-lag specs
docs/features/default-workspace/spec.md, docs/issues/session-start-lag/spec.md
Default-workspace feature spec (path resolution, UX grouping, acceptance criteria, constraints, non-goals) and session-start-lag spec (slow step, caching strategy, acceptance criteria).

Session Start Lag: AGENTS.md Cache

Layer / File(s) Summary
AGENTS.md stale-while-revalidate cache
src/main/lib/agentRuntime/systemEnvPromptBuilder.ts
Adds AgentsCacheEntry structure, module-level agentsInstructionsCache map, logSlowSystemEnvStep helper, readAgentsInstructionsFromDisk (ENOENT-silent, structured error log), refreshAgentsInstructions (in-flight promise tracking), waitForAgentsInstructions (Promise.race vs AGENTS_READ_BUDGET_MS), and replaces readAgentsInstructions with cache-first/stale-while-revalidate flow. buildSystemEnvPrompt adds per-step timing.
systemEnvPromptBuilder tests
test/main/lib/agentRuntime/systemEnvPromptBuilder.test.ts
Vitest suite covering missing AGENTS.md (ENOENT silent), successful read, structured error-warning, and fake-timer cache-reuse/deferred-read scenarios.

Sequence Diagram(s)

sequenceDiagram
  participant Renderer as ChatTabView (Renderer)
  participant Route as startupGetBootstrapRoute
  participant ProjectPresenter
  participant ProjectStore as useProjectStore
  participant WindowSideBar

  Renderer->>Route: startup.getBootstrap
  Route->>ProjectPresenter: ensureDefaultWorkspace()
  ProjectPresenter-->>Route: defaultChatWorkspacePath
  Route-->>Renderer: bootstrap { defaultProjectPath, defaultChatWorkspacePath }
  Renderer->>ProjectStore: applyBootstrapDefaultProjectPath(defaultProjectPath, defaultChatWorkspacePath)
  ProjectStore-->>WindowSideBar: defaultChatWorkspacePath ref updated
  WindowSideBar->>WindowSideBar: isChatsGroup() detects built-in group
  WindowSideBar->>WindowSideBar: getGroupLabel → "Chats", getGroupIcon → chat icon
Loading
sequenceDiagram
  participant AgentSessionPresenter
  participant AgentRuntimePresenter
  participant processStream
  participant waitForFirstTurnReady

  AgentSessionPresenter->>AgentRuntimePresenter: processMessage(sessionId, msg)
  AgentRuntimePresenter->>processStream: run with onFirstProviderRoundReady callback
  processStream->>processStream: first non-empty blocks flushed
  processStream->>AgentRuntimePresenter: onFirstProviderRoundReady()
  AgentRuntimePresenter->>waitForFirstTurnReady: markFirstTurnReady(sessionId)
  waitForFirstTurnReady-->>AgentSessionPresenter: resolves true
  AgentSessionPresenter->>AgentSessionPresenter: waitForSessionTitleMessages → fetch messages → generateTitle
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~65 minutes

Possibly related PRs

  • ThinkInAIXYZ/deepchat#1483: Both PRs change AgentSessionPresenter.createSession's projectDir handling — this PR introduces explicit null propagation via resolveCreateSessionProjectDir, while the other adds setSessionProjectDir for workspace drag-and-drop persistence.
  • ThinkInAIXYZ/deepchat#1495: This PR's NewThreadPage "no project" / projectDir: null behavior and clear-project UI semantics overlap directly with the other's clear-project control and selectionSource-driven state in the same component.
  • ThinkInAIXYZ/deepchat#1554: Both PRs modify how session-scoped projectDir is resolved and propagated through AgentSessionPresenter into the agent runtime, including preserving explicit null and avoiding fallback chains.

Poem

🐇 A rabbit digs a burrow by default,
No folder-picker halts the happy start.
~/Documents/DeepChat appears with a hop,
First-turn readiness signals: don't stop!
AGENTS.md cached, no lag in sight —
The sidebar says "Chats" and the icons shine bright. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add default chat workspace' is clear, concise, and directly summarizes the main feature implementation.
Linked Issues check ✅ Passed The code changes fully implement the acceptance criteria from issue #1795: creates default workspace at Documents/DeepChat with fallbacks, idempotent creation/reuse, preserves existing users' settings, enables session creation with null projectDir, provides cross-platform support, and optimizes AGENTS.md reads.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the default chat workspace feature: workspace initialization logic, project/session handling, renderer UI updates, i18n translations, and performance optimizations for AGENTS.md reads.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 codex/default-workspace-sdd

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.

@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: 3

🧹 Nitpick comments (2)
src/main/presenter/agentRuntimePresenter/index.ts (1)

970-970: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Measure the full pre-stream boundary.

pre-stream-total stops before runStreamForMessage, so it misses the remaining setup in that method (SessionStart, context recovery, and rate-limit waiting) that still happens before the provider starts streaming. Move the timer into runStreamForMessage or rename the metric so the warning reflects what it measures.

🤖 Prompt for 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.

In `@src/main/presenter/agentRuntimePresenter/index.ts` at line 970, The
logSlowPreStreamStep call with the 'pre-stream-total' metric is being logged
before all pre-stream setup operations complete. Move the logSlowPreStreamStep
call (currently logging 'pre-stream-total' with preStreamStartedAt) from its
current location to the end of the runStreamForMessage method so that the timer
captures the complete pre-stream boundary including SessionStart initialization,
context recovery, and rate-limit waiting that occur within runStreamForMessage
before the provider actually starts streaming.
src/main/routes/index.ts (1)

2476-2491: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Consider parallelizing ensureDefaultWorkspace() with agent loading.

The defaultChatWorkspacePath is fetched sequentially before the Promise.all that loads agents and ACP status. Since these operations appear independent, running them in parallel could reduce bootstrap latency.

⚡ Suggested optimization
 if (!coordinator) {
-  const defaultChatWorkspacePath = await runtime.projectPresenter.ensureDefaultWorkspace()
   const activeSessionId = runtime.agentSessionPresenter.getActiveSessionId(
     context.webContentsId
   )
   const activeSession = activeSessionId
     ? ((
         await runtime.agentSessionPresenter.getLightweightSessionsByIds([activeSessionId])
       )[0] ?? null)
     : null
-  const [agents, acpEnabled] = await Promise.all([
+  const [agents, acpEnabled, defaultChatWorkspacePath] = await Promise.all([
     runtime.configPresenter.listAgents(),
-    runtime.configPresenter.getAcpEnabled()
+    runtime.configPresenter.getAcpEnabled(),
+    runtime.projectPresenter.ensureDefaultWorkspace()
   ])

Apply the same pattern to the coordinator path at lines 2527-2541.

🤖 Prompt for 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.

In `@src/main/routes/index.ts` around lines 2476 - 2491, The
ensureDefaultWorkspace() call is being executed sequentially before the
Promise.all block that loads agents and ACP status, causing unnecessary
sequential delays. Move the ensureDefaultWorkspace() call into the Promise.all
alongside the runtime.configPresenter.listAgents() and
runtime.configPresenter.getAcpEnabled() calls to parallelize these independent
operations. Apply the same parallelization pattern to the coordinator path
section mentioned in the review to maintain consistency across the codebase.
🤖 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 `@src/renderer/src/stores/ui/project.ts`:
- Around line 100-102: The code block checking if defaultChatWorkspacePath
differs from defaultProjectPath and clearing it introduces an unwanted coupling
between two independent concepts: the system-managed chat workspace path and the
user-configurable default project path. Since the chat workspace should remain
stable at its system location regardless of project path changes, you should
remove this conditional logic (the if block checking and resetting
defaultChatWorkspacePath). If there is a deliberate architectural reason for
this coupling, add a clear comment explaining the intended relationship before
the conditional instead of silently clearing the value.

In `@test/main/presenter/projectPresenter/projectPresenter.test.ts`:
- Around line 175-194: The warnSpy created on the console.warn object is only
restored at the end of the test after all assertions. If any assertion fails
before reaching the warnSpy.mockRestore() call, the spy remains active and
affects subsequent tests. Wrap the test logic in a try/finally block so that
warnSpy.mockRestore() is guaranteed to execute in the finally block, ensuring
cleanup happens regardless of whether assertions pass or fail.

In `@test/renderer/components/WindowSideBar.test.ts`:
- Around line 1310-1380: The test setup has a path mismatch between the
defaultChatWorkspacePath and the projectEnvironments list. The
defaultChatWorkspacePath is set to '/Users/test/Documents/DeepChat/' with a
trailing slash, while the corresponding path in projectEnvironments is
'/Users/test/Documents/DeepChat' without the trailing slash. Since the
normalizePath function only trims whitespace and doesn't remove trailing
slashes, these paths won't match when compared by the isChatsGroup filter,
causing the chat workspace to not be properly filtered out during reordering.
Fix this by removing the trailing slash from the defaultChatWorkspacePath value
in the setup call to make it consistent with the projectEnvironments entry.

---

Nitpick comments:
In `@src/main/presenter/agentRuntimePresenter/index.ts`:
- Line 970: The logSlowPreStreamStep call with the 'pre-stream-total' metric is
being logged before all pre-stream setup operations complete. Move the
logSlowPreStreamStep call (currently logging 'pre-stream-total' with
preStreamStartedAt) from its current location to the end of the
runStreamForMessage method so that the timer captures the complete pre-stream
boundary including SessionStart initialization, context recovery, and rate-limit
waiting that occur within runStreamForMessage before the provider actually
starts streaming.

In `@src/main/routes/index.ts`:
- Around line 2476-2491: The ensureDefaultWorkspace() call is being executed
sequentially before the Promise.all block that loads agents and ACP status,
causing unnecessary sequential delays. Move the ensureDefaultWorkspace() call
into the Promise.all alongside the runtime.configPresenter.listAgents() and
runtime.configPresenter.getAcpEnabled() calls to parallelize these independent
operations. Apply the same parallelization pattern to the coordinator path
section mentioned in the review to maintain consistency across the codebase.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4a62ee4b-70f3-4059-a19b-7c0edbe56a2e

📥 Commits

Reviewing files that changed from the base of the PR and between 0088eda and 646e63f.

📒 Files selected for processing (46)
  • docs/features/default-workspace/plan.md
  • docs/features/default-workspace/spec.md
  • docs/features/default-workspace/tasks.md
  • docs/issues/session-start-lag/plan.md
  • docs/issues/session-start-lag/spec.md
  • docs/issues/session-start-lag/tasks.md
  • src/main/lib/agentRuntime/systemEnvPromptBuilder.ts
  • src/main/presenter/agentRuntimePresenter/index.ts
  • src/main/presenter/agentSessionPresenter/index.ts
  • src/main/presenter/projectPresenter/index.ts
  • src/main/routes/index.ts
  • src/renderer/src/components/WindowSideBar.vue
  • src/renderer/src/i18n/da-DK/chat.json
  • src/renderer/src/i18n/de-DE/chat.json
  • src/renderer/src/i18n/en-US/chat.json
  • src/renderer/src/i18n/es-ES/chat.json
  • src/renderer/src/i18n/fa-IR/chat.json
  • src/renderer/src/i18n/fr-FR/chat.json
  • src/renderer/src/i18n/he-IL/chat.json
  • src/renderer/src/i18n/id-ID/chat.json
  • src/renderer/src/i18n/it-IT/chat.json
  • src/renderer/src/i18n/ja-JP/chat.json
  • src/renderer/src/i18n/ko-KR/chat.json
  • src/renderer/src/i18n/ms-MY/chat.json
  • src/renderer/src/i18n/pl-PL/chat.json
  • src/renderer/src/i18n/pt-BR/chat.json
  • src/renderer/src/i18n/ru-RU/chat.json
  • src/renderer/src/i18n/tr-TR/chat.json
  • src/renderer/src/i18n/vi-VN/chat.json
  • src/renderer/src/i18n/zh-CN/chat.json
  • src/renderer/src/i18n/zh-HK/chat.json
  • src/renderer/src/i18n/zh-TW/chat.json
  • src/renderer/src/pages/NewThreadPage.vue
  • src/renderer/src/stores/ui/project.ts
  • src/renderer/src/views/ChatTabView.vue
  • src/shared/contracts/common.ts
  • src/shared/contracts/routes/sessions.routes.ts
  • src/shared/types/agent-interface.d.ts
  • src/shared/types/presenters/project.presenter.d.ts
  • test/main/lib/agentRuntime/systemEnvPromptBuilder.test.ts
  • test/main/presenter/agentSessionPresenter/agentSessionPresenter.test.ts
  • test/main/presenter/projectPresenter/projectPresenter.test.ts
  • test/main/routes/dispatcher.test.ts
  • test/renderer/components/NewThreadPage.test.ts
  • test/renderer/components/WindowSideBar.test.ts
  • test/renderer/stores/projectStore.test.ts

Comment thread src/renderer/src/stores/ui/project.ts Outdated
Comment thread test/main/presenter/projectPresenter/projectPresenter.test.ts
Comment thread test/renderer/components/WindowSideBar.test.ts

@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: 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 `@src/main/presenter/agentSessionPresenter/index.ts`:
- Around line 2519-2545: The waitForSessionTitleMessages method unconditionally
polls for up to 30 seconds waiting for messages, which causes unnecessary
background work for sessions without an initial turn and can lead to duplicate
title-generation calls. Add a guard condition at the call-site where
waitForSessionTitleMessages is invoked to check if polling is actually needed
before calling the method, such as verifying the session has messages or some
initial state, so that empty sessions don't trigger expensive long-lived polling
loops.

In `@test/main/presenter/agentSessionPresenter/agentSessionPresenter.test.ts`:
- Around line 770-775: The test uses wall-clock dependent setTimeout waits (20ms
and 300ms) which can cause intermittent failures on slow CI systems. Replace
these timing waits with Vitest's fake timers by calling vi.useFakeTimers() at
the start of the test, then replace each await new Promise((r) => setTimeout(r,
delay)) call with vi.advanceTimersByTime(delay) to provide deterministic timing
control. Make sure to restore real timers at the end of the test using
vi.useRealTimers() to avoid affecting other tests.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 58a10935-7d77-451a-8692-b05a5def7113

📥 Commits

Reviewing files that changed from the base of the PR and between 646e63f and e46bff6.

📒 Files selected for processing (6)
  • docs/features/default-workspace/spec.md
  • docs/issues/session-title-generation/spec.md
  • src/main/presenter/agentSessionPresenter/index.ts
  • src/renderer/src/components/WindowSideBar.vue
  • test/main/presenter/agentSessionPresenter/agentSessionPresenter.test.ts
  • test/renderer/components/WindowSideBar.test.ts
✅ Files skipped from review due to trivial changes (2)
  • docs/issues/session-title-generation/spec.md
  • docs/features/default-workspace/spec.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/renderer/components/WindowSideBar.test.ts

Comment thread src/main/presenter/agentSessionPresenter/index.ts
Comment thread test/main/presenter/agentSessionPresenter/agentSessionPresenter.test.ts Outdated

@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

🤖 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 `@src/main/presenter/agentRuntimePresenter/index.ts`:
- Line 529: Add guard conditions to the `onFirstProviderRoundReady` callback to
prevent stale stream callbacks from re-marking a session as ready after it has
been cleared or destroyed. Before marking the session as ready in this callback,
check that the session's active run ID matches the current run and that the
abort signal has not been triggered. This ensures that callbacks from streams
initiated before clearMessages or destroySession was called will be ignored and
cannot resurrect the readiness state of a cleared or destroyed session.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: bab2ef12-3b05-4c22-8598-523f9754950d

📥 Commits

Reviewing files that changed from the base of the PR and between e46bff6 and 3e4148e.

📒 Files selected for processing (8)
  • src/main/presenter/agentRuntimePresenter/index.ts
  • src/main/presenter/agentRuntimePresenter/process.ts
  • src/main/presenter/agentRuntimePresenter/types.ts
  • src/main/presenter/agentSessionPresenter/index.ts
  • src/shared/types/agent-interface.d.ts
  • test/main/presenter/agentRuntimePresenter/agentRuntimePresenter.test.ts
  • test/main/presenter/agentRuntimePresenter/process.test.ts
  • test/main/presenter/agentSessionPresenter/agentSessionPresenter.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/presenter/agentSessionPresenter/index.ts

Comment thread src/main/presenter/agentRuntimePresenter/index.ts
@zerob13 zerob13 merged commit 4545791 into dev Jun 22, 2026
3 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.

[Feature] Default workspace so users can start without selecting a folder

1 participant