Repository navigation
Fix iOS artifact failure messaging - #9961
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change separates artifact loading failures from Mac reachability failures. It adds missing-session and load-failure states, updates artifact and terminal gallery UI handling, adds localized messages, and expands unit and UI-test coverage. ChangesArtifact failure handling
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant MobileChatEventSource
participant MobileChatArtifactFailureClassifier
participant ChatArtifactViewerModel
participant TerminalArtifactFilesSheet
MobileChatEventSource->>MobileChatArtifactFailureClassifier: classify artifact error
MobileChatArtifactFailureClassifier->>ChatArtifactViewerModel: return ChatArtifactError
MobileChatArtifactFailureClassifier->>TerminalArtifactFilesSheet: provide categorized failure
ChatArtifactViewerModel->>ChatArtifactViewerModel: render state and retry policy
TerminalArtifactFilesSheet->>TerminalArtifactFilesSheet: render title, icon, message, and retry policy
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (23 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@Packages/Shared/CmuxAgentChat/Sources/CmuxAgentChat/Artifacts/ChatArtifactError.swift`:
- Around line 17-20: Update the documentation comment for
ChatArtifactError.loadFailed to describe a general artifact operation failure,
including request, authorization, route, stream, and file-handle failures, when
control-transport closure has not been confirmed. Leave macUnreachable’s
transport-closure contract unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bf7d8e2d-b27a-43ee-b0d7-76fe5efb65aa
📒 Files selected for processing (20)
Packages/Shared/CmuxAgentChat/Sources/CmuxAgentChat/Artifacts/ChatArtifactError.swiftPackages/iOS/CmuxAgentChatUI/Sources/CmuxAgentChatUI/Artifacts/ChatArtifactActionVisibilityPolicy.swiftPackages/iOS/CmuxAgentChatUI/Sources/CmuxAgentChatUI/Artifacts/ChatArtifactContentCacheWriter.swiftPackages/iOS/CmuxAgentChatUI/Sources/CmuxAgentChatUI/Artifacts/ChatArtifactTemporaryFileWriter.swiftPackages/iOS/CmuxAgentChatUI/Sources/CmuxAgentChatUI/Artifacts/ChatArtifactViewerModel.swiftPackages/iOS/CmuxAgentChatUI/Sources/CmuxAgentChatUI/Artifacts/ChatArtifactViewerRouteView.swiftPackages/iOS/CmuxAgentChatUI/Sources/CmuxAgentChatUI/Artifacts/ChatArtifactViewerState.swiftPackages/iOS/CmuxAgentChatUI/Sources/CmuxAgentChatUI/Resources/Localizable.xcstringsPackages/iOS/CmuxAgentChatUI/Tests/CmuxAgentChatUITests/ChatArtifactViewerModelTests.swiftPackages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileArtifactChunkFetchLoop.swiftPackages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileChatArtifactFailureClassifier.swiftPackages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileChatEventSource.swiftPackages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/MobileArtifactChunkFetchLoopTests.swiftPackages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/MobileChatArtifactFailureClassifierTests.swiftPackages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/AgentChatDemoScreen.swiftPackages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/Resources/Localizable.xcstringsPackages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/TerminalArtifactFilesSheet+Content.swiftPackages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/TerminalArtifactFilesSheet.swiftPackages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/TerminalArtifactGalleryFailureTests.swiftios/cmuxUITests/cmuxUITests.swift
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 27203cb. Configure here.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ios/cmuxUITests/cmuxUITests.swift (1)
7412-7428: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winReplace the fixed run-loop delay with a completion-driven wait.
Line 7424 waits for a fixed 0.12 seconds after every swipe. This does not confirm that the transcript moved or that the target became hittable. On slow UI runs, the helper can retry before scrolling settles. On fast runs, it adds unnecessary delay.
Keep the overall deadline. After each swipe, wait for
element.isHittableor a real frame/scroll-position change with a deadline-bounded predicate.As per coding guidelines: “Tests must await real completion signals or deadline-bounded polls of real predicates rather than fixed-duration waits before assertions.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ios/cmuxUITests/cmuxUITests.swift` around lines 7412 - 7428, Replace the fixed RunLoop delay in scrollTranscript with a deadline-bounded poll of a real completion predicate after each table.swipeDown, such as element.isHittable or a changed frame/scroll position. Preserve the existing overall timeout and return behavior while ensuring retries occur only after scrolling has progressed or the target becomes hittable.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@ios/cmuxUITests/cmuxUITests.swift`:
- Around line 7412-7428: Replace the fixed RunLoop delay in scrollTranscript
with a deadline-bounded poll of a real completion predicate after each
table.swipeDown, such as element.isHittable or a changed frame/scroll position.
Preserve the existing overall timeout and return behavior while ensuring retries
occur only after scrolling has progressed or the target becomes hittable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 91cbe366-9070-4705-9b96-a785e354bb01
📒 Files selected for processing (1)
ios/cmuxUITests/cmuxUITests.swift
…r-message # Conflicts: # Packages/iOS/CmuxAgentChatUI/Sources/CmuxAgentChatUI/Artifacts/ChatArtifactLoader.swift # Packages/iOS/CmuxAgentChatUI/Sources/CmuxAgentChatUI/Artifacts/ChatArtifactViewerPageModel.swift
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |

Fixes #9899
Summary:
Tests:
ArtifactByteReaderTestsandChatArtifactChunkValidatorTests, 21 passedCmuxMobileShellclassifier, fetch-loop, and workspace fingerprint tests, 12 passedCmuxAgentChatUIpresentation, action, temporary-store, and viewer tests, 26 passedtestIrohArtifactDescriptorRejectsSpecialFilesWithoutBlockingpassed in https://github.com/manaflow-ai/cmux/actions/runs/31533688584testAgentChatMissingAttachmentFileReportsFileNotFoundpassed, 1 test with 0 failures, in https://github.com/manaflow-ai/cmux/actions/runs/31542041187The first commit is test-only and fails on the prior behavior. The implementation commits preserve typed failures end to end, scope storage classification, keep terminal failures visible, and isolate UI-test controls in the DEBUG-only preview entrypoint.