From 253af9988cb8588bbb8a7e535470637af562fa01 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sun, 21 Dec 2025 18:36:11 +0000 Subject: [PATCH] fix: wrap orchestrator messages view with ToolCallSheetProvider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ToolCall component requires the ToolCallSheetProvider context to function properly. The orchestrator messages view was rendering ToolCall components without this provider, which would cause a crash when tapping tool call badges. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../app/src/components/orchestrator-messages-view.tsx | 8 ++++---- plan.md | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/app/src/components/orchestrator-messages-view.tsx b/packages/app/src/components/orchestrator-messages-view.tsx index d6385525e..711794134 100644 --- a/packages/app/src/components/orchestrator-messages-view.tsx +++ b/packages/app/src/components/orchestrator-messages-view.tsx @@ -1,4 +1,4 @@ -import { View, ScrollView } from "react-native"; +import { ScrollView } from "react-native"; import { StyleSheet } from "react-native-unistyles"; import { forwardRef } from "react"; import { @@ -7,6 +7,7 @@ import { ActivityLog, ToolCall, } from "@/components/message"; +import { ToolCallSheetProvider } from "@/components/tool-call-sheet"; import type { MessageEntry } from "@/contexts/session-context"; interface OrchestratorMessagesViewProps { @@ -19,7 +20,7 @@ export const OrchestratorMessagesView = forwardRef + )} - - + ); } ); diff --git a/plan.md b/plan.md index 342e17ac4..41bc95e38 100644 --- a/plan.md +++ b/plan.md @@ -621,11 +621,12 @@ interface ToolCallSheetData { - Add another `agent=codex **Review**` task after fix tasks to verify fixes. - **Done (2025-12-21 18:33)**: Found a crash path: `ToolCall` now requires `ToolCallSheetProvider`, but `orchestrator-messages-view.tsx` renders `ToolCall` without the provider, so orchestrator tool calls will throw `useToolCallSheet must be used within a ToolCallSheetProvider`. Added fix/test/re-review tasks. -- [ ] **Fix**: Wrap orchestrator tool calls with ToolCallSheetProvider. +- [x] **Fix**: Wrap orchestrator tool calls with ToolCallSheetProvider. - `ToolCall` throws when used without `ToolCallSheetProvider`; orchestrator view currently renders it bare (`orchestrator-messages-view.tsx:18-106`). - Wrap the orchestrator messages view (or a parent) with `ToolCallSheetProvider` so tool call badges open the bottom sheet instead of crashing. - Keep provider scope narrow to avoid unintended rerenders. + - **Done (2025-12-21 18:45)**: Wrapped the `OrchestratorMessagesView` content with `ToolCallSheetProvider` in `orchestrator-messages-view.tsx`. Removed unused `View` import. Typecheck passes. - [ ] **Test**: Verify orchestrator tool call sheet works.