mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
fix(antigravity): bind native hook screen evidence to runtime terminal
This commit is contained in:
@@ -124,3 +124,23 @@ describe('host-owned Antigravity screen permission', () => {
|
||||
expect(baseline(server).observation).toEqual(waiting.observation)
|
||||
})
|
||||
})
|
||||
|
||||
it('accepts the runtime-attested binding absent from a native hook row', () => {
|
||||
const server = new AgentHookServer()
|
||||
server.ingestTerminalStatus({
|
||||
paneKey: PANE,
|
||||
payload: { state: 'working', agentType: 'antigravity', prompt: 'print marker' }
|
||||
})
|
||||
const row = baseline(server)
|
||||
expect(row.terminalHandle).toBeUndefined()
|
||||
expect(server.ingestAntigravityScreenPermission({ baseline: row, command: 'echo OK' })).toBe(
|
||||
false
|
||||
)
|
||||
expect(
|
||||
server.ingestAntigravityScreenPermission({
|
||||
baseline: { ...row, terminalHandle: 'term-runtime' },
|
||||
command: 'echo OK'
|
||||
})
|
||||
).toBe(true)
|
||||
expect(baseline(server)).toMatchObject({ state: 'waiting', terminalHandle: 'term-runtime' })
|
||||
})
|
||||
|
||||
@@ -24,7 +24,8 @@ export abstract class AgentHookServerIngestAntigravityScreen extends AgentHookSe
|
||||
previous.connectionId ||
|
||||
previous.payload.agentType !== 'antigravity' ||
|
||||
!baseline.terminalHandle ||
|
||||
previous.terminalHandle !== baseline.terminalHandle ||
|
||||
(previous.terminalHandle !== undefined &&
|
||||
previous.terminalHandle !== baseline.terminalHandle) ||
|
||||
!expected ||
|
||||
!current ||
|
||||
current.authorityId !== expected.authorityId ||
|
||||
@@ -62,7 +63,7 @@ export abstract class AgentHookServerIngestAntigravityScreen extends AgentHookSe
|
||||
tabId: previous.tabId,
|
||||
worktreeId: previous.worktreeId,
|
||||
connectionId: previous.connectionId,
|
||||
terminalHandle: previous.terminalHandle,
|
||||
terminalHandle: baseline.terminalHandle,
|
||||
providerSession: previous.providerSession,
|
||||
payload: {
|
||||
...previous.payload,
|
||||
|
||||
@@ -60,7 +60,6 @@ it('publishes the captured permission and cancellation to the canonical hook sto
|
||||
}
|
||||
wiring.statusStore.ingestTerminalStatus({
|
||||
paneKey,
|
||||
terminalHandle: handle,
|
||||
payload: {
|
||||
state: 'working',
|
||||
agentType: 'antigravity',
|
||||
|
||||
@@ -23,11 +23,13 @@ export class OrcaRuntimeWithVisibleSnapshotPreview extends OrcaRuntimeWithCaptur
|
||||
if (!pty?.connected || pty.connectionId || !pty.paneKey) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
this.getAgentProviderSessionRowsForPaneFn?.(pty.paneKey)?.find(
|
||||
(row) => row.providerSessionOnly !== true && row.agentType === 'antigravity'
|
||||
) ?? null
|
||||
const terminalHandle = this.getAgentStatusTerminalHandleForPaneKey(pty.paneKey)
|
||||
const row = this.getAgentProviderSessionRowsForPaneFn?.(pty.paneKey)?.find(
|
||||
(candidate) =>
|
||||
candidate.providerSessionOnly !== true && candidate.agentType === 'antigravity'
|
||||
)
|
||||
// Native hooks identify the pane; the runtime owns its live terminal binding.
|
||||
return row && terminalHandle ? { ...row, terminalHandle } : null
|
||||
},
|
||||
readScreen: (ptyId) => this.readVisibleTerminalState(ptyId),
|
||||
isCurrent: (ptyId, screen) =>
|
||||
|
||||
Reference in New Issue
Block a user