Files
archived-orca/config/tsconfig.tc.web.json
T
Brennan Benson b30d12992e fix(crash-reporting): a fatal OOM crashes with a report instead of livelocking; name the worker and payload behind it (#43327)
* fix(main): crash instead of spinning on a fatal OOM, and name the worker behind it

A JS listener on SIGTRAP/SIGABRT (signal-exit, loaded by proper-lockfile) made
Chromium's fatal-OOM trap re-fire forever at full CPU instead of crashing.
Every worker thread now carries a role name, records what it posts to its parent
in a fixed shared-memory ledger, and main reports heap pressure across isolates,
so the next out-of-memory failure names the worker that caused it.

* test(worker-threads): ledger names the sender and frees its slot on exit

* fix(worker-threads): refuse fault-signal listeners synchronously, survive crashes with sender evidence

Review fixes: the guard refuses SIGTRAP/SIGABRT listeners before libuv installs a handler and also
runs in orcad and the backend process; large sends are logged to disk before posting and the last
heap sample per isolate goes into crash annotations; slot release no longer races a new claim,
a full ledger evicts its stalest slot, and the payload walk never invokes accessors.

* fix(worker-threads): cast-free guard and ledger, keyed collections count as rows, worker-only large-send log

Second review pass: refuse/forward listeners through Reflect instead of casts; drop slot eviction
(a full ledger stops recording instead of racing a release); count big keyed objects toward the
large-send threshold; scale bytes when the walk is cut short; move the large-send append into a
worker-only module with an explicit sync-fs baseline line.

* fix(worker-threads): visit each payload object once under one entry budget; no byte extrapolation

Third review pass: a wide self-referential object re-enumerated its keys per visit; the walk
now uses a seen-set and a global key/element budget. Bytes stay a lower bound, and a truncated
walk counts as large from 4 MB or 10k items instead of an extrapolated estimate.

* fix(worker-threads): split main heap into old and large-object space in crash annotations

* fix(native-chat): refuse a journal reader reply over 256 MB instead of posting it to main

A decoded whole-chat read (647 MB of JSON, ~931 MB retained) posted from the journal SQL reader
exhausted the V8 heap main shares with every worker. Replies the bounded walk finds large are
measured and refused with a failure the caller already handles; paged reads never pay for it.

* fix(native-chat): cap reader replies at 64 MB from measured decode cost; never refuse the record set

Decoding costs main 1.0-1.9x the serialized bytes, so 256 MB could still cost ~490 MB of the
shared heap. 64 MB keeps one reply under ~120 MB. The record set loads the chat store and grows
only with chat count, so it is exempt rather than refused.

* test(crash-reporting): a real process with proper-lockfile holds no SIGTRAP listener in either load order and keeps SIGTERM cleanup

* fix(native-chat): measure any reader reply the bounded walk cut short; test the reply boundary

Review: rows past the 2,048-node walk could hide a 456 MB reply. A truncated walk now always
measures the serialized size (on the reader thread, never main). The reader posts every reply
through limitJournalReaderReply, which the test exercises directly.

* chore(worker-threads): satisfy lint/format, split hang worker-send parsing, mock environment data in hang tests

* chore(worker-threads): typed calls instead of Reflect in the send ledger, signal guard and hang send parsing

* fix(native-chat): page items-by-kind visits by 8 MiB of JSON so a page of large tool outputs stays under the reader reply limit

* perf(native-chat): read items-by-kind payloads lazily so rows past the page budget are never loaded

* fix(native-chat): never refuse a reader reply that carries one stored item; no page can split it

* fix(worker-threads): list the spawn module's new imports in the web typecheck project

* fix(worker-threads): walk Map keys through built-in accessors, bound the logged kind, page items-by-kind by key lookups, record the spawned thread name, skip SIGTRAP subprocess tests on Windows

* refactor(native-chat): keep the items-by-kind payload lookup's SQLite calls in the reader's item reads
2026-11-16 19:19:04 -08:00

120 lines
6.7 KiB
JSON

{
"extends": "./tsconfig.web.json",
"exclude": [
"../src/renderer/src/components/browser-pane/host-guest/browser-profile-native.test-fixture.ts",
"../src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit-host-platform.test.ts",
"../src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.test.tsx",
"../src/renderer/src/runtime/provider-accounts/observations/provider-account-observation.test-fixture.ts",
"../src/shared/**/*.test.ts",
"../src/shared/**/*.test.tsx",
"../src/shared/**/*.spec.ts",
"../src/shared/**/*.spec.tsx"
],
"include": [
"../src/renderer/src/env.d.ts",
"../src/renderer/src/**/*",
"../src/renderer/src/**/*.tsx",
"../src/preload/api-types.ts",
"../src/preload/api/**/*",
"../src/preload/index.ts",
"../src/preload/usage/backend-port-client.ts",
"../src/preload/renderer/browser-pages/browser-client-page-renderer-requests.ts",
"../src/preload/renderer/browser-pages/browser-find-subscriptions.ts",
"../src/preload/renderer/window-commands/close-active-tab-payload-admission.ts",
"../src/preload/renderer/e2e-config.ts",
"../src/preload/renderer/hidden-window-frame-pump.ts",
"../src/preload/api/gitlab/gitlab.ts",
"../src/preload/renderer/renderer-runtime.ts",
"../src/preload/renderer/diagnostics/renderer-heap-statistics-reader.ts",
"../src/preload/renderer/diagnostics/renderer-process-memory-reader.ts",
"../src/preload/renderer/restart/renderer-restart-wiring.ts",
"../src/preload/runtime/runtime-environment-subscriptions.ts",
"../src/preload/usage/usage-provider-api.ts",
"../src/main/pi/rpc/options/rpc-model-schema.ts",
"../src/main/pi/rpc/options/rpc-model-options.ts",
"../src/main/worker-threads/worker-thread-spawn.ts",
"../src/main/worker-threads/worker-thread-roles.ts",
"../src/main/worker-threads/worker-send-ledger.ts",
"../src/main/worker-threads/worker-message-shape.ts",
"../src/main/worker-threads/worker-large-send-log.ts",
"../src/main/worker-threads/worker-thread-entry-path.ts",
"../src/shared/**/*",
"../mobile/src/worktree/agent-lineage/worktree-agent-child-rows.ts",
"../src/packages/process-host/src/__fixtures__/**/*",
"../src/main/gitlab/requests/gitlab-response-mapping.ts",
"../src/main/source-control/hosted-review-branch-cache.ts",
"../src/main/source-control/hosted-review-branch-cache-types.ts",
"../src/main/source-control/hosted-review-active-branch-claims.ts",
"../src/main/source-control/hosted-review-unsettled-lookups.ts",
"../src/main/source-control/hosted-review-inflight-lookups.ts",
"../src/main/source-control/hosted-review-scope-generations.ts",
"../src/main/source-control/hosted-review-lookup-backoff.ts",
"../src/main/source-control/hosted-review-refresh-pacing.ts",
"../src/main/source-control/hosted-review-provider-read.ts",
"../src/main/persistence/profile-state-cutover-fixture.ts",
"../src/main/runtime/sidebar-inputs/sidebar-clock.ts",
"../src/main/runtime/sidebar-inputs/temporal/sidebar-retention-owner.ts",
"../src/main/runtime/sidebar-inputs/producer-revision.ts",
"../src/main/runtime/sidebar-inputs/feed/sidebar-inputs-feed.ts",
"../src/main/runtime/sidebar-inputs/feed/sidebar-inputs-feed-domain-read.ts",
"../src/main/runtime/sidebar-inputs/feed/sidebar-inputs-feed-log.ts",
"../src/main/runtime/sidebar-inputs/feed/sidebar-inputs-feed-pages.ts",
"../src/main/runtime/sidebar-inputs/feed/sidebar-inputs-feed-pins.ts",
"../src/main/runtime/sidebar-inputs/feed/testing/sidebar-inputs-feed.test-fixture.ts",
"../src/main/jira/adf-markdown.ts",
"../src/main/jira/adf-text-marks.ts",
"../src/main/jira/adf-media-destination.ts",
"../src/main/ipc/dashboard/dashboard-payload-validation.ts",
"../src/main/ipc/dashboard/dashboard-agent-launch-validation.ts",
"../src/main/ipc/dashboard/dashboard-workspace-payload-validation.ts",
"../src/main/ipc/dashboard/dashboard-filter-payload-validation.ts",
"../src/main/ipc/worktrees/paths/deferred-emoji-shortcode-dataset.ts",
"../src/main/ipc/worktrees/creation/worktree-branch-name.ts",
"../src/main/ipc/worktrees/paths/worktree-logic.ts",
"../src/main/ipc/worktrees/paths/worktree-path-settings.ts",
"../src/main/ipc/worktrees/creation/worktree-display-name.ts",
"../src/main/ipc/worktrees/metadata/worktree-linked-work-item-metadata.ts",
"../src/main/ipc/worktrees/metadata/worktree-metadata-merge.ts",
"../src/main/wsl/discovery/wsl-availability.ts",
"../src/main/wsl/discovery/wsl-installation.ts",
"../src/main/windows/windows-native-registry.ts",
"../src/main/wsl/discovery/wsl-discovery-change.ts",
"../src/main/wsl/filesystem/wsl-directory-probe-command.ts",
"../src/main/wsl/discovery/wsl-distro-list-output.ts",
"../src/main/wsl/discovery/wsl-distro-retry.ts",
"../src/main/wsl/discovery/wsl-running-distro-cache.ts",
"../src/main/wsl/discovery/wsl-home-cache.ts",
"../src/main/wsl/discovery/distro-catalog.ts",
"../src/main/wsl/filesystem/unc-path-access.ts",
"../src/main/wsl/execution/wsl-interop-spawn-directory.ts",
"../src/main/wsl/execution/wsl-exe-process.ts",
"../src/main/wsl/discovery/wsl-console-running-distros.ts",
"../src/main/wsl/discovery/wsl-registered-distro-fallback.ts",
"../src/main/wsl/discovery/wsl-distro-registry-id.ts",
"../src/main/persistence/applying-settings/ui-state-read.ts",
"../src/main/persistence/tracking-repos/worktree-identity-migration.ts",
"../src/main/persistence/tracking-repos/worktree-identity-row-repoint.ts",
"../src/main/persistence/restoring-sessions/tab-terminal-pane-binding-repair.ts",
"../src/main/persistence/window-save-view.ts",
"../src/main/persistence/runtime-authored-workspace-session-fields.ts",
"../src/main/runtime/terminal/recovery/shutdown-reconnect-facts.ts",
"../src/main/persistence/applying-settings/ui-state-update.ts",
"../src/main/persistence/applying-settings/ui-selection-normalization.ts",
"../src/main/persistence/applying-settings/ui-interaction-merge.ts",
"../src/main/credentials/protected-secret-persistence.ts",
"../src/main/startup/serve-launch/serve-desktop-activation.ts",
"../src/main/startup/serve-launch/serve-mode-argv.ts",
"../src/main/startup/profile-startup/single-instance-lock.ts",
"../src/main/startup/diagnostics/startup-diagnostics.ts",
"../src/main/window/activation/focus-existing-window.ts",
"../src/main/window/activation/foreground-activation-policy.ts",
"../src/main/window/activation/macos-app-activation.ts"
],
"compilerOptions": {
"paths": {
"@renderer/*": ["../src/renderer/src/*"],
"@/*": ["../src/renderer/src/*"]
}
}
}