fix: wrap orchestrator messages view with ToolCallSheetProvider

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 <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2025-12-21 18:36:11 +00:00
co-authored by Claude Opus 4.5
parent 4927e2b04e
commit 253af9988c
2 changed files with 6 additions and 5 deletions
@@ -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<ScrollView, OrchestratorMessa
function OrchestratorMessagesView({ messages, currentAssistantMessage, onArtifactClick }, ref) {
return (
<>
<ToolCallSheetProvider>
<ScrollView
ref={ref}
style={styles.scrollView}
@@ -101,8 +102,7 @@ export const OrchestratorMessagesView = forwardRef<ScrollView, OrchestratorMessa
/>
)}
</ScrollView>
</>
</ToolCallSheetProvider>
);
}
);
+2 -1
View File
@@ -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.