Commit Graph
6686 Commits
Author SHA1 Message Date
Brennan Benson 26e7ef6787 fix(ai-vault): preserve resume env deletion through drag 2026-07-16 11:04:09 -07:00
Brennan Benson 18e7414761 fix(codex): stop index heal before delayed spawn 2026-07-16 01:54:11 -07:00
Brennan Benson 1f451e5fe2 fix(codex): enforce real-home resume and heal boundaries 2026-07-16 01:44:48 -07:00
Brennan Benson fe278b48a8 fix(ai-vault): preserve execution boundaries and reap children 2026-07-16 01:19:48 -07:00
Brennan Benson 9ecaee715e fix(codex): fail closed on unsafe backfill install 2026-07-16 00:53:31 -07:00
Brennan Benson 8ce03b4652 fix(codex): harden real-home heal boundaries 2026-07-16 00:47:37 -07:00
Brennan Benson d74aa56813 fix(codex): preserve session identity during dedup heal 2026-07-15 18:35:44 -07:00
Brennan Benson ce25b2358e Merge remote-tracking branch 'origin/brennanb2025/codex-real-home-phase1' into brennanb2025/codex-session-dedup-index-heal
# Conflicts:
#	src/main/codex/codex-app-server-client.ts
2026-07-15 18:03:22 -07:00
Brennan Benson 2e3a282d31 Merge remote-tracking branch 'origin/brennanb2025/codex-trust-rpc-grant' into brennanb2025/codex-real-home-phase1
# Conflicts:
#	src/main/codex/hook-service-trust-grant.test.ts
2026-07-15 17:59:01 -07:00
Brennan Benson 2f41d62d37 feat(codex): background sqlite index heal for backfilled sessions
Codex's own state-DB metadata backfill is one-shot, so rollouts hardlinked in
by Orca's session backfill never become visible to Codex's DB-driven surfaces.
Extract the app-server stdio JSONL transport into codex-app-server-session
(shared with the trust-grant client) and add a bounded, resumable background
pass that drives Codex's lazy indexing via thread/read per backfilled session:
recent-first, batched onto one short-lived server per batch with small
concurrency, ledger + marker so steady-state startups are a no-op, stop-aware
on quit, and capability-aware on CLIs without the app-server surface.
2026-07-15 17:34:15 -07:00
Brennan Benson 22dc271b91 feat(codex): collapse duplicate session listings across Codex roots
Backfilled/bridged rollouts are hardlinked into both the real ~/.codex and
Orca's managed runtime home, so AI Vault listed each session once per root
(#7521). Dedup candidates by rollout file name pre-parse and parsed sessions
by session id post-parse, keeping the canonical root: host real home first
(unprefixed resume), then the managed runtime home, then other homes. Applies
to local, WSL, and SSH-remote scans.
2026-07-15 17:33:59 -07:00
Brennan Benson 1f9ab948e8 test(codex): model codex config/batchWrite faithfully on Windows
The grant-lane stub simulated codex by calling Orca's upsertHookTrustEntries,
which writes both separator variants for a Windows key (a fallback-lane compat
shim real codex never does) — fabricating duplicate tables and whitespace the
RPC path never produces, so the byte-stable and no-duplicate assertions failed
on win32. Replace it with a single-variant, blank-line-separated writer that
matches the real 0.144.x binary's output.
2026-07-15 17:24:32 -07:00
Brennan Benson caf6cac3df fix(codex): don't revoke a just-granted WSL home on a false 'missing' probe
The async wsl.exe canonical-path settlement could report the runtime home
'missing' immediately after a verified RPC grant (a false negative — codex
had just written and re-listed trust there), which drove the reconciliation
'remove' branch to delete all six granted [hooks.state] tables, leaving a bare
[hooks.state] the launching pane read as 'hooks need review'. A 'missing'
settlement now revokes only when no successful install ran this generation; a
genuinely moved home still resolves to a different path and reinstalls.
2026-07-15 17:24:30 -07:00
Brennan Benson b4125822d9 fix(codex): preserve dangling config symlinks on rollback 2026-07-15 17:22:06 -07:00
Brennan Benson 87db673fcd fix(codex): preserve verified trust grants across launch prep 2026-07-15 17:13:18 -07:00
Brennan Benson 60e8af99ad fix(codex): preserve real-home dotfile links 2026-07-15 17:09:55 -07:00
Brennan Benson dda4c37a0d Merge remote-tracking branch 'origin/brennanb2025/codex-session-backfill' into brennanb2025/codex-session-dedup-index-heal
# Conflicts:
#	src/main/index.ts
2026-07-15 16:55:53 -07:00
Brennan Benson 65fb31c0b9 test(terminal): isolate replacement idle reset assertion 2026-07-15 16:00:42 -07:00
Brennan Benson ef7604c06b Merge remote-tracking branch 'origin/brennanb2025/codex-trust-rpc-grant' into brennanb2025/codex-real-home-phase1 2026-07-15 15:54:58 -07:00
Brennan Benson 7b7fa4eabf fix(codex): preserve real-home lane invariants 2026-07-15 15:54:51 -07:00
Brennan Benson b552e719be fix(codex): preserve remote env and complete real-home cleanup 2026-07-15 15:16:39 -07:00
Brennan Benson 1581e324a9 fix(codex): preserve unicode trust RPC responses 2026-07-15 15:07:01 -07:00
Brennan Benson 1fcdc9a32a Merge remote-tracking branch 'origin/brennanb2025/codex-trust-rpc-grant' into brennanb2025/codex-real-home-phase1 2026-07-15 14:00:01 -07:00
Brennan Benson 5eb0750bf9 fix(codex): harden real-home routing cleanup and retries 2026-07-15 13:59:52 -07:00
Brennan Benson ca1389b4aa Merge remote-tracking branch 'origin/brennanb2025/codex-trust-rpc-grant' into brennanb2025/codex-real-home-phase1
# Conflicts:
#	src/main/codex/codex-app-server-grant-bridge.ts
2026-07-15 13:59:02 -07:00
Brennan Benson 8f9da3ed4c fix(codex): restore trust config permissions on rollback 2026-07-15 13:52:46 -07:00
Brennan Benson d4f549364b fix(codex): harden trust grant reconciliation 2026-07-15 13:34:20 -07:00
Brennan Benson 442cde8d99 fix(codex): resolve grant entry from __dirname so plain-node CLI entries stay electron-free
The build guard rejects any electron require reachable from plain-node
entries; the bridge now maps app.asar to app.asar.unpacked by string
replacement instead of consulting electron app paths. CLI typecheck project
lists the new trust-grant module graph.
2026-07-15 12:59:47 -07:00
Brennan Benson e15425a643 fix(codex): install cross-volume session backfill copies atomically
On a real Codex home whose filesystem supports no hardlinks (exFAT/FAT,
some network mounts), the staged cross-volume copy was installed with a
non-atomic copyFile(..., COPYFILE_EXCL) straight into the final
rollout-*.jsonl name. An install interrupted mid-copy (app quit, crash,
ENOSPC during the deferred run) could strand a truncated rollout that the
next run then skips as already-present, defeating the staging design's own
guarantee that a failed copy never leaves a partial session behind.

Install the fully-staged copy with an atomic rename instead, guarded by an
existence re-check so it keeps the never-overwrite contract (and the rename
source is the same immutable managed rollout, so any clobber would be
byte-identical). Cover the no-hardlink-support target and an interrupted
install that must leave no partial in the user's sessions tree.
2026-07-15 02:04:49 -07:00
Brennan Benson 5c68a50385 fix(codex): harden app-server trust grant fallback 2026-07-15 02:02:05 -07:00
Brennan Benson 6e4214a864 fix(codex): keep session backfill off main thread
Use asynchronous, sequential filesystem operations for the one-time rollout backfill, and avoid repeated target-directory probes. Treat inaccessible managed session roots as retryable failures instead of writing a false completion marker.
2026-07-15 01:53:46 -07:00
Brennan Benson c668ab05bc fix(codex): resolve the trust-grant entry without requiring electron
The grant bridge is reachable from plain-Node CLI entries, where the
plain-node entry guard rejects any chunk containing require("electron").
Resolve the bundled session entry from __dirname (root chunk and chunks/
layouts) with an app.asar -> app.asar.unpacked rewrite for packaged runs,
instead of electron's app path APIs.
2026-07-14 23:26:46 -07:00
Brennan Benson c3f37e5500 feat(codex): real-home hook installer trusted via the codex app-server grant client
With the real-home flag ON and the system-default selection, install Orca's
status hook into the user's real ~/.codex before any pane spawns:

- entry APPENDED LAST per managed event: codex hook trust keys are positional
  (source:event:group:handler), so appending keeps every user entry's position
  and trust record intact; user entries and unknown top-level hooks.json fields
  are preserved verbatim
- trust is granted exclusively through the codex app-server client
  (hooks/list + config/batchWrite, verified by re-list); Orca never writes
  [hooks.state] into the user's real config.toml itself
- if the grant lane is unavailable (old binary, unsupported RPC, verify
  failure), the appended entry is rolled back byte-exactly and the host keeps
  the managed-home lane end to end (PTY env, rate limits, commit messages)
  via a lane gate on the runtime-home service
- one-time pristine backup of the user's hooks.json under Orca's userData;
  a rolling .bak sits next to the file (existing atomic writer)
- hook opt-out sweeps Orca entries from the real home and drops Orca-owned
  trust records; flag-off downgrade re-arms the existing legacy system-home
  sweep, which removes the entry and its trust keys cleanly
- the legacy system-home sweep is suppressed only while the real-home lane
  owns ~/.codex/hooks.json, so managed installs cannot delete the entry
2026-07-14 22:54:37 -07:00
Brennan Benson c9837fe002 test(codex): WSL grant-lane coverage — in-distro invocation and fallback parity 2026-07-14 22:44:28 -07:00
Brennan Benson f52dd7952f Merge trust-plumbing branch (codex app-server trust-grant client) into real-home phase1 2026-07-14 22:42:55 -07:00
Brennan Benson e800e947a5 test(codex): cover commit-message real-home override strip/preserve
Adds the two cases for the headless commit-message Codex env under real-home
routing: a nested-Orca-inherited Orca-owned CODEX_HOME is stripped, and a
user-owned CODEX_HOME is preserved.
2026-07-14 22:41:28 -07:00
Brennan Benson be366ab828 test(codex): cover app-server trust grant client, cache, ledger, and lanes 2026-07-14 22:41:23 -07:00
Brennan Benson eb5a76c31a fix(codex): grant managed hook trust via codex app-server RPCs in install/refresh
Host and WSL installs now grant trust for Orca's managed status hooks through
codex's own hooks/list -> config/batchWrite -> re-list verify, scoped to
exactly the managed entries; the previous computeTrustedHash lane is the
unchanged fallback for incapable/erroring CLIs. getStatus and the removal
paths recognize ledger-recorded codex hashes so drift between codex's real
algorithm and the replica no longer misreports or strands trust. SSH remote
install is untouched by design.
2026-07-14 22:41:22 -07:00
Brennan Benson 0c2a807c20 feat(codex): app-server trust-grant client, capability cache, and grant ledger
Short-lived codex app-server JSON-RPC client (hooks/list + config/batchWrite,
the same pair the Codex TUI 'Trust all' flow calls), run in a bundled
ELECTRON_RUN_AS_NODE entry so synchronous launch prep can block on it with a
hard deadline and guaranteed child reap. Capability cache modeled on
GitCapabilityCache, scoped per execution host (native vs each WSL distro),
with a narrow unknown-method/missing-subcommand unsupported predicate. The
grant ledger records verified grants so steady-state launches skip the RPC.
2026-07-14 22:41:09 -07:00
Brennan Benson b0b63c6053 test(codex): cover staged cross-volume install 2026-07-14 22:39:39 -07:00
Brennan Benson 64c76ae338 fix(codex): harden one-time session backfill 2026-07-14 22:38:06 -07:00
Brennan Benson 6d980bb97c fix(codex): strip the daemon-inherited Orca CODEX_HOME override for real-home routing
The daemon spawns PTYs from its own inherited environment and honors only
spawnOptions.envToDelete, so mutating the sparse env object was not enough to
strip an Orca-owned CODEX_HOME the daemon already carries. Add the strip to
envToDelete for both daemon host-spawn paths, preserving a user-set CODEX_HOME.

Verified live via CDP against a sandboxed dev instance (flag ON): an
Orca-spawned pane reports empty CODEX_HOME/ORCA_CODEX_HOME, so Codex resolves
its own ~/.codex. Adds daemon-path unit coverage (strip Orca-owned, preserve
user-owned, no-op when flag OFF).
2026-07-14 22:33:22 -07:00
Brennan Benson 07afc8fbb7 feat(codex): flag-gated system-default real-home routing scaffolding
Staged internal flag (default OFF, no settings UI): route the SYSTEM-DEFAULT
Codex account at the user's real ~/.codex instead of Orca's managed runtime
home. Flag OFF is byte-identical to today; managed (multi-account) selections
are unchanged in either state.

Routing (flag ON + host system default = no managed account):
- CodexRuntimeHomeService.prepareForCodexLaunch / prepareForRateLimitFetch
  return null so the PTY/env layer injects no managed CODEX_HOME and the
  rate-limit fetcher + auth-presence gate fall back to ~/.codex (the background
  poller stops spawning Codex against the managed home — the #5370 auth war).
- buildPtyHostEnv strips only a nested-Orca-inherited Orca-owned override
  (CODEX_HOME matching the private ORCA_CODEX_HOME marker), preserving a
  user-set CODEX_HOME. Shell-ready re-exports already no-op without the marker.
- The headless commit-message Codex path strips the same inherited override.

Hook install for the real-home lane (append-last into ~/.codex/hooks.json,
trust via the app-server client) lands with the trust plumbing; the managed
hook install is skipped for this lane meanwhile.

Credit @jellychoco (#8606) for the native-home routing direction.

Depends on the codex trust-rpc-grant plumbing for the real-home hook installer.
2026-07-14 22:23:24 -07:00
Brennan Benson 228ad45c8d feat(codex): backfill managed-home sessions into the real Codex home once per host
Orca-launched Codex sessions currently land only in the Orca-managed
runtime home, so the user's own `codex resume` picker and app history
never see them (#4444, #8612). Backfill the managed sessions tree into
the real ~/.codex/sessions/YYYY/MM/DD layout once per host:

- hardlink first (one physical rollout log), copy as the cross-volume
  fallback; existing target files are always skipped, nothing in either
  home is deleted or moved
- idempotent; per-file failures leave the completion marker unset so the
  next startup retries cheaply
- JSONL audit log of every link/copy/failure under
  <userData>/codex-session-backfill/
- honors the custom Codex session source home override, mirroring the
  existing system->managed bridge

WSL managed homes are distro-local and need an in-distro variant; that
is a follow-up.
2026-07-14 19:42:07 -07:00
Brennan Benson d9f7fd08f7 fix(mobile): harden notification opt-in onboarding (#8792) 2026-07-14 19:20:36 -07:00
70e16cb900 fix: stop renderer heap leak from unhandled terminal teardown rejections (#8279)
Two renderer paths let Promise rejections escape unhandled, where the
crash-breadcrumb system retains them and grows the heap until the renderer
white-screens (#8260):

- The terminal file-link provider fires a `void Promise.all(...)` whose async
  mappers probe path existence over SSH. On disconnect these reject with
  "Remote connection dropped/reconnecting"; add a `.catch` that resolves the
  callback with no links so the rejection is handled.
- "ResizeObserver loop completed" is a benign Chromium quirk; suppress it in
  crash-diagnostics so it stops filling the breadcrumb buffer and inflating
  the renderer error count.

Scope note: the original fix for #8260 also proposed Windows pty:kill signal
handling (killPtyProcess / isPtyAlreadyGoneError) and a ResizeObserver
double-rAF. Those landed on main independently (Windows kill handling by
v1.4.135; the pane-title-overlay rect-equality guard from #2756 already breaks
the loop at the source), so this change carries only the two guards still
missing upstream.

Co-authored-by: Yixian HU <yixian@YixiandeMacBook-Air.local>
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-14 19:19:43 -07:00
Brennan Benson 53c8a55833 Add mobile notification opt-in onboarding (#8780)
* feat(mobile): add notification opt-in onboarding

* fix(mobile): deliver alerts despite desktop focus
2026-07-14 19:15:50 -07:00
github-actions[bot] a03377fe0f release: v1.4.142-rc.2 v1.4.142-rc.2 2026-07-15 00:50:08 +00:00
Brennan Benson 33a8df93fc fix(speech): resume interrupted voice model downloads and surface real errors (#8775)
* fix(speech): resume interrupted voice model downloads and surface real errors

Voice model downloads that died late in the transfer (flaky networks,
scanning proxies) failed at the UI's 90% progress cap and restarted from
byte zero on every retry, so affected users could never complete any
model download (#8620 / STA-1775).

- Retry transient download failures (net::ERR_* transfer cuts, resets,
  timeouts, HTTP 5xx/429) with an HTTP Range resume from the bytes
  already on disk, restarting from the canonical URL each attempt since
  signed CDN redirect URLs expire; bounded backoff, gives up after
  repeated zero-progress attempts with a diagnosable error.
- Correct catalog sizeBytes to exact upstream asset sizes (parakeet
  v2/v3 are 482/487 MB, not 170/180; paraformer is 1,047 MB, not 115) —
  also the progress denominator when content-length is missing.
- Show the underlying failure cause in the download-error toast and log
  it in main; it was previously invisible everywhere.

All 7 pinned catalog SHA-256 hashes verified against current upstream
assets. Live-verified end to end: a transfer killed mid-body resumes
with a 206 and completes through checksum, extraction, and validation.

Fixes #8620

* fix(speech): harden resumed model downloads

* fix(speech): validate resumed download completion

* fix(speech): keep segmented download resumes progressing

* fix(speech): don't abandon a download that keeps making progress

The retry loop gave up after 8 total failures regardless of progress, so
a large model (e.g. the ~1GB Paraformer) over a network that resets every
few hundred MB was abandoned mid-download even though every attempt was
resuming and advancing — the exact 'stuck then fails' symptom, just later.

Replace the all-time failure budget and the separate advancing-segment
cap with a single rule: give up only on a genuine stall (repeated
attempts with no forward progress) or an absolute request ceiling that
bounds a pathological tiny-segment server. Any download that keeps
advancing now runs to completion.

Verified live under Electron 43: a transfer reset mid-stream on every
attempt but advancing each time previously gave up at 67% after 8
attempts; it now completes. All prior resume/cancel/timeout scenarios
still pass.
2026-07-14 17:49:13 -07:00
github-actions[bot] d44696a74c Update README downloads badge 2026-07-15 00:48:41 +00:00