Repository navigation
feat(ios): haptic feedback for chat send, completion, and failure - #100416
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0bd4d61c24
ℹ️ 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".
| let hapticEvent: OpenClawChatHaptics.Event? = switch chat.state { | ||
| case "final": .runCompleted | ||
| case "error": .runFailed | ||
| default: nil |
There was a problem hiding this comment.
Map aborted chat events to failed haptics
When the gateway sends a terminal chat event with state == "aborted" for the pending run, this switch falls through to nil, so clearPendingRun clears the run without any haptic feedback. Other failure paths added in this commit already treat aborted durable rows and agent lifecycle aborts as .runFailed, so user/coordinator cancellation delivered through the chat-event path silently misses the new failure feedback.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 4:30 PM ET / 20:30 UTC. Summary PR surface: Other +220. Total +220 across 3 files. Reproducibility: yes. Source inspection gives a high-confidence reproduction path: emit a pending-run Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Keep the single haptic choke point, but map both live and persisted abort paths to failure haptics with tests before maintainers decide whether to land the default-on iOS haptics feature. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence reproduction path: emit a pending-run Is this the best way to solve the issue? No. The single pending-run haptic choke point is the right shape, but this version is not the best fix until both abort classifiers are repaired and covered. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 13e59025783a. Label changesLabel justifications:
Evidence reviewedPR surface: Other +220. Total +220 across 3 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (2 earlier review cycles)
|
0bd4d61 to
1909979
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1909979203
ℹ️ 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".
| let stopReason = message.stopReason?.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() | ||
| return stopReason == "error" || stopReason == "aborted" ? .runFailed : .runCompleted |
There was a problem hiding this comment.
Treat persisted abort markers as failed haptics
When pending state is cleared from a history refresh after a cancelled run with partial output, this classifier only checks stopReason, but the gateway persists those abort partials as stopReason: "stop" plus openclawAbort.aborted (src/gateway/server-methods/chat-transcript-inject.ts:99-113), and OpenClawChatMessage currently decodes only stopReason/errorMessage (apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatModels.swift:201-214). Fresh evidence beyond the existing chat-event comment is this persisted abort path: clearPendingRunIfAssistantMessagePresent can therefore fire .runCompleted for a cancelled durable row instead of the failure haptic.
Useful? React with 👍 / 👎.
1909979 to
9a08875
Compare
9a08875 to
ebd6a3a
Compare
Part of #100415
What Problem This Solves
Chat lifecycle moments on iOS — sending a message, a run completing, a run failing — have no tactile feedback, making the app feel less native than platform peers.
Why This Change Was Made
Adds
OpenClawChatHapticsto the shared chat package: a small injectable-performer type (UIKit feedback generators on iOS behind platform conditionals; macOS is a deliberate no-op since NSHapticFeedbackManager only fires from gesture contexts). Wiring goes through a single choke point — every pending-run clear site passes its haptic event throughclearPendingRun(hapticEvent:)— so completion/failure feedback fires exactly once even under duplicate terminal-event delivery, and durable assistant rows are classified by stop reason (error/aborted → failure). Send feedback fires on accepted sends only.User Impact
iOS users feel a light tap when a message sends, a success tap when the assistant finishes, and an error buzz when a run fails or times out. No settings surface added in v1; macOS behavior unchanged.
Evidence
cd apps/shared/OpenClawKit && swift test --filter "ChatHapticsTests|ChatViewModelTests"— 108 tests, 2 suites, all pass (new suite covers send, duplicate-completion single-fire, durable error/aborted ordering).Known deferral: the offline-outbox enqueue haptic waits for the outbox PR (#100331) to land, since that code is not on main yet.