Skip to content

fix(remote): traer seis arreglos de upstream para terminal remota, y desbloquear el build de Android - #368

Merged
fabolivark merged 8 commits into
mainfrom
feat/upstream-remote-fixes
Sep 9, 2026
Merged

fabolivark merged 8 commits into
mainfrom
feat/upstream-remote-fixes

Conversation

@fabolivark

@fabolivark fabolivark commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 +576 −3 +573
Prod 8 +398 −9 +389

Seis cambios traídos de stablyai/orca tras revisar sus PRs abiertos, más un desbloqueo del build de Android. Todo verificado contra nuestro árbol antes de aplicarlo, no solo leído.

Contexto que enmarca la tanda: el fork no trae un commit de upstream desde el 2026-08-15 (merge-base 8b04e060fa, ~969 commits de divergencia). Ningún PR abierto puede estar "ya traído", y varios de los grandes asumen refactors posteriores a esa fecha — por eso esta tanda es solo lo que aplica de verdad.

Lo que entra

upstream Qué arregla Cómo entró
#19661 un body/html transitorio en el foco al despachar cancelaba el paste ("Paste cancelled: terminal focus changed") cherry-pick limpio
#19662 la rama local del RPC del runtime descartaba timeoutMs y signal, así que una pantalla que pedía abandonar a los 15 s esperaba para siempre. La rama remota ya los honraba cherry-pick limpio
#19642 un header de grupo de proyecto se trataba como header genérico: los grupos locales se escapaban arriba de su host y se duplicaban bajo cada host remoto conflicto de import resuelto (ver abajo)
#19593 al reatachar se tomaba la secuencia del snapshot post-overlay en vez de la de attach, así que la salida del overlay se contaba dos veces y el cliente reportaba huecos de stream inexistentes port
#19716 (×3) OrcaUnicodeProvider es la única autoridad de ancho de celda para el pane vivo y para el mirror headless del daemon; le faltaba la tabla de presentación emoji, así que los dos medían distinto y el redraw tras un reattach quedaba corrido 3 commits, uno con conflicto

Las dos adaptaciones, y por qué

#19642 — upstream importa getFolderWorkspaceHostId de ./folder-workspace-host-id; en nuestro árbol esa función está definida localmente en el mismo archivo (host-section-rows.ts:70), así que importarla colisiona. Solo hacía falta el otro import, getProjectGroupExecutionHostIdForRows, que sí existe en nuestro árbol (worktree-list/listing/host-filtering.ts:60).

#19593 — upstream lo arregla en daemon-pty-spawn-result.ts; nuestro equivalente tras la divergencia es daemon-pty-adapter.ts:894, con el mismo código. El diff de producción es idéntico al de upstream. Nuestro árbol tenía además un test que afirmaba el comportamiento viejo (uses the post-drain sequence for output produced during warm reattach), y se porta su actualización tal cual — +15 −3, el mismo diff que upstream.

Android

El build falló con Google Api Error: Invalid request - Version code 21 has already been used. El valor está hardcodeado en mobile/app.json:78, así que cada re-dispatch choca hasta subirlo a mano — iOS tiene bump_patch_version en su workflow, Android no tiene equivalente. Esto lo sube 21 → 22 para desbloquear; derivarlo o auto-incrementarlo queda pendiente, porque hoy cada release móvil necesita este commit manual y es fácil olvidarlo.

Lo que NO entra, a propósito

  • #19628 (techo y reclamo de tabs offscreen en serve) — nuestro offscreen-browser-backend.ts no tiene ni el options bag (getAgentBrowserBridge) del que depende el PR. Es un port de verdad.
  • #19723 (config de Codex que el mirror borra en el host) — 5 archivos, y nuestros tres archivos de Codex divergen de upstream en ~88 líneas.

Los dos son valiosos y van en una tanda aparte; mezclarlos acá arriesgaba el lote entero.

Tests

Verdes en todo lo tocado: 1629 del daemon, 2219 del sidebar, 889 de terminal-pane + runtime, 33 de emoji/unicode. Gates de max-lines y brand-drift OK, typecheck limpio.

tan7vir and others added 8 commits September 9, 2026 09:46
… of cancelling on a focus blip

Problem: pasting into a terminal right after switching back to Orca (e.g.
Cmd+Tab to another app to copy, then Cmd+Tab back and immediately Cmd+V)
could show "Paste cancelled: terminal focus changed before paste started."
even though the paste target was correct. When the window regains OS
focus, regular-terminal-focus-ownership.ts's resyncTerminalFocusForWindowFocus
defers reclaiming the xterm helper textarea's DOM focus to the next
animation frame (intentionally, so a click elsewhere during reactivation
isn't yanked back). A Cmd+V fired via the app-menu paste path in that
window can capture document.body as the paste's activeElementAtDispatch
snapshot, before the deferred refocus lands.

Fix: isTerminalPanePasteFocusCurrent already treats a transient body/html
activeElement at paste time as inert and trusts the rest of the check: it
was missing the symmetric case where the *dispatch-time* snapshot itself
was body/html. Only reject as stale when the dispatch snapshot was a real,
different element outside the pane container; a body/html snapshot falls
through to the existing (already correct) final-activeElement checks. A
genuinely stale target (pane closed, focus moved to another real control)
is still rejected exactly as before.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
(cherry picked from commit a7e4893f2255f45dbd921365ebfbb0c6350e2d55)
callRuntimeRpc honored timeoutMs and signal when the target was an
environment and discarded both when the target was local. Nothing
downstream compensated: the preload contract has no deadline on the
local call, and runtime:call dispatches with neither a race nor a
context signal, so ipcRenderer.invoke settles only when the handler
returns.

That made every caller deadline on the local path a no-op. The clearest
case is client-hosted-browser-row-close.ts, which defines a 15s constant
for a call whose target is hardcoded local, so the constant could never
take effect. The user visible symptom is the Automations tab: it mounts
with isLoading true, asks for a 15s deadline, and its finally block can
only run once the promise settles, so a stalled dispatch leaves the page
on its skeleton with no way back.

Bound the local call with the caller's timeoutMs and signal, reusing the
settle once bookkeeping and the error message from the environment path.
No default deadline is added, since long running local RPCs such as
git.fetch and worktree.create pass none on purpose.

(cherry picked from commit 3182aab1d6369eba360bfef8374db15536e18a96)
(cherry picked from commit f00a936a4969dbfd366cb3a673b974ca5a2d4b52)
…eam #19593)

Port de stablyai/orca#19593. Upstream lo arregla en `daemon-pty-spawn-result.ts`;
nuestro equivalente es `daemon-pty-adapter.ts` (mismo codigo, otra ruta tras la
divergencia). El diff de prod es identico al de upstream.

Al reatachar se tomaba la secuencia del snapshot POST-overlay en vez de la de
attach, asi que la salida recibida durante el overlay se contaba dos veces y el
cliente reportaba huecos de stream que no existian. Es el camino que corre en
cada reconexion contra un runtime remoto.

El test de nuestro arbol afirmaba el comportamiento viejo; se porta su
actualizacion tal cual (+15 -3).
…ke other terminals

A cursor-position probe (STA-6740) measured Orca advancing one cell for
sequences Windows Terminal and Ghostty advance two for. The cause is that
`OrcaUnicodeProvider` delegated every width decision to xterm's Unicode 11
tables, which measure single code points against a table frozen in 2018, while
the TUIs writing into the pane measure whole grapheme clusters against a
current one. Each cell of disagreement shifts the columns a TUI's next in-place
redraw erases and reprints over.

The provider is already the single width authority every Orca terminal
activates — the live renderer pane, the headless daemon mirror that
snapshot/restore serializes from, the dashboard preview, and the restore-parity
fixture. This teaches that one authority three cluster rules it was missing:

- U+FE0F promotes a valid emoji-variation base from one cell to two;
- a skin-tone modifier joins its base's cluster instead of claiming a second
  wide cell (a `+2` column shift for every glyph after it);
- emoji that default to emoji presentation but postdate Unicode 11 are two
  cells, not one.

Regional indicators are deliberately left alone: xterm has no grapheme
segmentation, so a flag already reaches two cells as 1 + 1.

U+FE0E text presentation is not implemented — it would have to narrow an
already-placed cluster, and xterm's printer only ever advances the cursor for a
joined code point.

Closes STA-6740.

(cherry picked from commit e949f3d422fd22f7e5406f96b09a2b4aed6ff35b)
…he tables against staleness

Review findings on the width-authority change.

The skin-tone rule gated only on the preceding cell being two wide, never on it
being something a modifier can attach to. A modifier after a CJK ideograph
joined it: `中🏽` measured two cells where it measured four before. The rule now
also requires the preceding code point to be an emoji modifier base, which is
the standard's own definition of what a modifier may modify — tighter than
Extended_Pictographic and, for anything that is not a well-formed modifier
sequence, it restores exactly the measurement this provider had before.

The frozen tables could go stale the same way xterm's Unicode 11 table did, so
the derivation is now committed as a test: it re-derives all three tables from
the runtime's Unicode data and xterm's Unicode 11 provider and compares, and
reads nothing from the committed ranges to build that expectation. "No missing
entries" runs always — an older runtime cannot fail it spuriously — and exact
equality runs on the Unicode version the tables were generated against. The
module header now records why the tables are frozen at all: this width is a
cross-host contract and Electron, Node and the mobile JSC embed different ICU
versions, so deriving at runtime would make two Orca processes disagree about
one buffer.

Also: reuse the width the base provider already resolved instead of asking for
it twice on the hot path, and fix two comments that described the ZWJ case as a
control and claimed the reported symptom as established.

Refs STA-6740, STA-7066.

(cherry picked from commit a0d66b58eeb27b2a8356e1306a104dae69d5bb01)
…nge on any Unicode version

Two review findings on the staleness gate.

The unused `name` parameter in the lookup arm failed `tsc --noEmit` with TS6133
on all three projects, which would have reddened the CI typecheck job.

The gate also had a hole in one direction. Exact equality only runs when the
runner's embedded Unicode version matches the version the tables were generated
against, so a bogus entry inserted in sorted position went unnoticed anywhere
those versions differ — and they do differ, unpredictably, since the Node the
job installs carries whatever ICU that patch release shipped. A new arm closes
it without reintroducing that dependency: a committed code point the runtime
does not derive is a wrong entry, unless the runtime has never assigned that
code point at all, which is exactly how a table generated against a newer
Unicode looks from an older one. Both directions now run everywhere; exact
equality stays as the strictest form where the versions do line up.

Refs STA-6740.

(cherry picked from commit 6cb08ec2c1650652692945441c7f9486fe08fd61)
El build de Android fallo con `Google Api Error: Invalid request - Version code
21 has already been used.` El valor esta hardcodeado en `mobile/app.json:78`,
asi que CADA re-dispatch choca hasta que alguien lo sube a mano. iOS tiene
`bump_patch_version` en su workflow; Android no tiene equivalente para el
versionCode.

Esto sube 21 -> 22 para desbloquear el build. El arreglo de fondo —derivarlo o
auto-incrementarlo en el workflow— queda pendiente, porque hoy cada release
movil necesita este commit manual y es facil olvidarlo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants