Repository navigation
refactor(tasks): simplify subagent activity tracking - #122198
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 3:05 PM ET / 19:05 UTC. ClawSweeper reviewWhat this changesThe PR centralizes file-mutation argument parsing and line counting for live agent progress and task activity, removes unused Apple activity fields, and makes Android terminal-row expiry use the event-time clock. Merge readinessKeep open for explicit maintainer handling: current main still has the duplicated parsing ownership, and the refactor is coherent with no discrete patch defect found; the protected maintainer label and unavailable direct Codex contract checkout prevent a merge-ready verdict here. Priority: P3 Review scores
Verification
How this fits togetherModel and Codex tool events feed live edit counters and the task registry’s ephemeral subagent-activity overlay, which Gateway clients render in web and native chat. The PR moves equivalent argument-shape handling into one shared agent helper while retaining separate streaming and completed-tool counting semantics. flowchart LR
A[Model and Codex tool events] --> B[Live edit progress counter]
A --> C[File-mutation argument helper]
C --> D[Task activity fold]
B --> E[Agent event stream]
E --> D
D --> F[Gateway task events]
F --> G[Web and native chat activity rows]
Decision needed
Why: The changed helper preserves a dependency-backed Codex shape, and repository policy requires the acting reviewer to inspect that sibling source before a merge-ready verdict. Before merge
Agent review detailsSecurityNone. PR surfaceSource -5, Other -8. Total -13 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one shared file-mutation argument owner only after directly verifying the Codex file-change contract, retaining the separate streaming-newline and completed-logical-line semantics. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR reports duplicated internal ownership rather than a user-facing failure; source inspection shows the current duplicated parser boundary. Is this the best way to solve the issue? Yes, conditionally: one shared helper is the cleaner owner boundary than parallel shape readers, provided the direct Codex contract check confirms the preserved normalization shape. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d76f71cee7d2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* refactor(tasks): simplify subagent activity tracking * fix(android): single-source subagent activity expiry clock * chore(i18n): refresh native source baseline
Related: #121528, #121549, #121840, #121815, #121813, #121899
What Problem This Solves
The subagent-activity series left file-mutation argument decoding and line accounting split between the live agent stream and the task-registry fold. The same write/edit/patch/Codex shapes therefore had two owners, while the shared Apple activity model retained three fields no state transition or renderer consumed. Android terminal activity expiry also mixed a captured event clock with a later wall-clock read inside its coroutine, allowing the deterministic 59,999ms retention boundary to expire early.
This is the maintainer-requested post-series consolidation for #121528, #121549, #121840, #121815, #121813, and #121899.
Why This Change Was Made
One concept-named file-mutation argument owner now handles write content, edit pairs, apply-patch text, and normalized Codex
changes[].statinput. It exposes two deliberately separate counting contracts: streaming counts only completed newline delimiters over partial JSON, while the task fold counts complete logical lines. This preserves the existing monotonic streaming and completed-argument semantics without parallel shape readers.The Apple activity state also drops unused
startedAt,endedAt, andchildSessionKeystorage. The web terminal-observation map/timer and the Apple event-vs-snapshot source distinction remain unchanged after review: both preserve first-observation retention semantics and are not redundant.Android now derives both the terminal expiry deadline and coroutine delay from the event's single captured clock value. The existing 59,999ms/60,000ms boundary regression remains unchanged. The native source inventory was refreshed only for the resulting one-line source shift.
The Codex file-change contract was checked directly against
openai/codexapp-server protocol sources:codex-rs/app-server-protocol/src/protocol/v2/item.rsandcodex-rs/app-server-protocol/src/protocol/item_builders.rs.Production LOC: +167/-180 (net -13) | Tests: +0/-0 | Generated native inventory: +2/-2
User Impact
No API, broadcast, ordering, or presentation changes. Android terminal activity now reliably retains for the intended full 60 seconds instead of occasionally expiring a few milliseconds early under coroutine scheduling delay.
AI-assisted: yes. The change was maintainer-directed, source-audited, and verified with the repository's Codex autoreview workflow.
Evidence
node scripts/run-vitest.mjs src/agents/embedded-agent-live-edit-diff.test.ts src/tasks/task-registry.test.ts src/gateway/server-methods/tasks.test.tsswift test --package-path apps/shared/OpenClawKitnode scripts/check-changed.mjsnode --import tsx scripts/native-app-i18n.ts verifyChatController.ktline numbers by +1 with no string changes..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --stream-engine-output31523454254dbd065c8b5cccd8fa710264ef3a2aa449e161ff9, includingandroid-test-play,native-i18n, macOS/iOS, and Periphery lanes; no rerun required.git diff --check origin/main...HEAD