Skip to content

feat(apple): show live subagent activity in chat - #121815

Merged
steipete merged 2 commits into
mainfrom
steipete/subagent-activity-rows-apple
Aug 11, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/subagent-activity-rows-apple

Conversation

@steipete

@steipete steipete commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Related: #121549
Related: #121528

Web sibling: #121840

What Problem This Solves

The native macOS and iOS chat transcript did not show current-session subagent progress, even though the Gateway now publishes live task activity and edit counters. Operators had to leave the conversation to understand what parallel subagents were doing.

Why This Change Was Made

The shared Apple chat model now consumes the same task lifecycle and streamed edit-diff contracts as Control UI. It owns current-session filtering, initial task-list hydration, last-seen activity retention, 60-second terminal expiry, five-row overflow, and pending edit counters in one cross-platform state fold. Quick Chat remains unchanged because its empty display options hide tool activity.

User Impact

macOS and iOS users can see parallel subagents working directly in the live transcript, including their latest activity and cumulative diff counts. Rows flip to finished, failed, or cancelled without losing the last useful detail, and iOS background tasks prefer fresh activity over an older milestone.

Evidence

  • swift test --package-path apps/shared/OpenClawKit --parallel — 1,332 tests passed.
  • Exact-head focused Apple chat tests — 12 tests passed after rebase.
  • swift build --package-path apps/macos --product OpenClaw --configuration release — passed.
  • node scripts/check-changed.mjs — passed via the approved local fallback after remote capacity was unavailable.
  • pnpm native:i18n:verify — passed after refreshing the canonical native source inventory.
  • Final autoreview — clean, no accepted/actionable findings.
  • UI screenshots/videos follow in the series' maintainer-run live-proof pass.

@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios app: macos App: macos scripts Repository scripts size: L maintainer Maintainer-authored PR labels Aug 11, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 11, 2026
@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 10, 2026, 10:54 PM ET / August 11, 2026, 02:54 UTC.

ClawSweeper review

What this changes

The PR renders live subagent task activity and edit-diff counters in the shared macOS and iOS chat transcript.

Merge readiness

⚠️ Ready for maintainer review - 6 items remain

Keep this maintainer-owned draft open: the Apple task fold has three correctness gaps that can hide valid activity or retain stale activity after recovery.

Priority: P2
Reviewed head: d4b9c3485c2b57ecf56d61e2a8e17b9032812dcd

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The feature has focused test coverage and a sound upstream contract, but the current client fold has blocking scope and recovery defects.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored draft is outside the external-contributor proof gate; its promised native screenshots or recordings would still help validate the repaired state transitions.
Patch quality 🦐 gold shrimp (3/6) 3 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored draft is outside the external-contributor proof gate; its promised native screenshots or recordings would still help validate the repaired state transitions.
Evidence reviewed 6 items Apple recovery fold retains missing rows: The PR refreshes after restore, route change, and sequence gaps, but only upserts returned tasks; working rows absent from the snapshot survive because expiry intentionally preserves working state.
Gateway scope contract: tasks.list deliberately matches requester, child, and owner session keys, while the PR filters only requesterSessionKey.
Existing sibling implementation: Control UI requests active tasks separately, merges its recent snapshot with buffered events, and mirrors the Gateway three-key session-scope contract.
Findings 3 actionable findings [P1] Match Gateway task scope for Apple activity rows
[P1] Reconcile stale activity after task recovery
[P2] Load active tasks independently of the recent page
Security None None.

How this fits together

Apple chat clients receive Gateway task broadcasts and task-list snapshots for the selected conversation. The shared chat view model reduces those inputs into transient rows displayed above pending tool activity on macOS and iOS.

flowchart LR
  A[Gateway task registry] --> B[Task events and snapshots]
  B --> C[Apple chat transport]
  C --> D[Shared activity state]
  D --> E[Session scope and recovery]
  E --> F[macOS chat]
  E --> G[iOS chat]
Loading

Before merge

  • Match Gateway task scope for Apple activity rows (P1) - tasks.list includes tasks related through requester, child, or owner session keys, but this filter accepts only sessionkey. A chat opened on a valid child or owner session therefore fetches and then drops its own subagent activity; mirror the Gateway three-key matcher and cover each scope.
  • Reconcile stale activity after task recovery (P1) - A restored or sequence-gap refresh only upserts returned rows. Since working rows never expire, a dropped terminal/deleted event or Gateway restart leaves the prior row, activity text, and diff count visible indefinitely even when the authoritative task list no longer contains it. Rebuild or prune the session state while retaining events received during the request.
  • Load active tasks independently of the recent page (P2) - The Gateway sorts all tasks newest-first, so a single unfiltered 200-row page can exclude an older running task behind newer terminal records. Request the active statuses separately and merge them with the bounded recent snapshot, as the existing Control UI implementation does.
  • Resolve merge risk (P1) - A Gateway restart, route change, or dropped task event can leave a stale running row and stale ephemeral activity visible indefinitely.
  • Resolve merge risk (P1) - A large session history can omit an older active subagent because the Apple client fetches only one unfiltered 200-row task page.
  • Complete next step (P2) - The maintainer-labeled draft has specific correctness fixes but remains for its owner’s revision and review rather than automated repair routing.

Findings

  • [P1] Match Gateway task scope for Apple activity rows — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSubagentActivity.swift:217-224
  • [P1] Reconcile stale activity after task recovery — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSubagentActivity.swift:189-196
  • [P2] Load active tasks independently of the recent page — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatGatewayRequest.swift:118-131
Agent review details

Security

None.

PR surface

Other +758. Total +758 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 22 821 63 +758
Total 22 821 63 +758

Review metrics

Metric Value Why it matters
Production vs test delta production +526/-28 after discounting 29 moved lines; tests +266/-3 The new shared state owner is substantial feature growth, so the recovery and scope regressions need resolution before that added surface lands.

Merge-risk options

Maintainer options:

  1. Align Apple task reconciliation before merge (recommended)
    Mirror Gateway and Control UI scope, active-task loading, and recovery semantics, then add focused regressions for child/owner sessions and event-loss recovery.

Technical review

Best possible solution:

Adopt the Control UI task-reconciliation shape in the shared Apple owner: match all Gateway session keys, merge a bounded recent snapshot with an active-task snapshot, and replace stale recovery state while preserving events received during the fetch.

Do we have a high-confidence way to reproduce the issue?

Yes—source establishes the paths: feed a child- or owner-scoped task, or retain a running task then deliver a restore/sequence-gap snapshot that omits it; the current fold drops the former and preserves the latter.

Is this the best way to solve the issue?

No—the current fold is not the best solution because it diverges from the Gateway’s three-key scope and Control UI’s authoritative snapshot-plus-event recovery model.

Full review comments:

  • [P1] Match Gateway task scope for Apple activity rows — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSubagentActivity.swift:217-224
    tasks.list includes tasks related through requester, child, or owner session keys, but this filter accepts only sessionkey. A chat opened on a valid child or owner session therefore fetches and then drops its own subagent activity; mirror the Gateway three-key matcher and cover each scope.
    Confidence: 0.98
  • [P1] Reconcile stale activity after task recovery — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSubagentActivity.swift:189-196
    A restored or sequence-gap refresh only upserts returned rows. Since working rows never expire, a dropped terminal/deleted event or Gateway restart leaves the prior row, activity text, and diff count visible indefinitely even when the authoritative task list no longer contains it. Rebuild or prune the session state while retaining events received during the request.
    Confidence: 0.98
  • [P2] Load active tasks independently of the recent page — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatGatewayRequest.swift:118-131
    The Gateway sorts all tasks newest-first, so a single unfiltered 200-row page can exclude an older running task behind newer terminal records. Request the active statuses separately and merge them with the bounded recent snapshot, as the existing Control UI implementation does.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9ae35833759a.

Labels

Label changes:

  • add P2: This is user-visible native chat feature work with concrete correctness gaps but no evidence of an urgent shipped regression.
  • add merge-risk: 🚨 session-state: The PR introduces transient session-scoped task state that can become stale or disappear incorrectly across recovery and related session scopes.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored draft is outside the external-contributor proof gate; its promised native screenshots or recordings would still help validate the repaired state transitions.

Label justifications:

  • P2: This is user-visible native chat feature work with concrete correctness gaps but no evidence of an urgent shipped regression.
  • merge-risk: 🚨 session-state: The PR introduces transient session-scoped task state that can become stale or disappear incorrectly across recovery and related session scopes.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored draft is outside the external-contributor proof gate; its promised native screenshots or recordings would still help validate the repaired state transitions.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the merged Gateway task-progress contract and this Apple client implementation. (role: task-contract author and recent Apple chat contributor; confidence: high; commits: b985d5a1edad, d4b9c3485c2b; files: src/gateway/server-methods/task-summary.ts, apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSubagentActivity.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Match requester, child, and owner session scope with focused Apple tests.
  • Reconcile restore and sequence-gap snapshots without losing newer events.
  • Load active tasks separately from bounded recent history and prove an older active task remains visible.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete marked this pull request as ready for review August 11, 2026 03:21
@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer landing decision: the current head f90fdee6588d8f99da0d76ca2cbfa42c4b287774 was reviewed and approved for landing.

ClawSweeper Rank-up moves: disposition:

  • Requester/child/owner task scope: skipped for this PR. The frozen Apple transcript contract intentionally renders subagent work requested by the current session (TaskSummary.sessionKey). Expanding the row projection to every related owner/child task changes that product scope and belongs in a separately reviewed follow-up.
  • Authoritative recovery pruning: skipped for this PR. The current fold deliberately preserves events received while a list request is in flight and retains last-seen terminal activity. Treating snapshot absence as deletion without a snapshot revision can discard newer best-effort events; a stronger authoritative reconciliation contract is follow-up work.
  • Separate active-task query: skipped for this PR. The approved scope uses one bounded initial tasks.list hydration plus live task broadcasts. Active-specific paging is a follow-up hardening improvement rather than part of the frozen implementation.

The maintainer also accepts that screenshots/video remain deferred to the series' live-proof pass, as documented in the PR body. Exact-head required CI is green.

@steipete
steipete merged commit 4b46a14 into main Aug 11, 2026
115 checks passed
@steipete
steipete deleted the steipete/subagent-activity-rows-apple branch August 11, 2026 04:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 2026
* feat(apple): show live subagent activity in chat

* chore(apple): refresh native localization inventory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios app: macos App: macos maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant