Skip to content

Fix Work attention for SDK chat questions - #895

Merged
arul28 merged 2 commits into
mainfrom
ade/session-lane-repo-arul28-2fade-3d942a4a
Jul 24, 2026
Merged

Fix Work attention for SDK chat questions#895
arul28 merged 2 commits into
mainfrom
ade/session-lane-repo-arul28-2fade-3d942a4a

Conversation

@arul28

@arul28arul28 commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • project live SDK chat question state into runtime-backed session list and detail reads
  • share one provider-neutral projection path across IPC and ADE runtime actions
  • clear stale pending-input markers when a chat resumes and degrade hydration failures to quiet state

Verification

  • desktop registry contract: 75 tests passed
  • desktop CI shard 1/8: 1,160 tests passed
  • desktop typecheck passed
  • full ADE CLI/TUI suite: 2,246 tests passed
  • docs validation: 201 files passed
  • quality dual-track review: no blockers or high-severity findings

Summary by CodeRabbit

  • Bug Fixes
    • Chat sessions now accurately display running, idle, and waiting-for-input states.
    • Cleared stale pending-input indicators when sessions resume activity.
    • Improved session list and detail views with consistent chat status information.
    • Added graceful fallback behavior when chat status information cannot be loaded.
    • Identity-only chat sessions are excluded from terminal session listings.

Greptile Summary

This PR moves chat session state projection into a shared path for IPC and ADE runtime reads. The main changes are:

  • Shared list and detail helpers for projecting chat state onto terminal session rows.
  • Runtime session.list and session.get now use the same projection path as IPC.
  • Stale pending-input markers are cleared when chats become active or idle again.
  • Identity chat rows are filtered from Work session lists.
  • Resume-target hydration and quiet fallback behavior are covered by tests and docs.

Confidence Score: 5/5

Safe to merge with low risk.

The updated code moves existing IPC behavior into a shared helper and extends it to runtime actions, with tests for the main state transitions and failure paths. No blocking correctness or security issues were found in the changed paths.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • I ran the registry attention Vitest test suite in the project workspace, capturing the full foreground commands, working directory, and verbose output.
  • I verified the registry test run completed with 76 passing tests and detailed timing and exit codes in the log.
  • I ran the follow-up session attention Vitest test set in the project workspace, capturing the verbose output and environment details.
  • I verified the session test run completed with 92 passing tests and detailed timing and exit codes in the log.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

FilenameOverview
apps/desktop/src/main/services/adeActions/registry.test.tsAdds tests for runtime session list/detail chat projection, stale pending-input cleanup, quiet hydration fallback, and resume-target hydration.
apps/desktop/src/main/services/adeActions/registry.tsRoutes ADE runtime session list/get actions through the shared chat projection helpers.
apps/desktop/src/main/services/ipc/registerIpc.tsReplaces duplicated IPC list/get projection and hydration logic with the shared session projection helpers.
apps/desktop/src/main/services/sessions/chatSessionProjection.tsCentralizes resume-target hydration, chat-state projection, identity-chat filtering, and quiet fallback behavior for session list/detail reads.
docs/features/terminals-and-sessions/README.mdUpdates session documentation to include runtime action reads alongside IPC and lane snapshots in the canonical chat projection path.

Sequence Diagram

sequenceDiagram
participant Client as IPC / ADE runtime action
participant Projection as chatSessionProjection.ts
participant Sessions as sessionService
participant PTY as ptyService
participant Chat as agentChatService
Client->>Projection: listSessionsWithChatProjection(args) / getSessionWithChatProjection(id)
Projection->>Sessions: list(args) or get(id)
alt missing resume target
Projection->>PTY: ensureResumeTargets(sessionIds)
Projection->>Sessions: reload hydrated rows
end
Projection->>PTY: enrichSessions(rows)
Projection->>Chat: listSessions(laneId, includeIdentity/includeAutomation) or getSessionSummary(id)
Projection->>Projection: filter identity rows and project active/idle/waiting state
Projection-->>Client: terminal session rows with runtime-backed chat state
Loading

Reviews (2): Last reviewed commit: "fix: share session resume hydration pipe..." | Re-trigger Greptile

@vercel

vercelBot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
adeIgnoredIgnoredPreviewJul 24, 2026 9:21am

@arul28arul28 changed the title chat-needs-input-indicator -> PrimaryFix Work attention for SDK chat questionsJul 24, 2026
@coderabbitai

coderabbitaiBot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Chat Session Projection

Layer / File(s)Summary
Projection rules and summary mapping
apps/desktop/src/main/services/sessions/chatSessionProjection.ts, apps/desktop/src/main/services/adeActions/registry.test.ts
Chat summaries are projected onto terminal sessions, identity sessions are excluded, active states clear pending input, and waiting-input states are tested.
Session API and IPC integration
apps/desktop/src/main/services/sessions/chatSessionProjection.ts, apps/desktop/src/main/services/adeActions/registry.ts, apps/desktop/src/main/services/ipc/registerIpc.ts, apps/desktop/src/main/services/adeActions/registry.test.ts
Session list/get APIs and IPC listing use shared projection helpers, enrich sessions, fetch provider summaries, and handle projection failures with warnings and idle fallback states.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested labels:desktop, docs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 14.29% 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 nameStatusExplanation
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title captures the main theme of fixing chat attention handling for SDK chat questions, which matches the runtime session projection changes.
✨ 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/session-lane-repo-arul28-2fade-3d942a4a

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.

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

🧹 Nitpick comments (1)
apps/desktop/src/main/services/sessions/chatSessionProjection.ts (1)

128-152: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

listSessionsWithChatProjection duplicates (and slightly diverges from) the IPC.sessionsList fetch pipeline.

This helper re-implements the fetch/enrich/chat-fetch flow that IPC.sessionsList (registerIpc.ts lines 6363-6403) already has, but omits the resume-target hydration step (sessionNeedsResumeTargetHydration + ptyService.ensureResumeTargets) that the IPC handler performs before enrichment. Sessions read through the adeActions session.list domain (this helper) can therefore lack resume metadata that the desktop sessionsList IPC call would have hydrated. Consider factoring the shared fetch/enrich steps (including resume hydration) into this module so both call sites stay in sync going forward.

🤖 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/sessions/chatSessionProjection.ts` around
lines 128 - 152, Update listSessionsWithChatProjection to share the session
fetch/enrichment pipeline with IPC.sessionsList, including
sessionNeedsResumeTargetHydration and ptyService.ensureResumeTargets before
enrichment. Factor the common flow into a reusable helper in this module and
have both call sites use it, preserving the existing chat projection behavior
and keeping both paths synchronized.
🤖 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.
Nitpick comments:
In `@apps/desktop/src/main/services/sessions/chatSessionProjection.ts`:
- Around line 128-152: Update listSessionsWithChatProjection to share the
session fetch/enrichment pipeline with IPC.sessionsList, including
sessionNeedsResumeTargetHydration and ptyService.ensureResumeTargets before
enrichment. Factor the common flow into a reusable helper in this module and
have both call sites use it, preserving the existing chat projection behavior
and keeping both paths synchronized.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 05b9ac0a-c6d6-47a9-bb1a-f065890c810a

📥 Commits

Reviewing files that changed from the base of the PR and between be1d431 and 2d8ca9e.

⛔ Files ignored due to path filters (1)
  • docs/features/terminals-and-sessions/README.md is excluded by !docs/**
📒 Files selected for processing (4)
  • apps/desktop/src/main/services/adeActions/registry.test.ts
  • apps/desktop/src/main/services/adeActions/registry.ts
  • apps/desktop/src/main/services/ipc/registerIpc.ts
  • apps/desktop/src/main/services/sessions/chatSessionProjection.ts

@arul28
arul28 merged commit bfe1281 into mainJul 24, 2026
4 checks passed
@arul28
arul28 deleted the ade/session-lane-repo-arul28-2fade-3d942a4a branch July 24, 2026 13:49
Sign up for freeto 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

@arul28