Skip to content

Upgrade Claude Agent SDK chat integration#637

Merged
arul28 merged 12 commits into
mainfrom
ade/https-github-com-anthropics-claude-da31a5e5
Jun 23, 2026
Merged

Upgrade Claude Agent SDK chat integration#637
arul28 merged 12 commits into
mainfrom
ade/https-github-com-anthropics-claude-da31a5e5

Conversation

@arul28

@arul28 arul28 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Upgrades ADE's Claude Agent SDK dependency to @anthropic-ai/claude-agent-sdk@0.3.186 for desktop and ADE CLI.
  • Wires new Claude chat stream surfaces into ADE: hook/progress/prompt-suggestion flags, prompt suggestions in the composer, richer SDK notifications/status events, task updates in the chat actions pane, file checkpointing, skill enablement, and expanded built-in tool presentation.
  • Fixes background/headless Claude chat kickoff so long-running waits are not killed by ADE's 5-minute runSessionTurn default timeout.
  • Documents the current boundary: true scheduled wake/cron support still needs a long-lived ADE stream owner and is tracked in Linear.

Follow-up ticket

Validation

  • npm --prefix apps/desktop run typecheck
  • npm --prefix apps/ade-cli run typecheck
  • cd apps/desktop && npx vitest run src/main/services/chat/agentChatService.test.ts
  • cd apps/desktop && npx vitest run src/renderer/components/chat/AgentChatPane.test.tsx src/renderer/components/chat/AgentChatComposer.test.tsx
  • cd apps/desktop && npx vitest run src/main/services/ai/tools/systemPrompt.test.ts src/renderer/components/chat/chatExecutionSummary.test.ts src/renderer/components/chat/chatTranscriptRows.test.ts
  • npm run test:desktop:sharded
  • npm --prefix apps/desktop run build
  • npm --prefix apps/desktop run lint (warnings only; existing baseline)
  • npm --prefix apps/ade-cli run build
  • npm --prefix apps/ade-cli run test
  • node scripts/validate-docs.mjs
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Prompt suggestions now appear directly in the chat input, per session, with clearer Tab-to-accept behavior.
    • Chat tasks are now grouped and labeled by status, including item counts.
    • Added support for additional agent tools/workflows (including scheduling and worktree actions).
  • Enhancements

    • Improved system notice handling (retries, refusals, memory recall, notifications, mirror errors) and more detailed error reporting.
    • Updated wake-up/scheduling guidance to reflect unavailable background self-resume behavior.
  • Bug Fixes

    • Fixed chat input placeholder behavior when suggestions are available.
  • Chores

    • Updated the Claude Agent SDK dependency.

Greptile Summary

This PR upgrades the Claude Agent SDK to 0.3.186 and wires its new event surfaces into ADE's chat pipeline, alongside a fix that prevents long-running background chat turns from being killed by the 5-minute runSessionTurn default RPC timeout.

  • Post-result drain (agentChatService.ts): introduces readNextClaudeTurnMessage() with pendingPostResultNext carry-over so the service can drain SDK-documented tail messages (prompt_suggestion, tool_use_summary, stale system events) that arrive after the result message before moving on to the next user turn, without stalling indefinitely.
  • New system-event handlers: api_retry, model_refusal_fallback, informational, notification, memory_recall, mirror_error, permission_denied, and worker_shutting_down are each translated into system_notice chat events; duplicate permission-denied UI is suppressed with emittedPermissionDeniedToolUseIds.
  • Prompt suggestions scoped per session (AgentChatPane.tsx): replaces a single promptSuggestion scalar with a promptSuggestionsBySession record so suggestions from background sessions never bleed into the visible composer; the composer shows them as placeholder text rather than a ghost overlay.

Confidence Score: 5/5

Safe to merge; the new post-result drain and event-handler paths are well-scoped and the timeout fix for background launches is straightforward.

The core logic change — readNextClaudeTurnMessage with carry-over pendingPostResultNext — is complex but correctly isolated to the post-result tail phase and backed by focused tests. New system-event handlers all take a defensive typeof approach and fall back gracefully to empty strings. The per-session prompt-suggestion keying closes a real cross-tab leak. The only finding is dead code in the prompt_suggestion handler that has no runtime impact.

The readNextClaudeTurnMessage function in agentChatService.ts is the most complex addition and worth a careful read, but no blocking issues were found there.

Important Files Changed

Filename Overview
apps/desktop/src/main/services/chat/agentChatService.ts Major update: adds post-result drain logic (readNextClaudeTurnMessage, pendingPostResultNext), new system-event handlers (api_retry, refusal fallback, notification, memory recall, mirror error, permission denied, worker shutdown), timeoutMs: null for headless launches, and SDK 0.3.186 feature flags. Contains one dead-code path in the prompt_suggestion handler.
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx Switches prompt suggestion state from a single scalar to a per-session record, preventing suggestion leakage across chat tabs. Renames subagent to chatActions throughout the auto-open machinery and broadens the auto-open trigger to include todo items alongside subagents.
apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx Removes the ghost overlay for prompt suggestions and replaces it with placeholder text in both the custom overlay div and the native textarea placeholder, simplifying the render path.
apps/desktop/src/renderer/components/chat/ChatTasksPanel.tsx Refactors task list from a flat sorted list to a grouped display with status-section headers and item counts; switches STATUS_SORT_ORDER from a plain object to a Map for safer unknown-status fallback.
apps/desktop/src/renderer/components/chat/chatToolAppearance.tsx Adds tool-badge entries for TaskCreate/Get/Update/List, REPL, Workflow, Cron*, ScheduleWakeup, Monitor, Artifact, PushNotification, RemoteTrigger, EnterWorktree, and ExitWorktree; swaps Wrench for Strategy icon.
apps/desktop/src/main/services/ai/tools/systemPrompt.ts Softens the ScheduleWakeup warning in the ADE chat system prompt from 'NOT honored / never re-invokes' to 'unavailable / will not start a later turn by itself', and expands the wait guidance.
.agents/skills/ship/SKILL.md Matches the system-prompt tone change: replaces hard 'NOT honored / Do not start a background poller' language with softer 'unavailable / tell the user exactly when to re-ping' guidance.
docs/features/chat/README.md Updates SDK version reference from 0.2.139 to 0.3.186, documents the new event surfaces enabled in this PR, and clarifies the per-turn vs. long-lived stream boundary for scheduled wake support.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant U as UserTurn
    participant R as readNextClaudeTurnMessage
    participant Q as sessionQuery
    participant L as MainLoop

    U->>R: "call with resultSeen=false"
    R->>R: drain pendingPostResultNext from prior turn
    R->>Q: sessionQuery.next()
    Q-->>R: tool/text message
    R-->>L: message
    L->>L: process tool/text handlers
    Q-->>R: result message
    R-->>L: result
    L->>L: "resultSeen=true continue"
    U->>R: "call with resultSeen=true 1s timeout"
    R->>Q: sessionQuery.next() stored as pendingPostResultNext
    alt message within 1s
        Q-->>R: prompt_suggestion or tool_use_summary
        R-->>L: message
        L->>L: stale tail discard or prompt_suggestion handler
    else timeout fires
        R-->>L: null
        L->>L: break post-result drain
    end
    Note over L: emit pendingWorkerShutdownReason if set
    Note over R: pendingPostResultNext carried into next turn
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant U as UserTurn
    participant R as readNextClaudeTurnMessage
    participant Q as sessionQuery
    participant L as MainLoop

    U->>R: "call with resultSeen=false"
    R->>R: drain pendingPostResultNext from prior turn
    R->>Q: sessionQuery.next()
    Q-->>R: tool/text message
    R-->>L: message
    L->>L: process tool/text handlers
    Q-->>R: result message
    R-->>L: result
    L->>L: "resultSeen=true continue"
    U->>R: "call with resultSeen=true 1s timeout"
    R->>Q: sessionQuery.next() stored as pendingPostResultNext
    alt message within 1s
        Q-->>R: prompt_suggestion or tool_use_summary
        R-->>L: message
        L->>L: stale tail discard or prompt_suggestion handler
    else timeout fires
        R-->>L: null
        L->>L: break post-result drain
    end
    Note over L: emit pendingWorkerShutdownReason if set
    Note over R: pendingPostResultNext carried into next turn
Loading

Reviews (10): Last reviewed commit: "Track settled Claude post-result drains" | Re-trigger Greptile

@vercel

vercel Bot commented Jun 22, 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 23, 2026 1:59am

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Bumps the Claude Agent SDK to ^0.3.186, expands stream event handling in agentChatService for eight new system subtypes with a post-result drain timeout, refactors prompt suggestions to per-session state, generalizes chat-actions auto-open to include todo items, removes the composer ghost overlay in favor of placeholder text, adds grouped rendering to ChatTasksPanel, and registers new tool metadata entries.

Changes

Claude SDK Integration and UI Improvements

Layer / File(s) Summary
SDK version bump and wake-up semantics clarification
apps/ade-cli/package.json, apps/desktop/package.json, .agents/skills/ship/SKILL.md, apps/desktop/src/main/services/ai/tools/systemPrompt.ts, apps/desktop/src/main/services/ai/tools/systemPrompt.test.ts
Bumps @anthropic-ai/claude-agent-sdk to ^0.3.186 in both packages; updates ADE Work chat harness guidance and embedded runtime prompt to clarify ScheduleWakeup as unavailable and revises wait-strategy wording; updates matching test assertions.
agentChatService: system subtype handling and post-result drain
apps/desktop/src/main/services/chat/agentChatService.ts
Adds SDKMessage import and CLAUDE_POST_RESULT_DRAIN_TIMEOUT_MS; introduces permission-denied tool ID tracking and pendingWorkerShutdownReason; adds handlers for eight system subtypes (api_retry, model_refusal_fallback, informational, notification, memory_recall, mirror_error, permission_denied, worker_shutting_down); reworks post-result drain with resultSeen flag and timeout race; enables includeHookEvents/promptSuggestions; removes bounded RPC timeout for headless launches; clears post-result iterator fields during reset.
agentChatService tests
apps/desktop/src/main/services/chat/agentChatService.test.ts
Updates SDK init assertions for new options; replaces hanging-kickoff headless test with fake-timers test; strengthens context-compaction leak regression test; adds test for context_compact event emission; replaces rate-limit test with multi-subtype system_notice coverage suite; adds tests for prompt_suggestion event ordering and history exclusion; adds worker_shutting_down live-stream tail test; adjusts tool-denial test scenario.
Per-session prompt suggestions in AgentChatPane
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
Replaces single global promptSuggestion with a promptSuggestionsBySession map; derives active suggestion from selectedSessionId; adds clearPromptSuggestionForSession callback; wires prompt_suggestion IPC events and turn-start clearing per session; updates all draft, submit, and launch paths accordingly.
Composer prompt suggestion as placeholder (removes ghost overlay)
apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx, apps/desktop/src/renderer/components/chat/AgentChatComposer.test.tsx
Removes the ghost suggestion overlay; updates rich-editor and plain-textarea placeholder fallback to prefer promptSuggestionmessagePlaceholder → default; test now asserts placeholder text before triggering Tab.
AgentChatPane tests: prompt suggestion per-session and auto-open rename
apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx
Updates auto-open helper imports from subagent to chat-actions variants; updates auto-open marker unit test; adds integration test for per-session prompt_suggestion events and tab switching.
Chat-actions auto-open generalization (subagent + todos)
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
Renames localStorage constants to CHAT_ACTIONS_*; exports getChatActionsAutoOpenStorageKey, cleanupChatActionsAutoOpenStorage, hasChatActionsAutoOpenFired; updates auto-open effect to count subagent snapshots plus todo items; defers flag consumption when panel is open; adds todo count badge and tooltip.
ChatTasksPanel: grouped rendering by status
apps/desktop/src/renderer/components/chat/ChatTasksPanel.tsx, apps/desktop/src/renderer/components/chat/ChatSubagentsPanel.test.tsx
Introduces STATUS_ORDER, STATUS_SORT_ORDER Map, and STATUS_GROUP_LABEL; changes ChatTaskList from flat sorted list to grouped sections with status-label headers and counts; updates row layout and description span styling; adds task-order preservation test.
Tool metadata entries for new Claude tools
apps/desktop/src/renderer/components/chat/chatToolAppearance.tsx, apps/desktop/src/renderer/components/chat/chatToolAppearance.test.ts
Swaps Wrench for Strategy icon; adds TOOL_META entries for Task*, REPL, Workflow, Cron*, ScheduleWakeup, Monitor, Artifact, PushNotification, RemoteTrigger, EnterWorktree, ExitWorktree with getTarget callbacks; adds EnterWorktree getTarget unit and parameterized tests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

  • arul28/ADE#287: Both PRs update the Claude ADE runtime system-prompt and wake-up guidance by reworking the claude-agent-sdk-query runtime expectations around ScheduleWakeup being unavailable.

Suggested labels

desktop, docs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed The title 'Upgrade Claude Agent SDK chat integration' directly and clearly describes the main change: upgrading the Claude Agent SDK dependency and integrating its new features into the chat system.
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.

✏️ 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 ade/https-github-com-anthropics-claude-da31a5e5

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.

@arul28 arul28 changed the title Https Github Com Anthropics Claude Upgrade Claude Agent SDK chat integration Jun 22, 2026
@arul28

arul28 commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

@mintlify

mintlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ade-ac1c6011 🟢 Ready View Preview Jun 22, 2026, 11:03 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Comment thread apps/desktop/src/renderer/components/chat/chatToolAppearance.tsx Outdated
@arul28

arul28 commented Jun 22, 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: 3c3a7ef6bb

ℹ️ 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/components/chat/chatToolAppearance.tsx Outdated
@arul28

arul28 commented Jun 22, 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: f0115d940a

ℹ️ 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/main/services/chat/agentChatService.ts
@arul28

arul28 commented Jun 22, 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: 8b3d55d842

ℹ️ 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/main/services/chat/agentChatService.ts Outdated

@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

🧹 Nitpick comments (1)
apps/desktop/src/renderer/components/chat/chatToolAppearance.test.ts (1)

90-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Expand coverage for other newly added getTarget mappings.

Line 90 validates EnterWorktree, but Lines 57-70 in chatToolAppearance.tsx add many new getTarget paths. A small table-driven test here would catch argument-key regressions early.

♻️ Suggested test pattern
+  it("extracts targets for newly added Claude tools", () => {
+    const cases: Array<[string, Record<string, unknown>, string | null]> = [
+      ["TaskCreate", { subject: "ship SDK" }, "ship SDK"],
+      ["TaskGet", { taskId: "123" }, "123"],
+      ["TaskUpdate", { description: "update docs" }, "update docs"],
+      ["REPL", { description: "run snippet" }, "run snippet"],
+      ["Workflow", { name: "nightly-sync" }, "nightly-sync"],
+      ["CronCreate", { cron: "0 * * * *" }, "0 * * * *"],
+      ["CronDelete", { id: "cron-1" }, "cron-1"],
+      ["ScheduleWakeup", { reason: "retry later" }, "retry later"],
+      ["Monitor", { command: "tail -f logs" }, "tail -f logs"],
+      ["Artifact", { file_path: "/tmp/out.txt" }, "/tmp/out.txt"],
+      ["PushNotification", { message: "done" }, "done"],
+      ["RemoteTrigger", { action: "deploy" }, "deploy"],
+      ["EnterWorktree", { path: "/tmp/wt" }, "/tmp/wt"],
+    ];
+    for (const [tool, args, expected] of cases) {
+      const meta = getToolMeta(tool);
+      expect(meta.getTarget).toBeDefined();
+      expect(meta.getTarget!(args)).toBe(expected);
+    }
+  });
🤖 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 `@apps/desktop/src/renderer/components/chat/chatToolAppearance.test.ts` around
lines 90 - 97, The test for getTarget mappings in the chatToolAppearance.test.ts
file only covers the EnterWorktree tool, but the chatToolAppearance.tsx file
(lines 57-70) contains many other tools with getTarget path mappings that should
also be validated. Expand the test coverage by implementing a table-driven test
pattern that iterates through all the newly added getTarget mappings, testing
each tool with its respective argument keys and expected return values to catch
potential argument-key regressions early. This will ensure all tools with
getTarget functions defined in the source file are properly covered.
🤖 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/chat/AgentChatPane.tsx`:
- Around line 3861-3868: When the chat-actions drawer is already open
(chatActionsOpen is true), check if the Agents tab is currently visible within
that drawer before returning early. If the Agents tab is visible, consume the
auto-open marker (burn the trackedActionCount flag) before returning, so that
closing and reopening the drawer doesn't immediately reopen it. Only skip the
marker consumption and return early if the Agents tab is not currently visible,
allowing the logic to retry when the drawer closes.
- Around line 5903-5923: The prompt_suggestion event handling block (which sets
setPromptSuggestionsBySession) is currently executing after the event has been
queued to pendingEventQueueRef.current.push(envelope), causing UI-only
suggestion data to pollute the transcript state cache. Move the entire
prompt_suggestion handling block (checking for envelope.event.type ===
"prompt_suggestion") to execute before the envelope is pushed to the queue, and
add a return statement after handling it so the suggestion event does not get
added to the transcript or eventsBySession cache.

---

Nitpick comments:
In `@apps/desktop/src/renderer/components/chat/chatToolAppearance.test.ts`:
- Around line 90-97: The test for getTarget mappings in the
chatToolAppearance.test.ts file only covers the EnterWorktree tool, but the
chatToolAppearance.tsx file (lines 57-70) contains many other tools with
getTarget path mappings that should also be validated. Expand the test coverage
by implementing a table-driven test pattern that iterates through all the newly
added getTarget mappings, testing each tool with its respective argument keys
and expected return values to catch potential argument-key regressions early.
This will ensure all tools with getTarget functions defined in the source file
are properly covered.
🪄 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

Run ID: 09bbb2ba-9e89-4492-8158-c10daad0236d

📥 Commits

Reviewing files that changed from the base of the PR and between a6ef592 and 8b3d55d.

⛔ Files ignored due to path filters (3)
  • 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/features/chat/README.md is excluded by !docs/**
📒 Files selected for processing (14)
  • .agents/skills/ship/SKILL.md
  • apps/ade-cli/package.json
  • apps/desktop/package.json
  • apps/desktop/src/main/services/ai/tools/systemPrompt.test.ts
  • apps/desktop/src/main/services/ai/tools/systemPrompt.ts
  • apps/desktop/src/main/services/chat/agentChatService.test.ts
  • apps/desktop/src/main/services/chat/agentChatService.ts
  • apps/desktop/src/renderer/components/chat/AgentChatComposer.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
  • apps/desktop/src/renderer/components/chat/ChatTasksPanel.tsx
  • apps/desktop/src/renderer/components/chat/chatToolAppearance.test.ts
  • apps/desktop/src/renderer/components/chat/chatToolAppearance.tsx

Comment thread apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
Comment thread apps/desktop/src/renderer/components/chat/AgentChatPane.tsx Outdated
@arul28

arul28 commented Jun 23, 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: 6ccd4fda16

ℹ️ 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/main/services/chat/agentChatService.ts Outdated
@arul28

arul28 commented Jun 23, 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: 255be31602

ℹ️ 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/main/services/chat/agentChatService.ts Outdated
Comment thread apps/desktop/src/main/services/chat/agentChatService.ts
@arul28

arul28 commented Jun 23, 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: 18a16645f4

ℹ️ 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/main/services/chat/agentChatService.ts Outdated
@arul28

arul28 commented Jun 23, 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: 543f59c216

ℹ️ 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/main/services/chat/agentChatService.ts Outdated
Comment thread apps/desktop/src/renderer/components/chat/ChatTasksPanel.tsx Outdated
@arul28

arul28 commented Jun 23, 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: b0acc5f0d7

ℹ️ 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/main/services/chat/agentChatService.ts
@arul28

arul28 commented Jun 23, 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: 43558326e5

ℹ️ 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/main/services/chat/agentChatService.ts Outdated
@arul28

arul28 commented Jun 23, 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: fb796a309b

ℹ️ 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/main/services/chat/agentChatService.ts Outdated

@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.

Caution

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

⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx (1)

5396-5419: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Ensure timer spy cleanup even on assertion failure.

At Line 5396 and Line 5419, setTimeoutSpy.mockRestore() should run in a finally; otherwise a failure at Line 5418 can leak the spy into later tests.

Suggested fix
-    const setTimeoutSpy = vi.spyOn(window, "setTimeout");
-
-    act(() => {
-      emitChatEvent({
-        sessionId: "session-1",
-        timestamp: "2026-03-24T06:00:00.000Z",
-        sequence: 1,
-        event: {
-          type: "prompt_suggestion",
-          suggestion: "Continue primary work",
-        },
-      } as AgentChatEventEnvelope);
-      emitChatEvent({
-        sessionId: "session-2",
-        timestamp: "2026-03-24T06:00:01.000Z",
-        sequence: 1,
-        event: {
-          type: "prompt_suggestion",
-          suggestion: "Continue background work",
-        },
-      } as AgentChatEventEnvelope);
-    });
-    expect(setTimeoutSpy.mock.calls.some(([, delay]) => delay === 16)).toBe(false);
-    setTimeoutSpy.mockRestore();
+    const setTimeoutSpy = vi.spyOn(window, "setTimeout");
+    try {
+      act(() => {
+        emitChatEvent({
+          sessionId: "session-1",
+          timestamp: "2026-03-24T06:00:00.000Z",
+          sequence: 1,
+          event: {
+            type: "prompt_suggestion",
+            suggestion: "Continue primary work",
+          },
+        } as AgentChatEventEnvelope);
+        emitChatEvent({
+          sessionId: "session-2",
+          timestamp: "2026-03-24T06:00:01.000Z",
+          sequence: 1,
+          event: {
+            type: "prompt_suggestion",
+            suggestion: "Continue background work",
+          },
+        } as AgentChatEventEnvelope);
+      });
+      expect(setTimeoutSpy.mock.calls.some(([, delay]) => delay === 16)).toBe(false);
+    } finally {
+      setTimeoutSpy.mockRestore();
+    }
🤖 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 `@apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx` around
lines 5396 - 5419, The setTimeoutSpy.mockRestore() cleanup at the end of the
test will not execute if the preceding expect() assertion fails, causing the spy
to leak into subsequent tests. Wrap the setTimeoutSpy variable declaration and
the emitChatEvent act block with a try-finally structure, moving the
setTimeoutSpy.mockRestore() call into the finally block to ensure the spy is
always cleaned up regardless of whether the assertion passes or fails.
🧹 Nitpick comments (1)
apps/desktop/src/main/services/chat/agentChatService.ts (1)

12769-12770: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Redundant continue — confirm intended branch behavior.

Both lines fall through to continue, so if (resultSeen) continue; (Line 12769) is dead and identical to the unconditional continue; on Line 12770. If the resultSeen check was meant to alter behavior here (e.g. skip emitting the suggestion, or break the drain), the edit looks incomplete; otherwise drop the redundant guard.

♻️ Drop the redundant guard (if no behavior change intended)
           }
-          if (resultSeen) continue;
           continue;
         }
🤖 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 `@apps/desktop/src/main/services/chat/agentChatService.ts` around lines 12769 -
12770, Remove the redundant conditional `if (resultSeen) continue;` statement on
line 12769 in the agentChatService.ts file, as it is dead code that
unconditionally falls through to the identical `continue;` on the next line. If
the resultSeen check was intended to trigger different behavior (such as
breaking the loop or skipping specific logic), implement that intended behavior
instead; otherwise, keep only the single unconditional continue statement.
🤖 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.

Outside diff comments:
In `@apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx`:
- Around line 5396-5419: The setTimeoutSpy.mockRestore() cleanup at the end of
the test will not execute if the preceding expect() assertion fails, causing the
spy to leak into subsequent tests. Wrap the setTimeoutSpy variable declaration
and the emitChatEvent act block with a try-finally structure, moving the
setTimeoutSpy.mockRestore() call into the finally block to ensure the spy is
always cleaned up regardless of whether the assertion passes or fails.

---

Nitpick comments:
In `@apps/desktop/src/main/services/chat/agentChatService.ts`:
- Around line 12769-12770: Remove the redundant conditional `if (resultSeen)
continue;` statement on line 12769 in the agentChatService.ts file, as it is
dead code that unconditionally falls through to the identical `continue;` on the
next line. If the resultSeen check was intended to trigger different behavior
(such as breaking the loop or skipping specific logic), implement that intended
behavior instead; otherwise, keep only the single unconditional continue
statement.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ca90abfa-fad4-4d56-ae2f-6dc942796da2

📥 Commits

Reviewing files that changed from the base of the PR and between 8b3d55d and 9255b83.

📒 Files selected for processing (7)
  • apps/desktop/src/main/services/chat/agentChatService.test.ts
  • apps/desktop/src/main/services/chat/agentChatService.ts
  • apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
  • apps/desktop/src/renderer/components/chat/ChatSubagentsPanel.test.tsx
  • apps/desktop/src/renderer/components/chat/ChatTasksPanel.tsx
  • apps/desktop/src/renderer/components/chat/chatToolAppearance.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/desktop/src/renderer/components/chat/chatToolAppearance.test.ts
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx

@arul28 arul28 merged commit 4b203aa into main Jun 23, 2026
27 checks passed
@arul28 arul28 deleted the ade/https-github-com-anthropics-claude-da31a5e5 branch June 23, 2026 02:18
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