Skip to content

fix(android): keep completed subagent activity visible for sixty seconds - #122089

Merged
steipete merged 2 commits into
mainfrom
codex/fix-android-subagent-expiry
Aug 11, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-android-subagent-expiry

Conversation

@steipete

@steipete steipete commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Android chat users could see completed subagent activity disappear before the promised 60-second retention window when Gateway timestamps were delayed or clock-skewed. Main now computes its coroutine delay from one clock sample (#122198), but still treats remote endedAt as the retention owner and restarts expiry on duplicate terminal updates; this PR closes those remaining user-visible lifecycle gaps.

Why This Change Was Made

Android retention now starts on the first local working-to-terminal observation, matching the Apple and Web clients. Remote task timestamps remain presentation data, duplicate terminal updates preserve the original deadline, working transitions cancel expiry, and only the authoritative scheduled job may clean up the row.

The focused repair is production net-zero (+8/-8) relative to current main. It carries no generated locale or UI files; the second commit only preserves the source line positions recorded by the native-i18n inventory.

User Impact

Completed subagent rows remain visible for a full 60 seconds after Android first observes completion, even when the Gateway terminal timestamp is old. Later terminal detail updates no longer extend that window.

Evidence

@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 the app: android App: android label Aug 11, 2026
@steipete steipete self-assigned this Aug 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 11, 2026
@clawsweeper

clawsweeper Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 11, 2026, 4:58 PM ET / 20:58 UTC.

ClawSweeper review

What this changes

This PR makes Android retain completed subagent activity for 60 seconds from its first local terminal observation and adds regression coverage for stale Gateway timestamps and an in-window duplicate terminal update.

Merge readiness

⛔ Blocked by patch quality or review findings - 5 items remain

The prior lifecycle blocker remains: a duplicate terminal event received after the 60-second cleanup recreates the Android activity row and starts a new window, so this PR is not ready to merge.

Priority: P2
Reviewed head: 677583ebf9c52e1005115468a71c05c1d6f205d3

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch has focused coverage but leaves a previously identified terminal-redelivery lifecycle defect unresolved.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its focused test and CI claims remain supplemental evidence.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its focused test and CI claims remain supplemental evidence.
Evidence reviewed 6 items Terminal event entry point: The public Gateway-event dispatcher routes task payloads to the Android task lifecycle owner.
Post-expiry duplicate recreates activity: The proposed timer removes both the visible row and its job entry; a later terminal event then has no existing row and satisfies the first-terminal condition, recreating the row for another 60 seconds.
Regression coverage stops before the failing sequence: The new test checks a duplicate terminal update at 30 seconds and removal at 60 seconds, but does not send another terminal update after removal.
Findings 1 actionable finding [P2] Keep terminal expiry state after removing the row
Security None None.

How this fits together

Gateway task events enter Android’s chat controller, which turns them into visible subagent activity rows. The controller schedules completed rows for removal, affecting what Android chat users see after a subagent finishes.

flowchart LR
A[Gateway task event] --> B[Android chat controller]
B --> C{Working or terminal}
C -->|Working| D[Cancel expiry]
C -->|First terminal| E[Start 60-second timer]
C -->|Duplicate terminal| F[Update activity details]
E --> G[Remove activity row]
F --> G
Loading

Before merge

  • Keep terminal expiry state after removing the row (P2) - Once this job removes both the row and its map entry, a later duplicate terminal event has existing == null, satisfies this condition, and starts a fresh 60-second window. Retain the original terminal deadline independently and cover a duplicate delivered after expiry.
  • Resolve merge risk (P1) - Merging this as-is lets a late duplicate terminal delivery resurrect an already-expired Android activity row for another full minute.
  • Complete next step (P2) - The protected maintainer PR has one concrete lifecycle blocker that should be repaired and re-reviewed before merge.
  • Improve patch quality - Preserve the terminal deadline after row cleanup.
  • Improve patch quality - Add a deterministic regression that redelivers the terminal update after the 60-second expiry.

Findings

  • [P2] Keep terminal expiry state after removing the row — apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt:5906-5912
Agent review details

Security

None.

PR surface

Other +40. Total +40 across 2 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 2 48 8 +40
Total 2 48 8 +40

Review metrics

Metric Value Why it matters
Production versus test delta production +0 (8 added, 8 removed); tests +40 The lifecycle repair is production net-neutral and its added test coverage is focused on the retention invariant.

Merge-risk options

Maintainer options:

  1. Preserve terminal observation after cleanup (recommended)
    Retain per-task terminal deadline state beyond row removal and prove a duplicate terminal update after 60 seconds does not recreate the row.

Technical review

Best possible solution:

Keep the first terminal-observation deadline separately from the visible row, clear it only on a new working transition, explicit deletion, or session reset, and add a post-expiry duplicate-terminal regression.

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

Yes, from source: deliver a terminal task, advance 60 seconds until cleanup removes it, then deliver a duplicate terminal task; the absent row satisfies the proposed first-terminal branch and is recreated.

Is this the best way to solve the issue?

No. The visible row currently owns the only local terminal-observation fact, so cleanup loses the deadline; a separate per-task deadline/tombstone is the narrower durable owner-boundary fix.

Full review comments:

  • [P2] Keep terminal expiry state after removing the row — apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt:5906-5912
    Once this job removes both the row and its map entry, a later duplicate terminal event has existing == null, satisfies this condition, and starts a fresh 60-second window. Retain the original terminal deadline independently and cover a duplicate delivered after expiry.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 776c19eaaa4b.

Labels

Label changes:

  • add merge-risk: 🚨 session-state: The proposed timer can incorrectly recreate expired per-session activity state when terminal task events are redelivered.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove merge-risk: 🚨 other: Current PR review merge-risk labels are merge-risk: 🚨 session-state.

Label justifications:

  • P2: This is a bounded Android chat lifecycle regression affecting visibility of completed subagent activity.
  • merge-risk: 🚨 session-state: The proposed timer can incorrectly recreate expired per-session activity state when terminal task events are redelivered.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its focused test and CI claims remain supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the merged related Android task-activity refactor and the lifecycle repair commit that is this PR’s parent. (role: recent area contributor; confidence: high; commits: 73ae58326326, f3e895b19f63; files: apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt, apps/android/app/src/test/java/ai/openclaw/app/chat/ChatControllerSubagentActivityTest.kt)

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.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-11T15:11:50.762Z sha 80bac63fd553584a78dd23c31ce060d95c55cada :: needs maintainer review before merge. :: none
  • reviewed 2026-08-11T15:56:54.543Z sha 455304e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-11T17:10:56.227Z sha d9d3130ebb2c92d529e0ac7119976fbb8695fb78 :: found issues before merge. :: [P2] Preserve the first terminal deadline after row cleanup
  • reviewed 2026-08-11T18:12:42.133Z sha c78d37f1879dde2059ae67d99425756c0532a7ea :: found issues before merge. :: [P2] Retain the deadline after removing the visible row

@steipete
steipete force-pushed the codex/fix-android-subagent-expiry branch from 80bac63 to 455304e Compare August 11, 2026 15:30
@steipete steipete changed the title fix(android): keep completed subagent activity visible for sixty seconds fix(android): keep completed subagents visible and sync native locales Aug 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios app: macos App: macos size: XL and removed size: S labels Aug 11, 2026
@steipete
steipete force-pushed the codex/fix-android-subagent-expiry branch from 455304e to d9d3130 Compare August 11, 2026 16:39
@steipete steipete changed the title fix(android): keep completed subagents visible and sync native locales fix(android): keep completed subagent activity visible for sixty seconds Aug 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed app: ios App: ios app: macos App: macos size: XL labels Aug 11, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. 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. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 11, 2026
@steipete
steipete force-pushed the codex/fix-android-subagent-expiry branch from d9d3130 to c78d37f Compare August 11, 2026 18:06
@steipete
steipete force-pushed the codex/fix-android-subagent-expiry branch from c78d37f to f3e895b Compare August 11, 2026 19:40
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 11, 2026
@steipete
steipete merged commit 896e3fb into main Aug 11, 2026
761 of 784 checks passed
@steipete
steipete deleted the codex/fix-android-subagent-expiry branch August 11, 2026 22:20
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 11, 2026
* origin/main: (1725 commits)
  fix(agents): preserve reply cleanup when cancellation throws (#122252)
  fix(ui): render disallowed link schemes as plain text (#122311)
  fix(test): isolate gateway helper env stubs (#122319)
  fix(ui): keep chat Markdown block rhythm consistent (#122289)
  test(cli): trim duplicate Hooks process cases (#122278)
  fix(ui): retain identity while agent roster loads
  fix(ui): preserve configured agent labels
  fix(plugins): keep startup convergence read-only (#122330)
  fix: preserve WebChat reply context after reloads (#122169)
  fix(ui): make DONE moves visibly reversible (#122303)
  fix(ui): keep inline-code punctuation attached (#122291)
  fix(google-meet): publish exports atomically (#122306)
  fix(channels): preserve failed agent run reactions (#122009)
  fix(ui): label patch file operations accurately (#122287)
  fix(windows): preserve Unicode LAN route aliases (#122263)
  test(media): synchronize transcode pool completion (#122279)
  fix(android): keep completed subagent activity visible for sixty seconds (#122089)
  fix(ui): humanize bare GitHub item links (#122285)
  refactor(qqbot): install plugin from Tencent package (#107295)
  chore: scope SQLite session lifecycle CI (#121917)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 2026
…nds (openclaw#122089)

* fix(android): retain terminal subagent activity locally

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

Labels

app: android App: android 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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