Skip to content

ADE-103: Add long-lived Claude SDK wake/cron support for ADE chats - #721

Merged
arul28 merged 10 commits into
mainfrom
ade-103-add-long-lived-claude-sdk-wake-cron-support-for-ade-chats
Jul 7, 2026
Merged

ADE-103: Add long-lived Claude SDK wake/cron support for ADE chats#721
arul28 merged 10 commits into
mainfrom
ade-103-add-long-lived-claude-sdk-wake-cron-support-for-ade-chats

Conversation

@arul28

@arul28 arul28 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Fixes ADE-103

Summary

Describe the change.

What Changed

Key files and behaviors.

Validation

How you tested.

Risks

Anything to watch.

Linked Linear issues

ADE   Open in ADE  ·  ade-103-add-long-lived-claude-sdk-wake-cron-support-for-ade-chats branch  ·  PR #721

Summary by CodeRabbit

  • New Features

    • Added a new Chat Info view for scheduled work, including counts, status indicators, and a dedicated schedule section.
    • Added a chat info entry in the header/menu for quicker access.
  • Bug Fixes

    • Improved handling of message retractions so replaced assistant replies no longer remain visible.
    • Updated chat views to better reflect scheduled work and related activity as events arrive.
  • Chores

    • Updated the Claude Agent SDK dependency version.

Greptile Summary

This PR adds long-lived Claude SDK wake and cron support for ADE chats. The main changes are:

  • Claude scheduled work events and idle background turn handling.
  • Scheduled work snapshots and chat info rendering across desktop, CLI, and iOS.
  • Transcript retraction handling for replaced assistant messages.
  • Claude Agent SDK dependency updates.

Confidence Score: 4/5

This is close, but the idle reader race should be fixed before merging.

  • The scheduled-work id handling is much more consistent now.
  • The idle reader can still consume a foreground SDK message and return before handing it back.
  • That can make an active Claude turn miss an assistant or result event.

apps/desktop/src/main/services/chat/agentChatService.ts

Important Files Changed

Filename Overview
apps/desktop/src/main/services/chat/agentChatService.ts Adds Claude idle reading and scheduled-work alias tracking, with a remaining foreground handoff race in the idle reader.
apps/desktop/src/shared/chatScheduledWork.ts Adds id-based scheduled-work snapshot reduction for shared desktop and CLI use.
apps/ade-cli/src/tuiClient/app.tsx Adds chat-info auto-open behavior for scheduled work and task snapshot events.

Fix All in Claude Code

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

---

### Issue 1 of 1
apps/desktop/src/main/services/chat/agentChatService.ts:13133-13138
**Idle Handoff Still Drops**

When a foreground turn starts while the idle reader is already awaiting `sessionQuery.next()`, that await can resolve with the first SDK message for the foreground turn. This branch returns on the stale generation check before the resolved `next` is handed back through `pendingPostResultNext`, so the foreground reader never sees that already-consumed message. The active turn can then miss its first assistant or result event and wait on the wrong SDK output.

Reviews (9): Last reviewed commit: "Refs ADE-103: Avoid cron task fallback a..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@linear-code

linear-code Bot commented Jul 7, 2026

Copy link
Copy Markdown

ADE-103

@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 7, 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 7, 2026 10:08pm

@arul28

arul28 commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f5172e9b-2642-464d-89e8-ba915e5cfd9e

📥 Commits

Reviewing files that changed from the base of the PR and between c63aa3e4bd4733896b5ab6955c9e475bd04a2ce1 and ef69918.

⛔ Files ignored due to path filters (8)
  • apps/ade-cli/package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
  • apps/desktop/package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
  • docs/ARCHITECTURE.md is excluded by !docs/**
  • docs/features/ade-code/README.md is excluded by !docs/**
  • docs/features/chat/README.md is excluded by !docs/**
  • docs/features/chat/composer-and-ui.md is excluded by !docs/**
  • docs/features/chat/transcript-and-turns.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/ios-companion.md is excluded by !docs/**
📒 Files selected for processing (39)
  • apps/ade-cli/package.json
  • apps/ade-cli/src/tuiClient/__tests__/RightPane.test.tsx
  • apps/ade-cli/src/tuiClient/__tests__/appInput.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/chatInfo.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/format.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/subagentPane.test.ts
  • apps/ade-cli/src/tuiClient/app.tsx
  • apps/ade-cli/src/tuiClient/chatInfo.ts
  • apps/ade-cli/src/tuiClient/components/RightPane.tsx
  • apps/ade-cli/src/tuiClient/format.ts
  • apps/ade-cli/src/tuiClient/types.ts
  • apps/desktop/package.json
  • apps/desktop/src/main/services/adeActions/registry.test.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/renderer/components/chat/AgentChatPane.tsx
  • apps/desktop/src/renderer/components/chat/ChatSubagentsPanel.tsx
  • apps/desktop/src/renderer/components/chat/chatExecutionSummary.test.ts
  • apps/desktop/src/renderer/components/chat/chatExecutionSummary.ts
  • apps/desktop/src/renderer/components/chat/chatTranscriptRows.test.ts
  • apps/desktop/src/renderer/components/chat/chatTranscriptRows.ts
  • apps/desktop/src/shared/chatScheduledWork.ts
  • apps/desktop/src/shared/chatSubagents.ts
  • apps/desktop/src/shared/types/chat.ts
  • apps/ios/ADE/Models/RemoteModels.swift
  • apps/ios/ADE/Views/Work/WorkActivityIndicator.swift
  • apps/ios/ADE/Views/Work/WorkChatHeaderAndMessageViews.swift
  • apps/ios/ADE/Views/Work/WorkChatPrViews.swift
  • apps/ios/ADE/Views/Work/WorkChatRichCardViews.swift
  • apps/ios/ADE/Views/Work/WorkChatSessionView.swift
  • apps/ios/ADE/Views/Work/WorkErrorAndMessageHelpers.swift
  • apps/ios/ADE/Views/Work/WorkEventMapping.swift
  • apps/ios/ADE/Views/Work/WorkModels.swift
  • apps/ios/ADE/Views/Work/WorkPreviews.swift
  • apps/ios/ADE/Views/Work/WorkSessionDestinationView.swift
  • apps/ios/ADE/Views/Work/WorkTimelineHelpers.swift
  • apps/ios/ADE/Views/Work/WorkTranscriptParser.swift
  • apps/ios/ADETests/ADETests.swift
📝 Walkthrough

Walkthrough

Adds scheduled/background work tracking ("scheduled_work_update") and transcript retraction events across shared types, desktop Claude runtime (idle reader, SDK bump to 0.3.202), renderer UI (Schedule sections, badges), ade-cli TUI (SCHEDULE block, auto-open predicate), and iOS models/views (Chat Info sheet), with accompanying tests.

Changes

Scheduled work and transcript retraction feature

Layer / File(s) Summary
Shared event type contracts
apps/desktop/src/shared/types/chat.ts
Adds scheduled-work enums, new scheduled_work_update/transcript_retraction event variants, parentAgentId field, and expanded envelope provenance.
Desktop Claude runtime: scheduled work emission and idle reader
apps/desktop/package.json, apps/desktop/src/main/services/chat/agentChatService.ts, agentChatService.test.ts, apps/desktop/src/main/services/adeActions/registry.ts, registry.test.ts
Bumps SDK version, adds idle-reader lifecycle, scheduled-work caches, task_updated/commands_changed/model_refusal_fallback handling, transcript retraction emission, hook wiring, new ADE action contracts, and tests.
Shared scheduled-work snapshot derivation
apps/desktop/src/shared/chatScheduledWork.ts, apps/desktop/src/renderer/components/chat/chatExecutionSummary.ts, chatExecutionSummary.test.ts
Adds ChatScheduledWorkSnapshot type and deriveScheduledWorkSnapshots helper, re-exported for renderer use, with tests.
Desktop chat UI: schedule section and transcript retraction rendering
apps/desktop/src/renderer/components/chat/ChatSubagentsPanel.tsx, AgentChatPane.tsx, chatTranscriptRows.ts, chatTranscriptRows.test.ts
Adds Schedule section/rows, scheduled-item badges/counts, and transcript_retraction-driven row removal, with tests.
ade-cli TUI: chat-info schedule block and auto-open logic
apps/ade-cli/package.json, apps/ade-cli/src/tuiClient/types.ts, chatInfo.ts, components/RightPane.tsx, format.ts, app.tsx, __tests__/*
Adds scheduledWork to ChatInfoSnapshot, renders SCHEDULE block, handles transcript_retraction in renderChatLines, and centralizes shouldAutoOpenChatInfoForEvent predicate, with tests.
iOS models: scheduled work and retraction decoding
apps/ios/ADE/Models/RemoteModels.swift, apps/ios/ADE/Views/Work/WorkModels.swift, WorkTranscriptParser.swift, WorkEventMapping.swift
Adds decoding and model support for scheduledWorkUpdate/transcriptRetraction events.
iOS timeline processing and message helpers
apps/ios/ADE/Views/Work/WorkTimelineHelpers.swift, WorkErrorAndMessageHelpers.swift, WorkActivityIndicator.swift, ADETests.swift
Builds scheduled-work snapshots, handles retraction message removal/merge keys, and skips new events in activity presentation, with tests.
iOS chat-info UI: badge, sheet, and session wiring
apps/ios/ADE/Views/Work/WorkChatHeaderAndMessageViews.swift, WorkChatRichCardViews.swift, WorkChatSessionView.swift, WorkSessionDestinationView.swift, WorkPreviews.swift
Adds Chat Info menu, popup, details sheet, and wires scheduled-work state through session views.

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

Possibly related issues

Possibly related PRs

  • arul28/ADE#394: Both PRs touch WorkErrorAndMessageHelpers.swift's .transcriptRetraction handling and merge-key generation.
  • arul28/ADE#637: Both PRs relate to Claude SDK upgrades and scheduled_work_update/transcript_retraction event emission in the chat runtime.

Suggested labels: desktop, ios

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title accurately summarizes the main change: adding long-lived Claude SDK wake/cron support for ADE chats.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade-103-add-long-lived-claude-sdk-wake-cron-support-for-ade-chats

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.

Comment thread apps/desktop/src/main/services/chat/agentChatService.ts
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: 3

Caution

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

⚠️ Outside diff range comments (2)
apps/desktop/src/shared/types/chat.ts (1)

598-636: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Thread parentAgentId through the downstream event model. parentAgentId is added in apps/desktop/src/shared/types/chat.ts:598-636, but the iOS mapping still drops it and no renderer reads it, so the nested subagent hierarchy never reaches the UI. If this field matters for grouping, add it to the mapped event shape and consume it where subagent trees are rendered.

🤖 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/shared/types/chat.ts` around lines 598 - 636, The new
parentAgentId field on subagent events is not being propagated through the UI
event flow, so nested subagent hierarchy is lost. Update the downstream event
mapping that builds the chat event model from chat.ts subagent_* types to
include parentAgentId, then thread it through the renderer path that displays
subagent trees so the UI can group child agents under their parent. Use the
subagent_started, subagent_progress, and subagent_result shapes in chat.ts and
the corresponding iOS mapping/renderer code to keep the field consistent
end-to-end.

Source: Path instructions

apps/ade-cli/src/tuiClient/app.tsx (1)

7395-7416: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Guard the auto-open flag behind rightOpen. rightPane.kind === "chat-info" can still exist while the pane is closed (for example after Esc, and the chat-info refresh effect keeps that kind without reopening). In this branch, adding envelope.sessionId to subagentAutoOpenedSessionsRef without setRightOpen(true) lets the first subagent event consume the one-shot auto-open and suppress it for the rest of the session.

🤖 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/ade-cli/src/tuiClient/app.tsx` around lines 7395 - 7416, The auto-open
tracking in the chat info update path is being set even when the right pane is
closed, which can consume the one-shot session flag without actually reopening
the pane. Update the logic in app.tsx around shouldAutoOpenChatInfoForEvent and
the setRightPane callback so
subagentAutoOpenedSessionsRef.current.add(envelope.sessionId) only happens when
rightOpen is being set true, including the prev.kind === "chat-info" case. Keep
the existing chat-info refresh behavior, but gate the auto-open flag behind
rightOpen so a closed chat-info pane does not suppress later auto-open attempts.
🧹 Nitpick comments (1)
apps/ios/ADE/Views/Work/WorkChatRichCardViews.swift (1)

2279-2313: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting the shared "active popup" capsule chrome.

WorkChatInfoActivePopup duplicates almost all of WorkSubagentActivePopup's layout/styling (icon + label + count + chevron in a capsule with the same padding/background/overlay/min-height), and the same pattern is repeated again for WorkChatPrActivePopup. A small shared WorkComposerBadgeCapsule view taking icon/label/trailing-content would remove this triplication and keep future styling tweaks (padding, tint, min-height) in one place.

🤖 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/ios/ADE/Views/Work/WorkChatRichCardViews.swift` around lines 2279 -
2313, Extract the repeated capsule badge chrome used by WorkChatInfoActivePopup,
WorkSubagentActivePopup, and WorkChatPrActivePopup into a shared reusable view
such as WorkComposerBadgeCapsule. Move the common
HStack/padding/background/overlay/frame/contentShape/button styling there, and
parameterize the icon, label, count/trailing content, and action so each popup
only supplies its specific text and accessibility label while keeping the shared
styling in one place.
🤖 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/main/services/chat/agentChatService.ts`:
- Around line 20259-20261: `resetClaudeQuerySession` clears the scheduled-work
lookup maps but leaves `runtime.scheduledWorkSignatures` behind, which causes
`emitClaudeScheduledWorkUpdate` to suppress valid re-emissions after a session
reset. Update the session-reset cleanup in `resetClaudeQuerySession` to clear
`scheduledWorkSignatures` together with `scheduledWorkKindById`,
`scheduledWorkIdByTaskId`, and `scheduledWorkIdByToolUseId` so deterministic ids
can emit again on a fresh query.

In `@apps/ios/ADE/Views/Work/WorkChatRichCardViews.swift`:
- Around line 2419-2424: Gate the `detail` text in `WorkChatRichCardViews` so
`item.error` is only used when the work status is failed or missed, since
`buildWorkScheduledWorkSnapshots` can retain an old error across later updates.
Update the `detail` computed property to check the current status first and only
pass `item.error` through `workScheduledWorkText` for `status == "failed" ||
status == "missed"`, then continue falling back to `item.summary`,
`item.reason`, and `item.prompt`.

In `@apps/ios/ADE/Views/Work/WorkTimelineHelpers.swift`:
- Around line 629-705: buildWorkScheduledWorkSnapshots currently folds the
transcript in raw order, so later stale envelopes can overwrite newer
scheduled-work fields. Update the loop in buildWorkScheduledWorkSnapshots to
iterate over sortedWorkChatEnvelopes(transcript) instead of transcript, matching
the other work timeline helpers and ensuring the latest event wins for each
WorkScheduledWorkSnapshot.

---

Outside diff comments:
In `@apps/ade-cli/src/tuiClient/app.tsx`:
- Around line 7395-7416: The auto-open tracking in the chat info update path is
being set even when the right pane is closed, which can consume the one-shot
session flag without actually reopening the pane. Update the logic in app.tsx
around shouldAutoOpenChatInfoForEvent and the setRightPane callback so
subagentAutoOpenedSessionsRef.current.add(envelope.sessionId) only happens when
rightOpen is being set true, including the prev.kind === "chat-info" case. Keep
the existing chat-info refresh behavior, but gate the auto-open flag behind
rightOpen so a closed chat-info pane does not suppress later auto-open attempts.

In `@apps/desktop/src/shared/types/chat.ts`:
- Around line 598-636: The new parentAgentId field on subagent events is not
being propagated through the UI event flow, so nested subagent hierarchy is
lost. Update the downstream event mapping that builds the chat event model from
chat.ts subagent_* types to include parentAgentId, then thread it through the
renderer path that displays subagent trees so the UI can group child agents
under their parent. Use the subagent_started, subagent_progress, and
subagent_result shapes in chat.ts and the corresponding iOS mapping/renderer
code to keep the field consistent end-to-end.

---

Nitpick comments:
In `@apps/ios/ADE/Views/Work/WorkChatRichCardViews.swift`:
- Around line 2279-2313: Extract the repeated capsule badge chrome used by
WorkChatInfoActivePopup, WorkSubagentActivePopup, and WorkChatPrActivePopup into
a shared reusable view such as WorkComposerBadgeCapsule. Move the common
HStack/padding/background/overlay/frame/contentShape/button styling there, and
parameterize the icon, label, count/trailing content, and action so each popup
only supplies its specific text and accessibility label while keeping the shared
styling in one place.
🪄 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: 62b3b9a5-d15f-4d89-8136-1fe04c21db40

📥 Commits

Reviewing files that changed from the base of the PR and between 3147479 and c63aa3e4bd4733896b5ab6955c9e475bd04a2ce1.

⛔ Files ignored due to path filters (8)
  • apps/ade-cli/package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
  • apps/desktop/package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
  • docs/ARCHITECTURE.md is excluded by !docs/**
  • docs/features/ade-code/README.md is excluded by !docs/**
  • docs/features/chat/README.md is excluded by !docs/**
  • docs/features/chat/composer-and-ui.md is excluded by !docs/**
  • docs/features/chat/transcript-and-turns.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/ios-companion.md is excluded by !docs/**
📒 Files selected for processing (37)
  • apps/ade-cli/package.json
  • apps/ade-cli/src/tuiClient/__tests__/RightPane.test.tsx
  • apps/ade-cli/src/tuiClient/__tests__/appInput.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/chatInfo.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/format.test.ts
  • apps/ade-cli/src/tuiClient/__tests__/subagentPane.test.ts
  • apps/ade-cli/src/tuiClient/app.tsx
  • apps/ade-cli/src/tuiClient/chatInfo.ts
  • apps/ade-cli/src/tuiClient/components/RightPane.tsx
  • apps/ade-cli/src/tuiClient/format.ts
  • apps/ade-cli/src/tuiClient/types.ts
  • apps/desktop/package.json
  • apps/desktop/src/main/services/adeActions/registry.test.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/renderer/components/chat/AgentChatPane.tsx
  • apps/desktop/src/renderer/components/chat/ChatSubagentsPanel.tsx
  • apps/desktop/src/renderer/components/chat/chatExecutionSummary.test.ts
  • apps/desktop/src/renderer/components/chat/chatExecutionSummary.ts
  • apps/desktop/src/renderer/components/chat/chatTranscriptRows.test.ts
  • apps/desktop/src/renderer/components/chat/chatTranscriptRows.ts
  • apps/desktop/src/shared/chatScheduledWork.ts
  • apps/desktop/src/shared/types/chat.ts
  • apps/ios/ADE/Models/RemoteModels.swift
  • apps/ios/ADE/Views/Work/WorkActivityIndicator.swift
  • apps/ios/ADE/Views/Work/WorkChatHeaderAndMessageViews.swift
  • apps/ios/ADE/Views/Work/WorkChatRichCardViews.swift
  • apps/ios/ADE/Views/Work/WorkChatSessionView.swift
  • apps/ios/ADE/Views/Work/WorkErrorAndMessageHelpers.swift
  • apps/ios/ADE/Views/Work/WorkEventMapping.swift
  • apps/ios/ADE/Views/Work/WorkModels.swift
  • apps/ios/ADE/Views/Work/WorkPreviews.swift
  • apps/ios/ADE/Views/Work/WorkSessionDestinationView.swift
  • apps/ios/ADE/Views/Work/WorkTimelineHelpers.swift
  • apps/ios/ADE/Views/Work/WorkTranscriptParser.swift
  • apps/ios/ADETests/ADETests.swift

Comment thread apps/desktop/src/main/services/chat/agentChatService.ts
Comment thread apps/ios/ADE/Views/Work/WorkChatRichCardViews.swift
Comment thread apps/ios/ADE/Views/Work/WorkTimelineHelpers.swift
@arul28

arul28 commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

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

ℹ️ 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/ios/ADE/Views/Work/WorkChatSessionView.swift Outdated
@arul28

arul28 commented Jul 7, 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: 13367e5733

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

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@arul28

arul28 commented Jul 7, 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: 22e3119f5d

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

arul28 commented Jul 7, 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: 1c06be96f3

ℹ️ 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 Outdated
@arul28

arul28 commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Comment thread apps/desktop/src/main/services/chat/agentChatService.ts
Comment thread apps/desktop/src/main/services/chat/agentChatService.ts Outdated
@arul28
arul28 force-pushed the ade-103-add-long-lived-claude-sdk-wake-cron-support-for-ade-chats branch from 2a49c2b to 9490680 Compare July 7, 2026 21:48
Comment thread apps/desktop/src/main/services/chat/agentChatService.ts
@arul28
arul28 merged commit c648bd3 into main Jul 7, 2026
3 of 4 checks passed
Comment on lines +13133 to +13138
if (
managed.runtime !== runtime
|| runtime.query !== sessionQuery
|| runtime.idleReaderGeneration !== generation
) {
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Idle Handoff Still Drops

When a foreground turn starts while the idle reader is already awaiting sessionQuery.next(), that await can resolve with the first SDK message for the foreground turn. This branch returns on the stale generation check before the resolved next is handed back through pendingPostResultNext, so the foreground reader never sees that already-consumed message. The active turn can then miss its first assistant or result event and wait on the wrong SDK output.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/main/services/chat/agentChatService.ts
Line: 13133-13138

Comment:
**Idle Handoff Still Drops**

When a foreground turn starts while the idle reader is already awaiting `sessionQuery.next()`, that await can resolve with the first SDK message for the foreground turn. This branch returns on the stale generation check before the resolved `next` is handed back through `pendingPostResultNext`, so the foreground reader never sees that already-consumed message. The active turn can then miss its first assistant or result event and wait on the wrong SDK output.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

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