-
[OPIK-5596] [FE] Unify pairing codes between agent sandbox and Ollie sidebar (#6143)
发布于
2026-04-09 14:02:38 +00:00 - [OPIK-5596] [FE] Unify pairing codes between agent sandbox and Ollie sidebar
Add bridge events (runner:state-changed, runner:request-pair) so the Opik
FE owns pairing/connection state and Ollie receives it via the iframe bridge
instead of calling the pairing endpoint independently.- Add RunnerConnectionStatus enum unifying backend and client-only states
- Add RunnerBridgeState type and bridge events to assistant-sidebar protocol
- Add usePairingState hook centralizing pair code + connection + expiry logic
- Add useRunnerBridgeSync hook broadcasting pairing state to bridge listeners
- Wire bridge sync into AssistantSidebar with lastRunnerState replay on subscribe
- Refactor AgentRunnerContent to consume usePairingState
- Refactor AgentRunnerEmptyState to receive expiresAt and show inline spinner
- Update useSandboxConnectionStatus to fall back to most recent runner
- Add usePairingState unit tests
- [OPIK-5596] [FE] Address PR review comments
- Add projectId guard in handleRequestPair to prevent empty project_id POST
- Replace pairing.runner! non-null assertion with pairing.runner && guard
下载附件