Files
orca/.gitignore
T
JinjingandOrca 5c0195af64 Bound remote watcher fan-out and defer File Explorer refreshes (#11908)
* batch remote watcher events and defer File Explorer refreshes

Remote filesystem watcher events now batch with the shared 150ms trailing and 500ms
max-wait window, coalescing per-path like local events. File Explorer tree and
directory refreshes are scheduled with debounce and transport-aware concurrency caps
(16 local, 8 runtime, 4 SSH). Stale directory cache tracking prevents trusting
collapsed listings skipped by full refresh; they are re-read on re-expansion. Relay
implements a 15-minute idle-only grace cap for zero-PTY relays via PTY pool
lifecycle tracking, independent of explicitly configured grace time.

* fix(watch/relay): bound remote watcher fan-out and read the live relay grace

Three P1 fixes from the SSH/remote freeze audit:

- Remote watchers now debounce on the same 150/500 window as local ones
  (finding D), and every teardown path drops the trailing flush timer
  instead of letting it fire into a dead watch. The deferred send is
  wrapped so a frame disposed mid-window can't escape as a fatal
  main-process exception.
- File Explorer refreshes are scheduled and concurrency-capped rather
  than fanned out unbounded over expanded dirs (finding C). Local
  transports use a zero window, since main already coalesced the burst.
- relay.startGrace reads ptyHandler.configuredGraceTimeMs instead of the
  launch-time argv closure, so a grace raised after launch is honored.
  The branch selection moves to relay-grace-branch.ts because relay.ts
  has no exports and calls main() at import, making it untestable.
  Consequence: a host-sleep relay holding zero PTYs now exits after the
  idle cap. Pinned by test and documented in
  docs/reference/relay-grace-time-reconfiguration.md.

Also drops the duplicated 150/500/5000 constants in the runtime-RPC
batcher in favor of the shared window module.

* docs(relay): correct grace-reconfiguration line numbers after the relay.ts edit

Co-authored-by: Orca <help@stably.ai>

* refactor(file-explorer): use useMemo for paths; remove relay reference

Replace manual ref-based caching with proper React hooks for content-stable path memoization. Remove outdated relay grace-time reference documentation from code review cycle.

* rm design doc

* fix(remote-watcher): prevent stranded timer after close

An in-flight provider receive can land after the batch is torn down.
Without a guard, pushing events to a closed batch would re-arm a timer
that would never be cleared, stranding the task indefinitely. Track the
closed state and skip pushes after close().

Relay.ts comment clarifies why pool watches remain registered during
grace-period shutdown deferral — the socket server stays listening so
a reconnecting client can cancel the grace and resume.

---------

Co-authored-by: Orca <help@stably.ai>
2026-08-01 11:55:58 -07:00

137 lines
2.9 KiB
Plaintext

# Build artifacts
tsconfig.*.tsbuildinfo
# TypeScript emit artifacts next to sources (tsc produced these accidentally;
# real source lives in .ts/.tsx). Hand-authored declaration files are
# re-included below.
src/**/*.js
src/**/*.d.ts
/electron.vite.config.js
/electron.vite.config.d.ts
!src/main/types/hosted-git-info.d.ts
!src/preload/api-types.d.ts
!src/preload/index.d.ts
!src/renderer/src/env.d.ts
!src/renderer/src/mermaid.d.ts
!src/types/build-constants.d.ts
# Dependencies
node_modules/
# Build output
dist/
dist-electron/
out/
/build/
release/
native/**/.build/
# pnpm
.pnpm-store/
package-lock.json
# Environment
.env
.env.local
.env.*.local
# IDE
.vscode/
.idea/
.serena/
*.swp
*.swo
*~
# OS
# Keep these in step with isOsMetadataSkillEntryName (skill-package-identity.ts): both disk
# walkers skip a plain file with one of these names, the git-tree producer does not, and
# ignoring them here is what keeps `git add -A` from committing a stray one.
*.stackdump
.DS_Store
._*
Thumbs.db
ehthumbs.db
desktop.ini
# Lint/cache
.oxlintcache
# Logs
*.log
*.log.*
npm-debug.log*
pnpm-debug.log*
# Coverage
coverage/
# Prod release scan output (accidental adds)
prod-release-scan-*.md
# Benchmark run output
/tests/tools/benchmarks/results/*.json
/.bench-fixtures/
# Temp
tmp/
.tmp/
design-docs/
.context/
.atl/
# Machine-local agent hook endpoint files may contain auth tokens.
/agent-hooks/
# Local-only design/planning docs (not checked in), including most of docs/reference/.
# Durable docs that should be tracked must live in one of the allow-listed
# locations below (assets, readme, STYLEGUIDE, mobile terminal shortcut bar,
# and the tracked reference docs linked from AGENTS.md / README.md).
docs/**
!docs/
!docs/assets/
!docs/assets/**
!docs/readme/
!docs/readme/**
!docs/STYLEGUIDE.md
!docs/mobile-terminal-shortcut-bar.md
!docs/reference/
!docs/reference/git-compatibility.md
!docs/reference/headless-linux-server.md
!docs/reference/linux-glibc-compatibility.md
!docs/reference/relay-grace-time-reconfiguration.md
# Stably CLI (only docs/ are tracked)
.stably/*
!.stably/docs/
.playwright-cli
.validate-ui-screenshots/
validation-screenshots/
.stably-browser
# Local scratch notes and PR evidence screenshots (not part of the product).
/notes/
/pr-evidence/
# Playwright
test-results/
playwright-report/
# Agent skill installations (machine-local, populated by agent tooling)
/.claude/skills/
/.agents/skills/
/skills-lock.json
# Agent hook runtime endpoints (machine-local secrets)
/agent-hooks/
validation-screenshots/
# Localization bootstrap cache (regenerated by bootstrap:*-catalog)
src/renderer/src/i18n/locales/.zh-catalog-cache.json
src/renderer/src/i18n/locales/.ko-catalog-cache.json
src/renderer/src/i18n/locales/.ja-catalog-cache.json
src/renderer/src/i18n/locales/.es-catalog-cache.json
# Bench result JSONs are working artifacts
tests/tools/benchmarks/results/terminal-pipeline-*.json