Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions docs/reference/agent-browser-focus-isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ A `<webview>` guest is an inner WebContents in the window's frame tree. Chromium
that tree's focus, not by which debugger the command arrived on. A hidden-window probe (host
`<textarea>` focused, guest page logging its own events) measured:

| Input | Where it lands | Host focus |
| --- | --- | --- |
| CDP `Input.dispatchKeyEvent` / `Input.insertText` on the guest's main session | **host textarea** | kept |
| same, with `Emulation.setFocusEmulationEnabled` | **host textarea** | kept |
| `webContents.sendInputEvent` key / `char` on the guest | guest | kept |
| CDP key / `insertText` on a cross-site iframe's own (auto-attached) session | that iframe | kept |
| `webContents.insertText` with focus in a cross-site iframe | **guest renderer crashed** | — |
| `sendInputEvent` key with focus in a same-site iframe | that iframe | kept |
| any mouse press (CDP mouse, touch, tap gesture, `sendInputEvent`) | guest | **moved to the webview** |
| `inert` / `tabindex=-1` on the `<webview>` during the press | guest | **moved** |
| press + synchronous host restore on the `<webview>` `focus` event | guest | restored, next user key lands in the host |
| the restore above with focus emulation enabled first | guest | **not restored** (the host `focus` event never fires) |
| Input | Where it lands | Host focus |
| ----------------------------------------------------------------------------- | -------------------------- | ----------------------------------------------------- |
| CDP `Input.dispatchKeyEvent` / `Input.insertText` on the guest's main session | **host textarea** | kept |
| same, with `Emulation.setFocusEmulationEnabled` | **host textarea** | kept |
| `webContents.sendInputEvent` key / `char` on the guest | guest | kept |
| CDP key / `insertText` on a cross-site iframe's own (auto-attached) session | that iframe | kept |
| `webContents.insertText` with focus in a cross-site iframe | **guest renderer crashed** | — |
| `sendInputEvent` key with focus in a same-site iframe | that iframe | kept |
| any mouse press (CDP mouse, touch, tap gesture, `sendInputEvent`) | guest | **moved to the webview** |
| `inert` / `tabindex=-1` on the `<webview>` during the press | guest | **moved** |
| press + synchronous host restore on the `<webview>` `focus` event | guest | restored, next user key lands in the host |
| the restore above with focus emulation enabled first | guest | **not restored** (the host `focus` event never fires) |

With focus emulation on, the press still moves focus and the restore on the `focus` event never
runs, but restoring when the press ends works and the page sees no blur, so a menu or picker the
Expand Down Expand Up @@ -95,12 +95,12 @@ two gaps.

## Tracker

| Step | PR | State |
| --- | --- | --- |
| CDP focus side effects removed (`bringToFront`, `activateTarget`) + this doc | stack 1/3 | in review |
| Keys and text delivered to the guest directly | stack 2/3 | in review |
| Presses and CDP-only input borrow focus and give it back; focus emulation | stack 3/3 | in review |
| Regression spec: user typing in a terminal while an agent clicks, types and presses keys | stack 2/3, 3/3 | in review |
| Visible-window spec (`@headful`, isolated display only): native focus stays on Orca's window | stack 3/3 | in review |
| Main-session keys and text for a focused cross-site iframe go to its own session, no focus borrow | follow-up PR | in review |
| Agent presses are refused while the user's IME composition is open (#28700) | follow-up PR | in review |
| Step | PR | State |
| ------------------------------------------------------------------------------------------------- | -------------- | --------- |
| CDP focus side effects removed (`bringToFront`, `activateTarget`) + this doc | stack 1/3 | in review |
| Keys and text delivered to the guest directly | stack 2/3 | in review |
| Presses and CDP-only input borrow focus and give it back; focus emulation | stack 3/3 | in review |
| Regression spec: user typing in a terminal while an agent clicks, types and presses keys | stack 2/3, 3/3 | in review |
| Visible-window spec (`@headful`, isolated display only): native focus stays on Orca's window | stack 3/3 | in review |
| Main-session keys and text for a focused cross-site iframe go to its own session, no focus borrow | follow-up PR | in review |
| Agent presses are refused while the user's IME composition is open (#28700) | follow-up PR | in review |
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '../../../src/shared/protocol-version'
import { AGENT_SESSION_SEND_OPTIONS_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session-create-capabilities'
import { AGENT_SESSION_PERMISSION_MODES_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session-permission-modes-capability'
import { AGENT_SESSION_PHONE_ATTACHMENTS_RUNTIME_CAPABILITY } from '../../../src/shared/runtime-capability-constants'
import { AGENT_SESSION_PHONE_ATTACHMENTS_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session-runtime-capabilities'

/** Structured-session features the connected host advertised; null until the status probe answers. */
export type StructuredAgentSessionHostSupport = {
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/tasks/mobile-tasks-capability.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Runtime capability the desktop advertises when it supports the mobile Tasks RPC
// surface (github/gitlab/linear work items + repo.searchRefs). Older paired
// desktops omit it, so mobile must degrade to blank/new-branch sources only.
// Mirrors the 'mobile.tasks.v1' entry in src/shared/protocol-version.ts.
// Mirrors the 'mobile.tasks.v1' entry in src/shared/mobile-runtime-capabilities.ts.
export const MOBILE_TASKS_CAPABILITY = 'mobile.tasks.v1'
2 changes: 1 addition & 1 deletion src/cli/handlers/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
import { getSshTargetIdForExecutionHost, type ExecutionHostId } from '../../shared/execution-host'
import type { RepoKind } from '../../shared/repo-types'
import type { RuntimeStatus } from '../../shared/runtime-types'
import { PROJECT_HOST_SETUP_HOST_TARGET_RUNTIME_CAPABILITY } from '../../shared/runtime-capability-constants'
import { PROJECT_HOST_SETUP_HOST_TARGET_RUNTIME_CAPABILITY } from '../../shared/worktree-runtime-capabilities'
import type { CommandHandler, HandlerContext } from '../dispatch'
import {
formatProjectHostSetupCreateResult,
Expand Down
2 changes: 1 addition & 1 deletion src/cli/index-project-setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ vi.mock('child_process', async () => {

import { main } from './index'
import { okFixture, queueFixtures } from './test-fixtures'
import { PROJECT_HOST_SETUP_HOST_TARGET_RUNTIME_CAPABILITY } from '../shared/runtime-capability-constants'
import { PROJECT_HOST_SETUP_HOST_TARGET_RUNTIME_CAPABILITY } from '../shared/worktree-runtime-capabilities'
import { pairRuntimeEnvironment, useWorktreeAwarenessEnvironment } from './index-test-harness'

const ORCA_PROJECT = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Split out of protocol-version.ts, which lists it in RUNTIME_CAPABILITIES. Import it from here.
// Split out of protocol-version.ts; listed in AGENT_SESSION_RUNTIME_CAPABILITIES. Import it from here.

// Why: a client may call `agentSession.continueInterrupted` (Continue on a reply an Orca stop cut
// off) only on a host that has it; an older host also writes no row naming that stop, so a client
Expand Down
2 changes: 1 addition & 1 deletion src/shared/agent-session-permission-modes-capability.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Split out of protocol-version.ts, which lists it in RUNTIME_CAPABILITIES. Import it from here.
// Split out of protocol-version.ts; listed in AGENT_SESSION_RUNTIME_CAPABILITIES. Import it from here.

// Why: a host predating per-chat modes ignores them and runs its Agent Permissions, so a client
// must know before it lets a chat there start or take a turn. 1.4.225–1.4.226 apply modes without
Expand Down
Loading
Loading