mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 00:27:39 +00:00
* rm unused files * remove unused files * Refactor PTY IPC and add host environment paths - Split PTY handlers out of inline baseline checks - Rename local PTY shell provider for clarity - Pass userDataPath and resourcesPath to host environment * Establish PTY daemon identity before first await in spawn flow Move identity setup, session ID minting, and hidden delivery state to the beginning of preflight, ensuring these complete synchronously before any awaited operations. Defer async operations like folder workspace validation; add liveness tracking for SSH provider failures. Refactor pane spawn reservation to prevent concurrent spawns from creating duplicate providers. * Add incarnationId tracking throughout PTY exit lifecycle Track PTY incarnation IDs in exit messages sent to renderer, and add cause tracking for exit events. This enables proper lifecycle state management when PTYs can be respawned or have multiple concurrent instances. Also adds deadline support to process listing operations and stop-request tracking for better shutdown observability. * Use fake timers in SFTP namespace tests for deterministic abort handling Tests now use `vi.useFakeTimers()` to control time during abort scenarios, advancing timers explicitly instead of waiting on real async delays. Ensures more reliable test execution without flakiness from timing-dependent behavior. * Fix PTY spawn lifecycle: handle concurrent races and cleanup abandoned a Properly release Agent Teams leader handles when spawns are abandoned or fail, restore provisional PTY sizes on reattachment, and settle concurrent spawn races for the same pane. Add validation guards for destroyed renderers and improve handler re-registration to reset delivery state before bridging a new window. * Move PTY cleanup to localized error boundaries Restore provisional PTY size when build-options fails and guard pre-allocated handle registration. This ensures cleanup happens at the point of error, not deferred to the general catch block. * Replace Promise.resolve() with vi.waitFor in PTY claim test Wait explicitly for the providerSpawn call to be made using vi.waitFor() instead of relying on event-loop yielding. This makes the test more deterministic and reduces flakiness from timing assumptions. * Redact PTY IDs in pending data drop diagnostics Prevent workspace paths embedded in session IDs from leaking through diagnostic logs by using redactPtyIdForDiagnostics. * Mark PTY exit events as observed by provider Exit handlers now receive `providerExitObserved: true` to distinguish definitive provider-witnessed exits from inferred state changes. Preserves optional exit cause when present. * Add defensive input validation to PTY IPC handlers Validate that IPC arguments are present and the correct type before passing them to handler logic. Uses optional chaining and type checks to safely handle malformed requests from the renderer process. * Replace direct Electron imports with PTY host bindings Abstract app, ipcMain, and powerMonitor access through getter functions to support multiple host environments and improve testability. * Defend against transient PTY setup failures with state cleanup Host-env setup failures now trigger cleanup of runtime-allocated PTY state. Cached PTY geometry is preserved after transient reattach failures but cleared when the provider reports the PTY exited before the spawn reply—preventing stale geometry from corrupting future operations. Error handling now distinguishes expired SSH sessions and early-exit conditions to preserve geometry appropriately.
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
export { getBashShellReadyRcfileContent } from '../providers/local-pty-shell-ready-bash-rcfile'
|
|
export {
|
|
isCurrentPtyExit,
|
|
deletePtyOwnership,
|
|
setPtyOwnership,
|
|
restorePtyIncarnation,
|
|
getPtyIdsForConnection
|
|
} from './pty/provider/ownership-state'
|
|
export { getPtyIdForPaneKey, registerPaneKeyTeardownListener } from './pty/pane/key-state'
|
|
export { hasPendingRendererSerializerForPaneKey } from './pty/pane/serializer-state'
|
|
export type {
|
|
BuildPtyHostEnvOptions,
|
|
CodexHomeLaunchContext,
|
|
GetSelectedCodexHomePath,
|
|
PrepareCodexSessionResume,
|
|
CodexHomePtySpawnedLifecycleArgs
|
|
} from './pty/host-env/types'
|
|
export { resolveCodexHomeAfterManagedAuthReadiness } from './pty/host-env/codex-home'
|
|
export { buildPtyHostEnv } from './pty/host-env/assembly'
|
|
export {
|
|
registerSshPtyProvider,
|
|
unregisterSshPtyProvider,
|
|
getSshPtyProvider,
|
|
getLocalPtyProvider,
|
|
setLocalPtyProvider
|
|
} from './pty/provider/registry'
|
|
export { clearProviderPtyState, clearPtyOwnershipForConnection } from './pty/provider/state-cleanup'
|
|
export {
|
|
rebindLocalProviderListeners,
|
|
unbindLocalProviderListeners
|
|
} from './pty/provider/listener-lifecycle'
|
|
export type { PtyRendererDeliveryDebugSnapshot } from './pty/delivery/debug'
|
|
export {
|
|
getPtyRendererDeliveryDebugSnapshot,
|
|
resetPtyRendererDeliveryDebug
|
|
} from './pty/delivery/debug'
|
|
export { registerPtyHandlers } from './pty/register-handlers'
|
|
export { registerHeadlessPtyRuntime } from './pty/register-headless-runtime'
|
|
export { killAllPty } from './pty/kill-all'
|