mirror of
https://github.com/stablyai/orca.git
synced 2026-10-17 00:03:08 +00:00
feat(native-chat): select runtime owner in caller view (U4)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -47,6 +47,7 @@ import {
|
||||
resolveNativeChatFileLink,
|
||||
resolveNativeChatFileLinkContext
|
||||
} from './native-chat-file-link'
|
||||
import { selectNativeChatRuntimeEnvironmentId } from './native-chat-runtime-owner'
|
||||
import type { CommentMarkdownLinkClickHandler } from '@/components/sidebar/CommentMarkdown'
|
||||
import { openDetectedFilePath } from '@/components/terminal-pane/terminal-file-open-routing'
|
||||
|
||||
@@ -155,7 +156,18 @@ function NativeChatResolvedView({
|
||||
onSwitchToTerminal?: () => void
|
||||
contextMenuActions?: Omit<NativeChatContextMenuActions, 'onPaste'>
|
||||
}): React.JSX.Element {
|
||||
const session = useNativeChatLiveSession({ paneKey, agent, sessionId, transcriptPath })
|
||||
// Primitive owner selection (no useShallow): routes the pane's read/subscribe to
|
||||
// the remote runtime host for a runtime-owned pane; null keeps the local path.
|
||||
const runtimeEnvironmentId = useAppStore((s) =>
|
||||
selectNativeChatRuntimeEnvironmentId(s, terminalTabId)
|
||||
)
|
||||
const session = useNativeChatLiveSession({
|
||||
paneKey,
|
||||
agent,
|
||||
sessionId,
|
||||
transcriptPath,
|
||||
runtimeEnvironmentId
|
||||
})
|
||||
// Live hook state for this pane, selected directly so the working indicator
|
||||
// flips the instant the agent reports 'working' — even when switching to chat
|
||||
// mid-turn before the transcript merge has caught up.
|
||||
|
||||
@@ -75,7 +75,10 @@ function createRuntimeNativeChatTransport(environmentId: string): NativeChatSess
|
||||
},
|
||||
{
|
||||
onResponse: (response) => {
|
||||
if (cancelled || response.ok === false) {
|
||||
if (cancelled) {
|
||||
return
|
||||
}
|
||||
if (response.ok === false) {
|
||||
return
|
||||
}
|
||||
const frame = response.result as {
|
||||
|
||||
Reference in New Issue
Block a user