Skip to content

feat(ios): tool rows say what each call did and open a timeline sheet - #206602

Merged
vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/ios-tool-rows
Nov 28, 2026
Merged

vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/ios-tool-rows

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

On iPhone, the tool calls in a chat are hard to read. Each call shows its tool name and raw argument in monospace ("Read synthetic.txt", "Knowledge status Original pending control"). A failed call turns red. Nested calls hide behind a "Tool details" disclosure, and tapping a row expands its raw output inline in the transcript. A finished run of commands is a list of separate rows. Repeated failures to the same chat repeat the same row, and a call to another chat can show that chat's raw session key. The Control UI already says what each call did in plain words and opens the details on demand.

User Impact

This is one of a series of pull requests that bring the iOS app's chat in line with the Control UI. With this change alone, a person on iPhone sees:

  • Each tool row says what the call did, in one quiet line. "Checking knowledge status" while it runs, "Checked knowledge status" when it's done, "Couldn't read synthetic.txt" when it failed. Each row has an icon for its kind of tool. A failure shows a small "Failed" on the right in secondary text, not in red. Shell commands read "Ran cat index.txt", with the command itself.
  • Repeats share a row. Failed calls to the same target collapse into one row with a count ("3 failed"). Each subagent launch keeps its own row ("Couldn’t launch subagent Reply images"). A message to another chat names the chat ("Send message to Composer fixes"), never its session key.
  • A finished stretch of work is one row named by what it did. For example "Read files" or "Ran commands", or "Read and changed files" when it mixes both. It opens a timeline sheet that lists each call, with its target under it.
  • Tapping a call opens its details in a sheet. The sheet shows the call's title and status, its Input (or Command, for a shell call) and Output, each with a copy button. A launched subagent's step has an Open chat button. A lone call opens straight to its details.
  • Only an OpenAI model's turn folds into "Worked". A Claude turn's notes between tool calls stay where they were said.

Some parts still look old or are missing until later pull requests in the series:

  • While a run is working, the working line doesn't yet name the current call, and there's no live sheet of the run's calls. The pull request for the working line adds both.
  • The activity pills above the composer, the round header buttons and the new sidebar come with their own pull requests.

Why This Change Was Made

A tool call matters for what it did, not for its tool name and arguments. So the row reads as a sentence, in the same words the Control UI uses (tool-operations.json), and the arguments and result move into a sheet that opens on demand. Grouping a finished stretch into one row keeps a long turn short. Grouping repeated failures by target keeps one broken target from filling the screen. ChatCompletedWorkSummary names a group by its kinds of work, ChatToolRepeats merges repeats and resolves chat names, and ChatToolGroupSheet draws the timeline and the detail page.

Evidence

  • Built the iOS app and both test bundles with the SwiftFormat and SwiftLint build phases. The native localization inventory matched (5,045 entries); git diff --check passed.

  • On iPhone 17 Pro (iOS 27.2), all 12 tool-row and related UI cases and all 6 selected iOS unit tests passed. The 104 selected OpenClawKit tests passed.

  • A separate existing transcript test failed at the rendered start of a long reply sent with the keyboard closed. The runs did not establish whether the patch caused it. The original assertion remains intact.

  • The visual review found no material difference from the approved tool-row and detail-sheet design. The paired screenshots below use the same synthetic chat on an iPhone 17 Pro simulator in light mode. Before: 0d8e62f26004. After: 64ed9d27efdb (same native inputs as the tested candidate). No live Gateway or physical device was used.

Screenshots

Clean comparison

Before After
Before: failed file read in red After: quiet failed read row

Annotated comparison

Before After
Before: red failure highlighted After: row opening details highlighted

Expanded tool result

Before After
Before: expanded tool output inline After: tool detail sheet with input and output

@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 27, 2026
@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR gives native tool calls descriptive labels, groups repeated failures, and opens call details in an iOS timeline sheet.

Example: A read call for synthetic.txt fails.

  • Before: A red “Read synthetic.txt” row expands its output inside the transcript.
  • After: A quiet “Couldn’t read synthetic.txt” row opens a sheet containing Input and Output.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful visual evidence supports the direction, but production data-flow defects and incomplete transport and upgrade validation prevent a pass.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 4 actionable review findings remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Tool-heavy native chats expose raw tool names and arguments, repeat failures, and become difficult to scan.
Reason: The maintainer-authored direction has clear value, and inspected simulator comparisons show a more readable transcript.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep this maintainer-authored draft open: the presentation improvement is worthwhile, but live-call visibility, result propagation, and file-diff inspection need repair.

Reviewed head: 8eef2f42a09022284d69574a307b9693fc2f4381

Before merge

  • Keep active tool rows visible until their replacement inspector exists (P2) - On iOS, a live run ending in tool-only rows reaches this return and discards the entire trailing stretch. ChatTranscriptPresentation supplies the live run as narratedRunID, while runGroups now receives no live tools. The remaining working indicator neither names the call nor opens its details in this PR. For example, starting a long-running exec before any narration leaves no tool row to inspect. Retain the tail rows until the replacement working-line inspector is present.
  • Preserve file diffs in the new call-detail sheet (P2) - An edit result commonly contains both summary text and details.diff. This early return selects the summary and drops the diff, and ChatToolStepDetail contains no replacement diff renderer. Because iOS now always opens this sheet, tapping a successful edit shows its arguments and success sentence instead of the rendered changes previously provided by ChatToolDiff. Reuse the existing diff resolution and rendering alongside the result summary.
  • Populate live receipts before reading them in tool details (P2) - The new live-item adapter reads call.result, but no production path assigns that field. handleAgentToolEvent still handles a result event by marking an entry complete or deleting it, without retaining result or isError. When a completed activity has returned “Checked north.txt” and saved history has not arrived, its new sheet therefore has no Output; receipt-dependent titles and exit information are also unavailable. Capture the incoming receipt in the existing tool-event owner and exercise that event path rather than assigning live.result directly in the wording tests.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.
  • Explain or restore the original intent of Tool-result diff inspection - 3a0d6b3: feat(chat-ui): inline diffs for edit and write tool rows #111039 added colored diffs because summary-only output prevented mobile users from seeing actual file changes.

Findings

  • [P2] Keep active tool rows visible until their replacement inspector exists — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatCompletedWork.swift:145-148
  • [P2] Preserve file diffs in the new call-detail sheet — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatToolGroupSheet.swift:384-389
  • [P2] Populate live receipts before reading them in tool details — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatToolActivityViews.swift:87-92

Provenance

Agent review details

How this fits together

The shared Apple chat UI projects Gateway history and live events into transcript rows; iOS adds grouping and sheets while macOS retains inline expansion.

flowchart TD
  A[Gateway history and events] --> B[Message decoder and view model]
  B --> C[Transcript presentation]
  C --> D[Tool labels and grouping]
  D --> E[iOS transcript]
  E --> F[Timeline and call details]
  D --> G[macOS inline details]
Loading

Technical review

Best possible solution:

Keep the descriptive rows and sheets while preserving visible active work, recording live receipts at ingestion, and reusing existing diff inspection.

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

The introduced failures are traceable through production source: active tail projection drops calls, incoming result events never populate the new result field, and sheet output omits diffs whenever summary text exists; no target code was executed.

Is this the best way to solve the issue?

The existing transcript and tool-presentation owners are appropriate, but the cutover must preserve their inspection contracts before replacing inline details.

Full review comments:

  • [P2] Keep active tool rows visible until their replacement inspector exists — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatCompletedWork.swift:145-148
    On iOS, a live run ending in tool-only rows reaches this return and discards the entire trailing stretch. ChatTranscriptPresentation supplies the live run as narratedRunID, while runGroups now receives no live tools. The remaining working indicator neither names the call nor opens its details in this PR. For example, starting a long-running exec before any narration leaves no tool row to inspect. Retain the tail rows until the replacement working-line inspector is present.
    Confidence: 0.99
  • [P2] Preserve file diffs in the new call-detail sheet — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatToolGroupSheet.swift:384-389
    An edit result commonly contains both summary text and details.diff. This early return selects the summary and drops the diff, and ChatToolStepDetail contains no replacement diff renderer. Because iOS now always opens this sheet, tapping a successful edit shows its arguments and success sentence instead of the rendered changes previously provided by ChatToolDiff. Reuse the existing diff resolution and rendering alongside the result summary.
    Confidence: 0.99
  • [P2] Populate live receipts before reading them in tool details — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatToolActivityViews.swift:87-92
    The new live-item adapter reads call.result, but no production path assigns that field. handleAgentToolEvent still handles a result event by marking an entry complete or deleting it, without retaining result or isError. When a completed activity has returned “Checked north.txt” and saved history has not arrived, its new sheet therefore has no Output; receipt-dependent titles and exit information are also unavailable. Capture the incoming receipt in the existing tool-event owner and exercise that event path rather than assigning live.result directly in the wording tests.
    Confidence: 0.98
  • [P3] Leave generated locale catalogs to the locale refresh workflow — apps/ios/Resources/Localizable.xcstrings:49
    apps/ios/AGENTS.md explicitly directs string changes to commit only apps/.i18n/native-source.json and leaves Localizable.xcstrings regeneration to the locale refresh workflow. This PR also changes both the iOS and macOS generated catalogs. Keep the inventory change and remove those catalog edits.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9e9b55f127c8.

Provenance checked

  • Active tool-row visibility changes intended behavior with a stated reason (c9285dd: improve(ios): rebuild the chat transcript around the web reading model #200592 grouped adjacent tool activity while keeping it inspectable; this PR transfers the active tail to a working-line owner that its body defers to a later change.)
  • Completed-work folding changes intended behavior with a stated reason (c9285dd: Completed turns previously folded their work; this PR explicitly restricts folding to recorded OpenAI turns so other models’ intervening notes retain their positions.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • swift test --package-path apps/shared/OpenClawKit --filter 'ChatCompletedWorkTests|ChatToolFailureTests|ChatToolOperationCopyTests|ChatSessionsCodingTests|ChatToolDiffTests'
  • scripts/lint-swift.sh ios
  • Run the focused iOS tool-sheet UI cases through the repository’s iOS E2E workflow.
  • Verify active-call visibility and receipt-before-history output through Gateway-backed iOS chat.
  • Verify latest-stable cached history and settings survive the upgrade.

What I checked:

PR surface

Source +2178, Tests +1294. Total +3472 across 42 files. Added test files: 6.

View PR surface stats
Area Files Added Removed Net
Source 26 2704 526 +2178
Tests 16 1397 103 +1294
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 42 4101 629 +3472

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 27, 2026, 6:14 AM ET / 11:14 UTC.

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review November 27, 2026 23:18
@vyctorbrzezowski
vyctorbrzezowski changed the base branch from brzezowski/ios-model-accounts to brzezowski/ios-model-accounts-stack-base November 28, 2026 03:56
@vyctorbrzezowski
vyctorbrzezowski changed the base branch from brzezowski/ios-model-accounts-stack-base to main November 28, 2026 04:34
@openclaw-barnacle openclaw-barnacle Bot removed the app: macos App: macos label Nov 28, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit 5b4c540 into main Nov 28, 2026
48 of 52 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/ios-tool-rows branch November 28, 2026 04:35
obviyus added a commit that referenced this pull request Nov 28, 2026
…st (#207259)

## Problem
`security-fast` fails on every PR based on current `main`:
```
Protocol event coverage check failed:
  - [ios] allowlist entry "session.tool" is now handled; remove it from scripts/protocol-event-coverage.allowlist.json.
```
#206602 (`5b4c5401`) made the iOS chat surface handle `session.tool`, but the allowlist still says iOS does not handle it. On `main`, the push CI does not reach this check, so `main` looks green. PR runs (for example, #207238) fail.

## Solution
Remove the iOS `session.tool` allowlist entry. The Android entry stays: Android still does not handle the event.

## Evidence
- `node scripts/check-protocol-event-coverage.mts` on `origin/main` `9c9e3c74`: the failure above.
- The same check on this branch: `Protocol event coverage OK: 75 gateway events; ios handles 29, allowlists 46; android handles 26, allowlists 49.`
- Local ClawSweeper on `b8041413`: patch is correct, no findings.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…st (openclaw#207259)

## Problem
`security-fast` fails on every PR based on current `main`:
```
Protocol event coverage check failed:
  - [ios] allowlist entry "session.tool" is now handled; remove it from scripts/protocol-event-coverage.allowlist.json.
```
openclaw#206602 (`83d7a819`) made the iOS chat surface handle `session.tool`, but the allowlist still says iOS does not handle it. On `main`, the push CI does not reach this check, so `main` looks green. PR runs (for example, openclaw#207238) fail.

## Solution
Remove the iOS `session.tool` allowlist entry. The Android entry stays: Android still does not handle the event.

## Evidence
- `node scripts/check-protocol-event-coverage.mts` on `origin/main` `704cd214`: the failure above.
- The same check on this branch: `Protocol event coverage OK: 75 gateway events; ios handles 29, allowlists 46; android handles 26, allowlists 49.`
- Local ClawSweeper on `b8041413`: patch is correct, no findings.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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