Skip to content

trace-needs-input-marker -> main - #951

Merged
arul28 merged 16 commits into
mainfrom
ade/ade-session-session-lane-repo-b4afd56a
Jul 30, 2026
Merged

trace-needs-input-marker -> main#951
arul28 merged 16 commits into
mainfrom
ade/ade-session-session-lane-repo-b4afd56a

Conversation

@arul28

@arul28 arul28 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

ADE   Open in ADE  ·  ade/ade-session-session-lane-repo-b4afd56a branch  ·  PR #951

Summary by CodeRabbit

  • New Features

    • Session details and lifecycle actions now surface Attention source and Settlement source.
    • Lane status support: listLanes can include status, with new lane summary helpers.
  • Bug Fixes

    • “Needs you” and related highlights now use explicit/structured pending input signals (reducing false prompts).
    • Clean-exit sessions no longer auto-settle; they stay ended until explicitly settled.
    • Improved snooze/hand and settle/dismiss gating to better match explicit attention and lifecycle intent.
  • Documentation

    • Updated on-screen settlement guidance wording.

@vercel

vercel Bot commented Jul 29, 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 30, 2026 12:08am

@coderabbitai

coderabbitai Bot commented Jul 29, 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: 31 minutes

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 Plus

Run ID: bbfd58cd-b124-46c0-accf-6f4f641dbef9

📥 Commits

Reviewing files that changed from the base of the PR and between c8de87f and 67b47f6.

📒 Files selected for processing (6)
  • apps/ade-cli/src/bootstrap.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.test.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.ts
  • apps/desktop/src/renderer/lib/terminalAttention.test.ts
  • apps/desktop/src/renderer/lib/terminalAttention.ts
📝 Walkthrough

Walkthrough

The PR adds attention and settlement source metadata across desktop, iOS, CLI, and persistence layers. It narrows “needs you” detection to explicit or structured signals, removes clean-exit auto-settlement, updates lifecycle actions and bucketing, and revises related tests and sync contracts.

Changes

Session lifecycle semantics

Layer / File(s) Summary
Lifecycle metadata and persistence
apps/desktop/src/shared/types/*, apps/desktop/src/main/services/sessions/*, apps/desktop/src/main/services/state/*, apps/ios/ADE/Models/*, apps/ios/ADE/Services/*
Adds attention and settlement source types, database columns, normalization, hydration, serialization, and migration support.
Settlement source propagation
apps/desktop/src/main/services/adeActions/*, apps/desktop/src/main/services/ai/tools/*, apps/desktop/src/main/services/prs/*, apps/ade-cli/src/adeRpcServer.test.ts
Tags settlements from agents, users, operators, and PR merges while preserving or clearing source fields across lifecycle mutations.
Canonical phase and bucket rules
apps/desktop/src/shared/sessionCanonicalState.*, apps/desktop/src/main/services/lanes/*, apps/desktop/src/main/utils/terminalSessionSignals.*, apps/ios/ADE/Views/Work/*, apps/ade-cli/src/services/sync/*
Requires explicit attention or pending input for actionable states, removes prompt and runtime-marker inference, and keeps clean exits ended unless explicitly settled.
Attention and lifecycle presentation
apps/desktop/src/renderer/components/*, apps/desktop/src/renderer/lib/*, apps/ade-cli/src/tuiClient/*
Updates badges, hints, snooze filing, lifecycle menus, chips, tab highlighting, and session source displays.
Remote and push lifecycle wiring
apps/ade-cli/src/services/push/*, apps/ade-cli/src/bootstrap.ts, apps/desktop/src/main/services/pty/*
Updates chat projections, Live Activity transitions, session settlement handling, and user-input attention resolution.
Sync protocol contracts
apps/desktop/src/shared/types/sync.ts
Adds negotiated deflate compression, chunked-envelope capability metadata, numeric protocol versions, and structured version-mismatch errors.

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

Possibly related PRs

  • arul28/ADE#603: Overlaps the lane/session awaiting-input bucketing changes.
  • arul28/ADE#707: Overlaps the CLI push pipeline and runtime-to-Live Activity phase mapping.
  • arul28/ADE#895: Overlaps chat-to-terminal projection of pending input and attention state.

Suggested labels: desktop, ios, docs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.73% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the changes, but it reads like a branch name and is too vague to clearly summarize the PR. Use a concise descriptive title like “Refine needs-input marker tracing across session lifecycle.”
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/ade-session-session-lane-repo-b4afd56a

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 force-pushed the ade/ade-session-session-lane-repo-b4afd56a branch from c7d910f to e41e672 Compare July 29, 2026 19:51
@arul28

arul28 commented Jul 29, 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: e41e6726c7

ℹ️ 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/sessions/sessionService.ts Outdated
@arul28

arul28 commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@arul28
arul28 force-pushed the ade/ade-session-session-lane-repo-b4afd56a branch from e41e672 to 7cd0b1c Compare July 29, 2026 20:06

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

ℹ️ 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/sessions/chatSessionProjection.ts
@arul28

arul28 commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: afe0e1076c

ℹ️ 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".

@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

Caution

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

⚠️ Outside diff range comments (3)
apps/ade-cli/src/services/push/pushPublisherService.ts (1)

1551-1565: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not let CLI runtime heartbeats erase explicit attention.

handleSessionAttentionRequested sets tracked CLI runs to waiting_for_input, but the next onCliRuntimeSignal maps waiting-input or idle to stale and overwrites that explicit state. Runtime signals must not be authoritative over an existing explicit request; track the phase source or preserve the waiting phase until pending_input_resolved or explicit dismissal.

🤖 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/services/push/pushPublisherService.ts` around lines 1551 -
1565, The onCliRuntimeSignal handler currently overwrites an explicit
waiting_for_input state created by handleSessionAttentionRequested. Preserve
that explicit attention state when an existing run is waiting for input,
allowing runtime signals to update it only after pending_input_resolved or
explicit dismissal; use the existing run-tracking state or phase source to
distinguish explicit attention from inferred runtime phases.
apps/ade-cli/src/services/sync/syncRemoteCommandService.ts (2)

1660-1667: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Clear provider-projected lifecycle fields when leaving awaiting input.

These projections spread prior session state and only overwrite lifecycle fields in the awaiting branch. When the chat resumes, provider-derived source and pending-input metadata can remain stale; the new bucket logic then continues to expose false actionable input.

  • apps/ade-cli/src/services/sync/syncRemoteCommandService.ts#L1660-L1667: clear provider-owned pendingInputItemId and attentionSource in active/idle branches.
  • apps/desktop/src/main/services/sessions/chatSessionProjection.ts#L89-L96: clear stale provider_structured attention provenance after awaiting input ends.
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.ts#L2229-L2236: clear provider-owned pending-input and source fields in list projections.
🤖 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/services/sync/syncRemoteCommandService.ts` around lines 1660
- 1667, Clear stale provider-owned pending-input metadata and attention
provenance when projections leave awaiting-input: update the active/idle
branches around apps/ade-cli/src/services/sync/syncRemoteCommandService.ts lines
1660-1667 to reset pendingInputItemId and attentionSource; update
apps/desktop/src/main/services/sessions/chatSessionProjection.ts lines 89-96 to
remove stale provider_structured provenance; and update the list projection
around apps/ade-cli/src/services/sync/syncRemoteCommandService.ts lines
2229-2236 to reset both provider-owned fields. Preserve the awaiting-input
branch’s existing populated values.

3497-3518: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep runtimeState: "waiting-input" coupled with a real pending input ID.

The projection can emit runtimeState: "waiting-input" while pendingInputItemId is omitted/null, but sessionStatusBucket() only considers attentionRequestedAt or a non-null pendingInputItemId. Provider summaries that await input must carry an ID or an explicit wait signal so they are bucketed as awaiting input instead of running.

🤖 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/services/sync/syncRemoteCommandService.ts` around lines 3497
- 3518, The sessionStatusBucket function currently treats waiting-input runtime
states without pendingInputItemId as running. Update its awaiting-input
condition to recognize runtimeState "waiting-input" only when coupled with a
real pending input ID, and ensure provider summary projections supply that ID or
an equivalent explicit wait signal before calling sessionStatusBucket.
🤖 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/ai/tools/ctoOperatorTools.ts`:
- Around line 589-595: Update the description of tools.setSessionSettleOverride
to state that the "clear" override removes the pin and returns the row to its
declared lifecycle state, matching the inputSchema enum; do not refer to null.

In `@apps/ios/ADE/Services/Database.swift`:
- Around line 2007-2010: Update updateSessionLifecycle to accept a two-level
optional settleSource value, allowing the field to be explicitly set or cleared.
Pass "user" when applying a settle and nil when unsetting it, ensuring
optimistic lifecycle updates do not retain stale provenance.

---

Outside diff comments:
In `@apps/ade-cli/src/services/push/pushPublisherService.ts`:
- Around line 1551-1565: The onCliRuntimeSignal handler currently overwrites an
explicit waiting_for_input state created by handleSessionAttentionRequested.
Preserve that explicit attention state when an existing run is waiting for
input, allowing runtime signals to update it only after pending_input_resolved
or explicit dismissal; use the existing run-tracking state or phase source to
distinguish explicit attention from inferred runtime phases.

In `@apps/ade-cli/src/services/sync/syncRemoteCommandService.ts`:
- Around line 1660-1667: Clear stale provider-owned pending-input metadata and
attention provenance when projections leave awaiting-input: update the
active/idle branches around
apps/ade-cli/src/services/sync/syncRemoteCommandService.ts lines 1660-1667 to
reset pendingInputItemId and attentionSource; update
apps/desktop/src/main/services/sessions/chatSessionProjection.ts lines 89-96 to
remove stale provider_structured provenance; and update the list projection
around apps/ade-cli/src/services/sync/syncRemoteCommandService.ts lines
2229-2236 to reset both provider-owned fields. Preserve the awaiting-input
branch’s existing populated values.
- Around line 3497-3518: The sessionStatusBucket function currently treats
waiting-input runtime states without pendingInputItemId as running. Update its
awaiting-input condition to recognize runtimeState "waiting-input" only when
coupled with a real pending input ID, and ensure provider summary projections
supply that ID or an equivalent explicit wait signal before calling
sessionStatusBucket.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6db1c455-220f-47cd-b438-e8c1eec3f07e

📥 Commits

Reviewing files that changed from the base of the PR and between 165c641 and afe0e10.

⛔ Files ignored due to path filters (5)
  • docs/features/agents/README.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/ios-companion.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/README.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/pty-and-sessions.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/ui-surfaces.md is excluded by !docs/**
📒 Files selected for processing (47)
  • apps/ade-cli/src/adeRpcServer.test.ts
  • apps/ade-cli/src/services/push/pushPublisherService.test.ts
  • apps/ade-cli/src/services/push/pushPublisherService.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.test.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.ts
  • apps/ade-cli/src/tuiClient/__tests__/sessionLifecycle.test.tsx
  • apps/ade-cli/src/tuiClient/adeApi.ts
  • apps/ade-cli/src/tuiClient/sessionLifecycle.ts
  • apps/desktop/src/main/services/adeActions/registry.test.ts
  • apps/desktop/src/main/services/adeActions/registry.ts
  • apps/desktop/src/main/services/ai/tools/ctoOperatorTools.test.ts
  • apps/desktop/src/main/services/ai/tools/ctoOperatorTools.ts
  • apps/desktop/src/main/services/lanes/laneListSnapshotService.test.ts
  • apps/desktop/src/main/services/lanes/laneListSnapshotService.ts
  • apps/desktop/src/main/services/prs/prAsync.test.ts
  • apps/desktop/src/main/services/prs/prMergeAutoSettlementService.ts
  • apps/desktop/src/main/services/sessions/chatSessionProjection.ts
  • apps/desktop/src/main/services/sessions/sessionService.test.ts
  • apps/desktop/src/main/services/sessions/sessionService.ts
  • apps/desktop/src/main/services/sessions/settleTerminalSession.ts
  • apps/desktop/src/main/services/state/kvDb.test.ts
  • apps/desktop/src/main/services/state/kvDb.ts
  • apps/desktop/src/main/utils/terminalSessionSignals.test.ts
  • apps/desktop/src/main/utils/terminalSessionSignals.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.test.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.ts
  • apps/desktop/src/renderer/components/terminals/SessionCard.test.tsx
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.test.tsx
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.tsx
  • apps/desktop/src/renderer/components/terminals/SessionInfoPopover.tsx
  • apps/desktop/src/renderer/components/terminals/sessionLifecycleActions.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.test.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.ts
  • apps/desktop/src/renderer/components/work/SessionLifecycleChips.test.tsx
  • apps/desktop/src/renderer/lib/terminalAttention.test.ts
  • apps/desktop/src/renderer/lib/terminalAttention.ts
  • apps/desktop/src/shared/adeCliGuidance.ts
  • apps/desktop/src/shared/sessionCanonicalState.test.ts
  • apps/desktop/src/shared/sessionCanonicalState.ts
  • apps/desktop/src/shared/types/sessions.ts
  • apps/desktop/src/shared/types/sync.ts
  • apps/ios/ADE/Models/RemoteModels.swift
  • apps/ios/ADE/Resources/DatabaseBootstrap.sql
  • apps/ios/ADE/Services/Database.swift
  • apps/ios/ADE/Services/SyncService.swift
  • apps/ios/ADE/Views/Work/WorkRootComponents.swift
  • apps/ios/ADE/Views/Work/WorkSessionCanonicalState.swift
💤 Files with no reviewable changes (3)
  • apps/desktop/src/main/utils/terminalSessionSignals.ts
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.tsx
  • apps/desktop/src/renderer/lib/terminalAttention.ts

Comment thread apps/desktop/src/main/services/ai/tools/ctoOperatorTools.ts
Comment thread apps/ios/ADE/Services/Database.swift
@arul28

arul28 commented Jul 29, 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: c50a1c9f73

ℹ️ About Codex in GitHub

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

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

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

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

Comment thread apps/ade-cli/src/services/push/pushPublisherService.ts
Comment thread apps/ade-cli/src/services/sync/syncRemoteCommandService.ts Outdated
@arul28

arul28 commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@arul28
arul28 force-pushed the ade/ade-session-session-lane-repo-b4afd56a branch from c50a1c9 to 2a02d84 Compare July 29, 2026 20:51

@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

args.agentChatService?.listSessions(laneId, { includeAutomation: true }) ?? Promise.resolve([]),

P2 Badge Degrade lane detail when chat projection fails

If agentChatService.listSessions rejects—for example while one chat-state read is malformed—the newly added promise rejects the entire Promise.all, so the socket/mobile lanes.getDetail command stops returning an otherwise valid lane. The corresponding lane-list builder already catches this optional projection and falls back to []; apply the same fallback here so chat enrichment cannot take down lane detail.

AGENTS.md reference: AGENTS.md:L35-L35

ℹ️ 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".

return workCanonicalSessionState(
status: session.status,
runtimeState: effectiveRuntime,
runtimeState: session.runtimeState,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve structured attention from the chat summary

When iOS receives an updated AgentChatSessionSummary with awaitingInput == true or a pendingInputItemId before the separately hydrated terminal row is refreshed, this bridge now ignores both summary fields and derives from the stale session.pendingInputItemId alone. The row can therefore remain Running/Ready without a Needs you badge—and an “Until I’m asked” snooze can keep it hidden—despite a live provider approval or question. Feed summary.pendingInputItemId (and the structured awaiting flag where needed for restored requests) into the canonical input rather than discarding the summary’s attention state.

Useful? React with 👍 / 👎.

@arul28

arul28 commented Jul 29, 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: 64324ca86e

ℹ️ 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".

update terminal_sessions
set settle_override = ?,
settle_source = case
when ? = 'settled' then 'user'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve operator provenance on settle pins

When the CTO operator calls setSessionSettleOverride with "settled" (ctoOperatorTools.ts), this branch always records the source as user, so the new Session Info field incorrectly reports “User action” instead of “ADE operator.” Accept a source in the underlying override service and have the operator tool pass operator, while UI/bulk user callers retain the user default.

AGENTS.md reference: AGENTS.md:L33-L33

Useful? React with 👍 / 👎.

@arul28

arul28 commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@arul28
arul28 force-pushed the ade/ade-session-session-lane-repo-b4afd56a branch from 64324ca to 7bf5369 Compare July 29, 2026 21:22

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

ℹ️ 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".

// Explicit/provider-structured attention owns this phase until the
// lifecycle event that resolves it. PTY heartbeats are observational and
// must not erase a real request.
if (existing?.phase === "waiting_for_input" || existing?.phase === "waiting_for_approval") 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.

P2 Badge Resolve attention when dismiss-and-settle runs

When an explicit CLI ask is cleared through session.settleSession with dismissPendingInput (the desktop/socket settle path), settleTerminalSession resolves it by emitting an idle runtime state, but this guard discards that authoritative update because the push run is still waiting; the only new call to handleSessionAttentionResolved is wired to PTY user input. Consequently, Dismiss & settle clears the persisted attention while the Live Activity and aggregate push state remain waiting_for_input until the process exits or somebody later types into the PTY. The fresh evidence beyond the prior PTY-response issue is this separate dismiss-and-settle resolution path, which should also invoke the resolution handler.

AGENTS.md reference: AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

@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/main/services/pty/ptyService.ts (1)

4102-4108: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Notify the publisher only after the PTY write succeeds.

markPtyUserInput is called before entry.pty.write(...) in write, writeTerminal, and writeBySessionId (Lines 5153-5154, 5442-5443, and 5543-5544). A failed write therefore marks the Live Activity as running even though the CLI remains blocked on input. Keep local bookkeeping before the write if needed, but invoke onSessionUserInput only after a successful write in all paths.

🤖 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/pty/ptyService.ts` around lines 4102 - 4108,
The publisher notification in markPtyUserInput must occur only after
entry.pty.write succeeds. Separate local bookkeeping from onSessionUserInput,
then update write, writeTerminal, and writeBySessionId to invoke the publisher
callback after their successful writes while preserving bookkeeping before the
write.
apps/ade-cli/src/services/sync/syncRemoteCommandService.ts (1)

1660-1685: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not discard a structured pending-input item when awaitingInput is false.

A chat with pendingInputItemId but awaitingInput: false takes the active branch and gets projected as running with pendingInputItemId: null. That contradicts the canonical contract and hides a provider request from remote clients. Treat a non-empty pending item as the same explicit attention condition in both projection implementations.

Proposed fix
+  const providerPendingInputItemId = chat.pendingInputItemId?.trim() || null;
-  if (chat.awaitingInput) {
+  if (chat.awaitingInput || providerPendingInputItemId) {
     return {
       ...base,
       runtimeState: "waiting-input" as const,
       chatIdleSinceAt: null,
-      pendingInputItemId: chat.pendingInputItemId ?? session.pendingInputItemId ?? null,
+      pendingInputItemId: providerPendingInputItemId ?? session.pendingInputItemId ?? null,
       attentionSource: "provider_structured" as const,
     };
   }

Apply the equivalent change in listRemoteWorkSessions.

Also applies to: 2241-2266

🤖 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/services/sync/syncRemoteCommandService.ts` around lines 1660
- 1685, Update both projection implementations, including
listRemoteWorkSessions, so a non-empty chat.pendingInputItemId is treated as an
explicit waiting-input condition even when chat.awaitingInput is false. Ensure
the waiting branch preserves the pending item ID and provider_structured
attention, while active and idle/ended branches are only used when no pending
item exists.
🧹 Nitpick comments (1)
apps/ade-cli/src/services/sync/syncRemoteCommandService.ts (1)

3601-3620: 📐 Maintainability & Code Quality | 🔵 Trivial

Validate remote lane snapshot RPC behavior.

These projections are served through desktop RPC, but the ADE CLI test here only covers direct work.getSession chat pending-input merging. Exercise lanes.refreshSnapshots and lanes.getDetail through both headless runtime and the socket-backed ade rpc --stdio path, then run ade typecheck, ade test, and ade build.

🤖 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/services/sync/syncRemoteCommandService.ts` around lines 3601
- 3620, Add ADE CLI integration coverage for remote lane snapshot projections by
exercising lanes.refreshSnapshots and lanes.getDetail through both the headless
runtime and socket-backed ade rpc --stdio path. Verify snapshot results and
detail responses match expected behavior, then run ade typecheck, ade test, and
ade build. Use the existing sync service test setup around
laneService.listStateSnapshots and related RPC handlers.

Source: Coding guidelines

🤖 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/ade-cli/src/services/push/pushPublisherService.ts`:
- Around line 1890-1901: Update handleSessionAttentionResolved to remove the
session’s queued question and approval alerts from pendingAlerts when
transitioning the run back to running, in addition to clearing their dedupe
state. Perform this cleanup before scheduleFlush(true), and add a regression
test covering resolution before prompt flush or when Attention is unavailable.

In `@apps/ios/ADE/Services/SyncService.swift`:
- Around line 8334-8337: Update the unsettlement metadata construction around
settledAt and settleSource to set settleOverride to .some(nil) instead of nil,
ensuring any existing override is cleared while preserving the other settlement
fields.

In `@apps/ios/ADETests/WorkSessionCanonicalStateTests.swift`:
- Around line 249-260: Update the affected XCTest expectations in the existing
iOS lifecycle tests to match workCanonicalSessionState: runtime waiting-input
alone should expect running/stale as applicable, prompt-preview cases should no
longer expect needsYou, and clean exit code 0 should expect ended rather than
settled. Preserve the new testRowWrapperMapsChatSummaryPendingItemToNeedsYou
expectation and change only the specified existing assertions.

---

Outside diff comments:
In `@apps/ade-cli/src/services/sync/syncRemoteCommandService.ts`:
- Around line 1660-1685: Update both projection implementations, including
listRemoteWorkSessions, so a non-empty chat.pendingInputItemId is treated as an
explicit waiting-input condition even when chat.awaitingInput is false. Ensure
the waiting branch preserves the pending item ID and provider_structured
attention, while active and idle/ended branches are only used when no pending
item exists.

In `@apps/desktop/src/main/services/pty/ptyService.ts`:
- Around line 4102-4108: The publisher notification in markPtyUserInput must
occur only after entry.pty.write succeeds. Separate local bookkeeping from
onSessionUserInput, then update write, writeTerminal, and writeBySessionId to
invoke the publisher callback after their successful writes while preserving
bookkeeping before the write.

---

Nitpick comments:
In `@apps/ade-cli/src/services/sync/syncRemoteCommandService.ts`:
- Around line 3601-3620: Add ADE CLI integration coverage for remote lane
snapshot projections by exercising lanes.refreshSnapshots and lanes.getDetail
through both the headless runtime and socket-backed ade rpc --stdio path. Verify
snapshot results and detail responses match expected behavior, then run ade
typecheck, ade test, and ade build. Use the existing sync service test setup
around laneService.listStateSnapshots and related RPC handlers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 323d5183-971c-48c4-b26a-267bbda52e42

📥 Commits

Reviewing files that changed from the base of the PR and between afe0e10 and 7bf5369.

⛔ Files ignored due to path filters (5)
  • docs/features/agents/README.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/ios-companion.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/README.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/pty-and-sessions.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/ui-surfaces.md is excluded by !docs/**
📒 Files selected for processing (50)
  • apps/ade-cli/src/adeRpcServer.test.ts
  • apps/ade-cli/src/bootstrap.ts
  • apps/ade-cli/src/services/push/pushPublisherService.test.ts
  • apps/ade-cli/src/services/push/pushPublisherService.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.test.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.ts
  • apps/ade-cli/src/tuiClient/__tests__/sessionLifecycle.test.tsx
  • apps/ade-cli/src/tuiClient/adeApi.ts
  • apps/ade-cli/src/tuiClient/sessionLifecycle.ts
  • apps/desktop/src/main/services/adeActions/registry.test.ts
  • apps/desktop/src/main/services/adeActions/registry.ts
  • apps/desktop/src/main/services/ai/tools/ctoOperatorTools.test.ts
  • apps/desktop/src/main/services/ai/tools/ctoOperatorTools.ts
  • apps/desktop/src/main/services/lanes/laneListSnapshotService.test.ts
  • apps/desktop/src/main/services/lanes/laneListSnapshotService.ts
  • apps/desktop/src/main/services/prs/prAsync.test.ts
  • apps/desktop/src/main/services/prs/prMergeAutoSettlementService.ts
  • apps/desktop/src/main/services/pty/ptyService.ts
  • apps/desktop/src/main/services/sessions/chatSessionProjection.ts
  • apps/desktop/src/main/services/sessions/sessionService.test.ts
  • apps/desktop/src/main/services/sessions/sessionService.ts
  • apps/desktop/src/main/services/sessions/settleTerminalSession.ts
  • apps/desktop/src/main/services/state/kvDb.test.ts
  • apps/desktop/src/main/services/state/kvDb.ts
  • apps/desktop/src/main/utils/terminalSessionSignals.test.ts
  • apps/desktop/src/main/utils/terminalSessionSignals.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.test.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.ts
  • apps/desktop/src/renderer/components/terminals/SessionCard.test.tsx
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.test.tsx
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.tsx
  • apps/desktop/src/renderer/components/terminals/SessionInfoPopover.tsx
  • apps/desktop/src/renderer/components/terminals/sessionLifecycleActions.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.test.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.ts
  • apps/desktop/src/renderer/components/work/SessionLifecycleChips.test.tsx
  • apps/desktop/src/renderer/lib/terminalAttention.test.ts
  • apps/desktop/src/renderer/lib/terminalAttention.ts
  • apps/desktop/src/shared/adeCliGuidance.ts
  • apps/desktop/src/shared/sessionCanonicalState.test.ts
  • apps/desktop/src/shared/sessionCanonicalState.ts
  • apps/desktop/src/shared/types/sessions.ts
  • apps/desktop/src/shared/types/sync.ts
  • apps/ios/ADE/Models/RemoteModels.swift
  • apps/ios/ADE/Resources/DatabaseBootstrap.sql
  • apps/ios/ADE/Services/Database.swift
  • apps/ios/ADE/Services/SyncService.swift
  • apps/ios/ADE/Views/Work/WorkRootComponents.swift
  • apps/ios/ADE/Views/Work/WorkSessionCanonicalState.swift
  • apps/ios/ADETests/WorkSessionCanonicalStateTests.swift
💤 Files with no reviewable changes (3)
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.tsx
  • apps/desktop/src/main/utils/terminalSessionSignals.ts
  • apps/desktop/src/renderer/lib/terminalAttention.ts
🚧 Files skipped from review as they are similar to previous changes (33)
  • apps/desktop/src/main/utils/terminalSessionSignals.test.ts
  • apps/desktop/src/shared/types/sync.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.ts
  • apps/ios/ADE/Views/Work/WorkRootComponents.swift
  • apps/desktop/src/main/services/sessions/settleTerminalSession.ts
  • apps/desktop/src/shared/adeCliGuidance.ts
  • apps/desktop/src/main/services/adeActions/registry.test.ts
  • apps/ade-cli/src/adeRpcServer.test.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.test.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.test.ts
  • apps/ios/ADE/Models/RemoteModels.swift
  • apps/desktop/src/main/services/prs/prAsync.test.ts
  • apps/desktop/src/renderer/components/terminals/SessionCard.test.tsx
  • apps/desktop/src/renderer/lib/terminalAttention.test.ts
  • apps/desktop/src/renderer/components/terminals/SessionInfoPopover.tsx
  • apps/desktop/src/main/services/state/kvDb.test.ts
  • apps/desktop/src/main/services/adeActions/registry.ts
  • apps/desktop/src/main/services/state/kvDb.ts
  • apps/desktop/src/main/services/sessions/sessionService.test.ts
  • apps/desktop/src/renderer/components/work/SessionLifecycleChips.test.tsx
  • apps/ade-cli/src/tuiClient/sessionLifecycle.ts
  • apps/ade-cli/src/tuiClient/adeApi.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.ts
  • apps/ade-cli/src/tuiClient/tests/sessionLifecycle.test.tsx
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.test.tsx
  • apps/desktop/src/main/services/prs/prMergeAutoSettlementService.ts
  • apps/desktop/src/main/services/lanes/laneListSnapshotService.test.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.test.ts
  • apps/desktop/src/shared/sessionCanonicalState.ts
  • apps/desktop/src/renderer/components/terminals/sessionLifecycleActions.ts
  • apps/ios/ADE/Views/Work/WorkSessionCanonicalState.swift
  • apps/ios/ADE/Services/Database.swift
  • apps/desktop/src/main/services/sessions/sessionService.ts

Comment thread apps/ade-cli/src/services/push/pushPublisherService.ts Outdated
Comment on lines 8334 to 8337
settledAt: .some(nil),
settleOverride: nil
settleOverride: nil,
settleSource: .some(nil)
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Clear the settle override when unsetting.

nil for String?? means “leave untouched,” so a prior "active" override remains locally after unsettle. Use .some(nil) to clear it with the other settlement metadata and keep the iOS optimistic state aligned with the desktop mirror.

Proposed fix
-      settleOverride: nil,
+      settleOverride: .some(nil),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
settledAt: .some(nil),
settleOverride: nil
settleOverride: nil,
settleSource: .some(nil)
)
settledAt: .some(nil),
settleOverride: .some(nil),
settleSource: .some(nil)
🤖 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/Services/SyncService.swift` around lines 8334 - 8337, Update the
unsettlement metadata construction around settledAt and settleSource to set
settleOverride to .some(nil) instead of nil, ensuring any existing override is
cleared while preserving the other settlement fields.

Comment thread apps/ios/ADETests/WorkSessionCanonicalStateTests.swift
@arul28

arul28 commented Jul 29, 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: 6bde1573b4

ℹ️ 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".

const run = runs.get(sessionId);
if (!run || (scopeKey != null && run.scopeKey !== scopeKey)) return;
if (run.phase !== "waiting_for_input" && run.phase !== "waiting_for_approval") return;
run.phase = "running";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Terminate the push run after dismiss-and-settle

In the socket session.settleSession path for a tracked CLI with an explicit ask, settleTerminalSession first emits idle, but onCliRuntimeSignal suppresses that signal while the run is awaiting attention; this callback then hard-codes the run back to running even though the session is immediately settled. The Live Activity therefore reports running until another heartbeat changes it to stale, after which it can linger until the stale-run TTL. The fresh evidence after the earlier resolution-callback fix is that the invoked handler uses the same running transition intended for ordinary PTY user responses; dismiss-and-settle needs a terminal/completed transition or removal instead.

AGENTS.md reference: AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

@arul28

arul28 commented Jul 29, 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: 6ef0f9e9be

ℹ️ 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".

// 1. Deterministic attention beats everything — including the failure and
// stale checks below (an agent explicitly asking is actionable regardless).
if (args.pendingInputItemId || args.runtimeState === "waiting-input" || args.attentionRequestedAt) {
if (args.pendingInputItemId || args.attentionRequestedAt) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve structured chat attention without an item ID

When a restored provider request has awaitingInput: true but its pending item ID is temporarily unavailable, this condition now classifies the desktop session as running/ready instead of needs_you, so the badge and tab highlight disappear and an “Until I’m asked” snooze can keep the row hidden. Fresh evidence beyond the iOS report is that desktop projectChatOntoSession still maps every chat.awaitingInput to runtimeState: "waiting-input" while explicitly allowing pendingInputItemId to remain null (chatSessionProjection.ts:89-95); carry provider-structured provenance into this canonical input rather than dropping that signal with generic runtime inference.

AGENTS.md reference: AGENTS.md:L34-L34

Useful? React with 👍 / 👎.

@arul28

arul28 commented Jul 29, 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: a1d850aec0

ℹ️ 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 on lines +3983 to +3985
onAttentionResolved: (resolvedSessionId) => {
args.pushPublisherService?.handleSessionSettled(null, resolvedSessionId);
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route every successful settlement to the push publisher

When a running tracked CLI is settled without dismissPendingInput, this callback is never invoked, so the publisher never receives handleSessionSettled; the bulk session.settleSessions route bypasses it as well. The session becomes settled while its Live Activity remains running until a later heartbeat makes it stale or expires it. Invoke the publisher after every successful settlement, not only from the attention-dismissal branch. Fresh evidence beyond the earlier dismiss-and-settle thread is that ordinary and bulk settlements still have no publisher transition.

AGENTS.md reference: AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

// "active" is an explicit keep-active pin, "settled" acts like a declared
// settle. Mirrors canonicalSessionState in shared/sessionCanonicalState.ts.
if (args.attentionRequestedAt) return "awaiting-input";
if (args.attentionRequestedAt || args.pendingInputItemId) return "awaiting-input";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor source-only provider attention in lane rollups

When a restored chat reports awaitingInput: true without a pending item ID, the projector sets attentionSource: "provider_structured" (and this service also sets pendingInputWaiting), but this predicate ignores both and counts the session as running. Lane badges and counters therefore disagree with the canonical session state; the duplicate remote lane predicate has the same omission. Fresh evidence beyond the earlier remote-projection finding is that the canonical state now explicitly treats source-only provider attention as needs_you, while these rollups still do not.

AGENTS.md reference: AGENTS.md:L33-L34

Useful? React with 👍 / 👎.

Comment on lines +222 to +224
session.attentionRequestedAt || session.pendingInputItemId
? ["Attention source", lifecycleSourceLabel(session.attentionSource)]
: null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Show source-only provider requests in session info

For a restored structured request whose pending item ID is temporarily unavailable, the session now carries attentionSource: "provider_structured" and is canonically needs_you, but this condition is false and omits the Attention source row entirely. Include provider provenance in the visibility condition so the new audit surface still reports “Provider request.” Fresh evidence beyond the previous provenance comment is that the source is now propagated correctly; the renderer gate itself drops it.

AGENTS.md reference: AGENTS.md:L34-L34

Useful? React with 👍 / 👎.

@arul28

arul28 commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

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/lib/terminalAttention.ts (1)

177-186: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Highlight provider-structured chat attention.

A provider-structured session without an item id is now canonical needs_you, but this predicate returns false because it checks only pendingInputItemId and attentionRequestedAt. Include attentionSource === "provider_structured" and pass it from callers so the chat tab matches the session state.

Suggested fix
 export function sessionNeedsChatTabHighlight(args: {
   runtimeState?: TerminalRuntimeState;
   toolType?: TerminalToolType | null;
   pendingInputItemId?: string | null;
+  attentionSource?: TerminalSessionSummary["attentionSource"];
   attentionRequestedAt?: string | null;
 }): boolean {
   if (!isChatToolType(args.toolType)) return false;
   if (args.pendingInputItemId) return true;
+  if (args.attentionSource === "provider_structured") return true;
   if (args.attentionRequestedAt) return true;
   return false;
 }
🤖 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/lib/terminalAttention.ts` around lines 177 - 186,
Update sessionNeedsChatTabHighlight to accept an attentionSource value and
return true when it is "provider_structured", even without pendingInputItemId or
attentionRequestedAt. Update every caller to pass the session’s attentionSource
so provider-structured needs_you state highlights the chat tab consistently.
🤖 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/ade-cli/src/services/sync/syncRemoteCommandService.ts`:
- Around line 3541-3545: Update summarizeLaneRuntime so the final bucket
selection gives "awaiting-input" precedence over "running" when sessions include
both states, including provider-structured attention. Preserve existing
classification logic and add a regression test covering a mixed running session
and provider-blocked chat, asserting the remote snapshot reports
"awaiting-input".

---

Outside diff comments:
In `@apps/desktop/src/renderer/lib/terminalAttention.ts`:
- Around line 177-186: Update sessionNeedsChatTabHighlight to accept an
attentionSource value and return true when it is "provider_structured", even
without pendingInputItemId or attentionRequestedAt. Update every caller to pass
the session’s attentionSource so provider-structured needs_you state highlights
the chat tab consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2af2b1f2-8aa3-4bff-a0d3-6dbfae532553

📥 Commits

Reviewing files that changed from the base of the PR and between 7bf5369 and deebc68.

📒 Files selected for processing (11)
  • apps/ade-cli/src/services/push/pushPublisherService.test.ts
  • apps/ade-cli/src/services/push/pushPublisherService.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.test.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.ts
  • apps/desktop/src/main/services/lanes/laneListSnapshotService.test.ts
  • apps/desktop/src/main/services/lanes/laneListSnapshotService.ts
  • apps/desktop/src/renderer/components/terminals/SessionInfoPopover.tsx
  • apps/desktop/src/renderer/lib/terminalAttention.ts
  • apps/desktop/src/shared/sessionCanonicalState.test.ts
  • apps/desktop/src/shared/sessionCanonicalState.ts
  • apps/ios/ADETests/WorkSessionCanonicalStateTests.swift
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/ade-cli/src/services/push/pushPublisherService.test.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.test.ts

Comment thread apps/ade-cli/src/services/sync/syncRemoteCommandService.ts
@arul28

arul28 commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@arul28
arul28 force-pushed the ade/ade-session-session-lane-repo-b4afd56a branch from b946015 to c8de87f Compare July 29, 2026 23:44

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

ℹ️ About Codex in GitHub

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

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

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

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

Comment thread apps/ade-cli/src/bootstrap.ts Outdated
Comment on lines +697 to +700
const session = sessionService.get(event.sessionId);
if (
session
&& (session.status !== "running" || session.runtimeState === "idle")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Read the live PTY state before suppressing settlement

When a tracked CLI is already idle and the user settles it, sessionService.get() derives runtimeState solely from the persisted status, so a live session is returned as status: "running", runtimeState: "running" and this condition skips handleSessionSettled. The earlier idle signal has already fired, and the supposed heartbeat is only evaluated while processing later output chunks, so a genuinely quiet CLI can leave its stale Live Activity open until the two-hour TTL. Fresh evidence beyond the prior settlement threads is that the centralized listener reads the non-projected SessionService row rather than ptyService's live idle state; resolve the live/projected runtime state here before deciding whether settlement is at rest.

AGENTS.md reference: AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

@arul28

arul28 commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

Caution

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

⚠️ Outside diff range comments (4)
apps/desktop/src/renderer/lib/terminalAttention.ts (1)

177-186: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Highlight structured provider attention too.

A session with attentionSource: "provider_structured" but no pending-item ID is needs_you in canonicalSessionState, yet this helper returns false. Thread attentionSource into this input and treat "provider_structured" as highlighted.

Proposed fix
 export function sessionNeedsChatTabHighlight(args: {
   runtimeState?: TerminalRuntimeState;
   toolType?: TerminalToolType | null;
   pendingInputItemId?: string | null;
+  attentionSource?: TerminalSessionSummary["attentionSource"];
   attentionRequestedAt?: string | null;
 }): boolean {
   if (!isChatToolType(args.toolType)) return false;
   if (args.pendingInputItemId) return true;
+  if (args.attentionSource === "provider_structured") return true;
   if (args.attentionRequestedAt) return true;
   return false;
 }
🤖 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/lib/terminalAttention.ts` around lines 177 - 186,
Update sessionNeedsChatTabHighlight to accept an attentionSource argument, then
return true when it equals "provider_structured" in addition to the existing
pendingInputItemId and attentionRequestedAt conditions. Ensure callers pass the
session’s attentionSource through to preserve highlighting for structured
provider attention.
apps/ade-cli/src/services/sync/syncRemoteCommandService.ts (1)

2237-2269: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

listRemoteWorkSessions re-implements projectChatOntoSession with missing cases.

This inline block duplicates projectChatOntoSession (defined earlier in this same file) but diverges from it in three ways:

  • it never merges chat.orchestrationRunId/orchestrationRole/orchestrationTag/orchestrationParentSessionId/spawnKind into the result,
  • pendingInputItemId doesn't fall back to session.pendingInputItemId when the chat has none,
  • it only branches on chat.status === "idle", not "idle" || "ended" — a chat that ended while the underlying PTY session is still status: "running" falls through to return session; unchanged, leaving a stale runtimeState/attentionSource/pendingInputItemId.

getRemoteWorkSession (single-session read, a few hundred lines above) already delegates to projectChatOntoSession correctly, so work.listSessions-style reads and work.getSession reads can now disagree for the same session.

🐛 Proposed fix: reuse `projectChatOntoSession`
-    if (chat.awaitingInput) {
-      return {
-        ...session,
-        runtimeState: "waiting-input" as const,
-        chatIdleSinceAt: null,
-        pendingInputItemId: chat.pendingInputItemId ?? null,
-        attentionSource: "provider_structured" as const,
-      };
-    }
-    if (chat.status === "active") {
-      return {
-        ...session,
-        runtimeState: "running" as const,
-        chatIdleSinceAt: null,
-        pendingInputItemId: null,
-        attentionSource: session.attentionSource === "provider_structured" ? null : session.attentionSource,
-      };
-    }
-    if (chat.status === "idle") {
-      return {
-        ...session,
-        runtimeState: "idle" as const,
-        chatIdleSinceAt: chat.idleSinceAt ?? null,
-        pendingInputItemId: null,
-        attentionSource: session.attentionSource === "provider_structured" ? null : session.attentionSource,
-      };
-    }
-    return session;
+    return projectChatOntoSession(session, chat);
🤖 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/services/sync/syncRemoteCommandService.ts` around lines 2237
- 2269, Replace the duplicated inline chat projection in listRemoteWorkSessions
with the existing projectChatOntoSession helper. Preserve the surrounding
visibility and running-session checks, and pass each eligible session and its
matching chat through that helper so orchestration fields, pending-input
fallback, and ended-chat handling remain consistent with getRemoteWorkSession.
apps/desktop/src/shared/types/sync.ts (1)

1856-1856: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Enforce deflate negotiation before decoding.

decodeEnvelopeText will inflate any compression: "deflate" envelope that has valid base64 payload/uncompressed metadata, while handleMessage calls it before checking latestHello?.compression?.codec === "deflate". Reject unnegotiated deflate envelopes here, or enforce the negotiated codec state in the decoder itself.

🤖 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/sync.ts` at line 1856, Ensure deflate envelopes
are decoded only after deflate has been negotiated: update decodeEnvelopeText or
the handleMessage call path to reject compression: "deflate" unless
latestHello?.compression?.codec is "deflate". Preserve decoding for gzip and
other valid negotiated envelopes.
apps/ios/ADE/Services/SyncService.swift (1)

1803-1804: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Honor small negotiated frame budgets.

max(16 * 1024, ...) makes every chunk exceed a peer-advertised budget such as 1,025 bytes, even though lines 1796-1798 accept that budget. syncEncodeEnvelopeFrames then throws and sendEnvelope silently returns false, dropping every oversized outbound message. Remove the fixed 16 KiB floor and derive a positive payload size from maxFrameBytes.

Proposed fix
-  let partBytes = max(16 * 1024, ((maxFrameBytes - 1_024) * 3) / 4)
+  let partBytes = max(1, ((maxFrameBytes - 1_024) * 3) / 4)
🤖 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/Services/SyncService.swift` around lines 1803 - 1804, Update the
chunk-size calculation in syncEncodeEnvelopeFrames to remove the fixed 16 KiB
minimum and derive a positive partBytes value directly from the negotiated
maxFrameBytes, while preserving the existing frame-overhead adjustment and total
calculation so small budgets such as 1,025 bytes are honored.
🧹 Nitpick comments (5)
apps/ade-cli/src/services/sync/syncRemoteCommandService.ts (1)

3525-3599: 📐 Maintainability & Code Quality | 🔵 Trivial

Duplicated bucket/rollup logic vs. laneListSnapshotService.ts.

Shares one root cause with the desktop copy — see consolidated comment.

🤖 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/services/sync/syncRemoteCommandService.ts` around lines 3525
- 3599, The sessionStatusBucket and summarizeLaneRuntime implementations
duplicate the canonical bucket and lane-rollup logic from
laneListSnapshotService.ts. Replace this local logic with the shared
implementation, reusing its established symbols and preserving the existing
LaneListSnapshot runtime shape.
apps/desktop/src/main/services/lanes/laneListSnapshotService.ts (1)

104-183: 📐 Maintainability & Code Quality | 🔵 Trivial

Duplicated bucket/rollup logic vs. syncRemoteCommandService.ts.

sessionStatusBucket/summarizeLaneRuntime here are near-duplicates of the same-named functions in apps/ade-cli/src/services/sync/syncRemoteCommandService.ts. See consolidated comment for the cross-file recommendation.

🤖 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/lanes/laneListSnapshotService.ts` around lines
104 - 183, Remove the duplicated sessionStatusBucket and summarizeLaneRuntime
implementations from laneListSnapshotService.ts and reuse the canonical
same-named helpers from syncRemoteCommandService.ts, consolidating shared bucket
and lane rollup logic while preserving the existing outputs and precedence
behavior.
apps/ade-cli/src/services/push/pushPublisherService.ts (2)

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

Same "at-rest + explicitly settled" predicate is implemented three times across two files. Each site independently re-derives whether a CLI session is at rest (status/runtimeState) and explicitly settled (settleOverride/settledAt), risking silent drift if the settlement rule changes in only one place.

  • apps/ade-cli/src/services/push/pushPublisherService.ts#L1567-1633: extract the atRest && (settleOverride === "settled" || (settleOverride !== "active" && settledAt)) predicate from onCliRuntimeSignal into a shared, exported helper (e.g. isAtRestAndSettled) taking {status, runtimeState, settleOverride, settledAt}.
  • apps/ade-cli/src/services/push/pushPublisherService.ts#L925-956: reuse the same helper in resolveMissingMeta's settle fast path instead of re-deriving atRest/settled inline.
  • apps/ade-cli/src/bootstrap.ts#L691-708: import and reuse the same helper in the sessionService.onChanged listener instead of duplicating the condition a third time.
🤖 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/services/push/pushPublisherService.ts` at line 1, Extract
the shared at-rest-and-settled predicate from onCliRuntimeSignal into an
exported isAtRestAndSettled helper accepting status, runtimeState,
settleOverride, and settledAt. Replace the inline checks in resolveMissingMeta
and the bootstrap sessionService.onChanged listener with this helper, preserving
the existing settlement semantics.

925-956: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated atRest/settled predicate (see consolidated comment).

Same atRest && settled predicate as onCliRuntimeSignal below and bootstrap.ts's session-changed listener. Worth consolidating into a shared helper — see the cross-file consolidated comment.

🤖 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/services/push/pushPublisherService.ts` around lines 925 -
956, Extract the duplicated at-rest and settled-session predicate into a shared
helper, preserving the existing settleOverride and settledAt semantics. Update
resolveMissingMeta, onCliRuntimeSignal, and bootstrap.ts’s session-changed
listener to use the helper instead of repeating the inline condition.
apps/ade-cli/src/bootstrap.ts (1)

691-708: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Settlement/atRest predicate duplicated across files.

The (status/runtimeState) atRest && (settleOverride/settledAt) settled check here re-implements the same predicate found in pushPublisherService.ts's resolveMissingMeta and onCliRuntimeSignal. Three near-identical copies of business-critical attention/settlement logic across two files is a drift risk — a future tweak to one copy (e.g. adding a new settle source) could silently miss the others.

Consider extracting a shared predicate (e.g. isAtRestAndSettled(status, runtimeState, settleOverride, settledAt)) into a shared module consumed by all three sites.

🤖 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/bootstrap.ts` around lines 691 - 708, Extract the shared
at-rest-and-settled predicate used by the sessionService.onChanged callback and
pushPublisherService’s resolveMissingMeta and onCliRuntimeSignal into a common
module. Replace all three inline checks with that helper, preserving the current
status, runtimeState, settleOverride, and settledAt semantics and updating all
call sites to use the single implementation.
🤖 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/lanes/laneAgents.ts`:
- Around line 41-44: Update the lane activity projection around the summary
attention checks to treat attentionSource === "provider_structured" as awaiting
input alongside pendingInputItemId and attentionRequestedAt. Apply the same
condition to the input-hint projection referenced by the additional location,
preserving existing runtime-state handling for other sessions.

---

Outside diff comments:
In `@apps/ade-cli/src/services/sync/syncRemoteCommandService.ts`:
- Around line 2237-2269: Replace the duplicated inline chat projection in
listRemoteWorkSessions with the existing projectChatOntoSession helper. Preserve
the surrounding visibility and running-session checks, and pass each eligible
session and its matching chat through that helper so orchestration fields,
pending-input fallback, and ended-chat handling remain consistent with
getRemoteWorkSession.

In `@apps/desktop/src/renderer/lib/terminalAttention.ts`:
- Around line 177-186: Update sessionNeedsChatTabHighlight to accept an
attentionSource argument, then return true when it equals "provider_structured"
in addition to the existing pendingInputItemId and attentionRequestedAt
conditions. Ensure callers pass the session’s attentionSource through to
preserve highlighting for structured provider attention.

In `@apps/desktop/src/shared/types/sync.ts`:
- Line 1856: Ensure deflate envelopes are decoded only after deflate has been
negotiated: update decodeEnvelopeText or the handleMessage call path to reject
compression: "deflate" unless latestHello?.compression?.codec is "deflate".
Preserve decoding for gzip and other valid negotiated envelopes.

In `@apps/ios/ADE/Services/SyncService.swift`:
- Around line 1803-1804: Update the chunk-size calculation in
syncEncodeEnvelopeFrames to remove the fixed 16 KiB minimum and derive a
positive partBytes value directly from the negotiated maxFrameBytes, while
preserving the existing frame-overhead adjustment and total calculation so small
budgets such as 1,025 bytes are honored.

---

Nitpick comments:
In `@apps/ade-cli/src/bootstrap.ts`:
- Around line 691-708: Extract the shared at-rest-and-settled predicate used by
the sessionService.onChanged callback and pushPublisherService’s
resolveMissingMeta and onCliRuntimeSignal into a common module. Replace all
three inline checks with that helper, preserving the current status,
runtimeState, settleOverride, and settledAt semantics and updating all call
sites to use the single implementation.

In `@apps/ade-cli/src/services/push/pushPublisherService.ts`:
- Line 1: Extract the shared at-rest-and-settled predicate from
onCliRuntimeSignal into an exported isAtRestAndSettled helper accepting status,
runtimeState, settleOverride, and settledAt. Replace the inline checks in
resolveMissingMeta and the bootstrap sessionService.onChanged listener with this
helper, preserving the existing settlement semantics.
- Around line 925-956: Extract the duplicated at-rest and settled-session
predicate into a shared helper, preserving the existing settleOverride and
settledAt semantics. Update resolveMissingMeta, onCliRuntimeSignal, and
bootstrap.ts’s session-changed listener to use the helper instead of repeating
the inline condition.

In `@apps/ade-cli/src/services/sync/syncRemoteCommandService.ts`:
- Around line 3525-3599: The sessionStatusBucket and summarizeLaneRuntime
implementations duplicate the canonical bucket and lane-rollup logic from
laneListSnapshotService.ts. Replace this local logic with the shared
implementation, reusing its established symbols and preserving the existing
LaneListSnapshot runtime shape.

In `@apps/desktop/src/main/services/lanes/laneListSnapshotService.ts`:
- Around line 104-183: Remove the duplicated sessionStatusBucket and
summarizeLaneRuntime implementations from laneListSnapshotService.ts and reuse
the canonical same-named helpers from syncRemoteCommandService.ts, consolidating
shared bucket and lane rollup logic while preserving the existing outputs and
precedence behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 80fbb6cc-4938-4787-9980-45eaae8bb911

📥 Commits

Reviewing files that changed from the base of the PR and between deebc68 and c8de87f.

⛔ Files ignored due to path filters (5)
  • docs/features/agents/README.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/ios-companion.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/README.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/pty-and-sessions.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/ui-surfaces.md is excluded by !docs/**
📒 Files selected for processing (50)
  • apps/ade-cli/src/adeRpcServer.test.ts
  • apps/ade-cli/src/bootstrap.ts
  • apps/ade-cli/src/services/push/pushPublisherService.test.ts
  • apps/ade-cli/src/services/push/pushPublisherService.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.test.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.ts
  • apps/ade-cli/src/tuiClient/__tests__/sessionLifecycle.test.tsx
  • apps/ade-cli/src/tuiClient/adeApi.ts
  • apps/ade-cli/src/tuiClient/sessionLifecycle.ts
  • apps/desktop/src/main/services/adeActions/registry.test.ts
  • apps/desktop/src/main/services/adeActions/registry.ts
  • apps/desktop/src/main/services/ai/tools/ctoOperatorTools.test.ts
  • apps/desktop/src/main/services/ai/tools/ctoOperatorTools.ts
  • apps/desktop/src/main/services/lanes/laneListSnapshotService.test.ts
  • apps/desktop/src/main/services/lanes/laneListSnapshotService.ts
  • apps/desktop/src/main/services/prs/prAsync.test.ts
  • apps/desktop/src/main/services/prs/prMergeAutoSettlementService.ts
  • apps/desktop/src/main/services/pty/ptyService.ts
  • apps/desktop/src/main/services/sessions/chatSessionProjection.ts
  • apps/desktop/src/main/services/sessions/sessionService.test.ts
  • apps/desktop/src/main/services/sessions/sessionService.ts
  • apps/desktop/src/main/services/sessions/settleTerminalSession.ts
  • apps/desktop/src/main/services/state/kvDb.test.ts
  • apps/desktop/src/main/services/state/kvDb.ts
  • apps/desktop/src/main/utils/terminalSessionSignals.test.ts
  • apps/desktop/src/main/utils/terminalSessionSignals.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.test.ts
  • apps/desktop/src/renderer/components/lanes/laneAgents.ts
  • apps/desktop/src/renderer/components/terminals/SessionCard.test.tsx
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.test.tsx
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.tsx
  • apps/desktop/src/renderer/components/terminals/SessionInfoPopover.tsx
  • apps/desktop/src/renderer/components/terminals/sessionLifecycleActions.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.test.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.ts
  • apps/desktop/src/renderer/components/work/SessionLifecycleChips.test.tsx
  • apps/desktop/src/renderer/lib/terminalAttention.test.ts
  • apps/desktop/src/renderer/lib/terminalAttention.ts
  • apps/desktop/src/shared/adeCliGuidance.ts
  • apps/desktop/src/shared/sessionCanonicalState.test.ts
  • apps/desktop/src/shared/sessionCanonicalState.ts
  • apps/desktop/src/shared/types/sessions.ts
  • apps/desktop/src/shared/types/sync.ts
  • apps/ios/ADE/Models/RemoteModels.swift
  • apps/ios/ADE/Resources/DatabaseBootstrap.sql
  • apps/ios/ADE/Services/Database.swift
  • apps/ios/ADE/Services/SyncService.swift
  • apps/ios/ADE/Views/Work/WorkRootComponents.swift
  • apps/ios/ADE/Views/Work/WorkSessionCanonicalState.swift
  • apps/ios/ADETests/WorkSessionCanonicalStateTests.swift
💤 Files with no reviewable changes (2)
  • apps/desktop/src/main/utils/terminalSessionSignals.ts
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • apps/desktop/src/renderer/components/terminals/SessionCard.test.tsx
  • apps/desktop/src/renderer/components/lanes/laneAgents.test.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.ts
  • apps/desktop/src/shared/adeCliGuidance.ts
  • apps/desktop/src/main/services/ai/tools/ctoOperatorTools.test.ts
  • apps/ios/ADE/Views/Work/WorkRootComponents.swift

Comment thread apps/desktop/src/renderer/components/lanes/laneAgents.ts Outdated
@arul28

arul28 commented Jul 30, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 67b47f6a85

ℹ️ About Codex in GitHub

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

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

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

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

@arul28

arul28 commented Jul 30, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@arul28
arul28 merged commit 31bac9b into main Jul 30, 2026
3 checks passed
@arul28
arul28 deleted the ade/ade-session-session-lane-repo-b4afd56a branch July 30, 2026 07:34
arul28 added a commit that referenced this pull request Aug 19, 2026
* ci: build and test the iOS app on every PR

The iOS app was the only ADE surface with zero CI coverage; three
consecutive merges (#1117, #1120, #1121) each landed a Swift compile
break, and 6 ADETests failures accumulated invisibly. New test-ios job on
macos-26 (Xcode 26) builds the ADE scheme for testing and runs ADETests.
It always runs — ci-pass deliberately counts "skipped" as failure — but
exits success immediately on PRs that don't touch apps/ios/** or ci.yml,
so non-iOS PRs pay only runner spin-up. SPM packages cached on
Package.resolved.

Make the suite it gates green (1494 tests, 0 failures locally):
- Three PR-list tests still built 'queue' group fixtures; queue workflows
  were removed in 1b3d33b and the joins narrowed to integration groups.
  Fixtures now use 'integration'; the scoping/filter subjects and every
  other assertion are unchanged.
- testFilterPullRequestListItemsMatchesStateAndSearch asserted a search
  for "review" returns one row, but both fixtures contain "review" in
  title/branch — wrong since the day it landed (4f18960); state
  narrowing is covered by the following assertions.
- testRosterCleanExitAndLegacyPayloadRemainCompatible expected clean exit
  to settle; 31bac9b (#951) made settle declared-only. Expect .ended and
  additionally pin exitCode == 0.
- testRelayCandidateRuntimeIgnoresReadyBeforeAccepted raced a real 350 ms
  negotiation deadline against the host scheduler. The budget is now a
  SyncConnectionRaceBudget field (production defaults byte-identical) and
  the test hook widens only that window; assertions untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci: let the iOS test host sign ad-hoc; surface full failure detail

CODE_SIGNING_ALLOWED=NO left the test host unsigned, so simulator
keychain access failed with missing-entitlement errors in the account
sign-out and DPoP proof tests (they pass locally, where the host signs
ad-hoc). Also replace output truncation with -quiet and upload the
.xcresult bundle on failure so CI failures are diagnosable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci: address review — persist-credentials off, timeout test keeps a real window

- test-ios checkout no longer persists the GITHUB_TOKEN into .git/config;
  xcodebuild runs PR-controlled build phases and needs no authenticated git.
- awaitRelayCandidateReadyForTesting takes an acceptedWindowNanoseconds
  override; the negotiation-timeout test passes 50ms so it exercises the
  timeout path without sitting out the wide scheduling-safe window
  (SyncRecoveryPolicyTests back to ~9s).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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