Skip to content

perf(main): show the window sooner and load cold modules on first use - #327

Merged
sambitcreate merged 12 commits into
mainfrom
perf/startup-path
Oct 4, 2026
Merged

sambitcreate merged 12 commits into
mainfrom
perf/startup-path

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Earlier window (MAIN-1): the main window is created during startup reconciliation. A startup-ipc-admission.ts gate holds renderer IPC until main is ready. Window shown 1342 → 925 ms.
  • Lazy modules (MAIN-2, partial): electron-updater, the read-aloud Markdown parser, bonjour-service (Linux Remote only) and the preview asset parsers load on first use.
  • Lazy peer contract (MAIN-3, partial): the peer OpenAPI contract and Ajv load on the first peer response.

Test plan

  • The startup admission tests, type-check and the touched main suites.
  • An Electron launch smoke test.

Part of the October optimization pass. Finding IDs refer to docs/performance/optimization-audit-2026-10-03.md (#320). The branch's .memory/ note has per-finding rationale.

Flake recorded

  • Spec: tests/e2e/chat-message-queue.spec.ts:340, "Steer on a queued message adds it to the running response once".
  • Symptom: "Queued messages" shows 1 item instead of 2. The first queued message is missing from both the queue and the transcript.
  • Run: https://github.com/sambitcreate/aiden-agent/actions/runs/37179831816/job/111370026178. It passed on retry, and --fail-on-flaky-tests turned the retry into a failure.
  • Not from this branch: it reproduces on origin/main 0215439 locally, failing 4 of 12 runs. It looks like a renderer chat-queue race, not startup ordering, and needs its own fix.
  • Contract test change: in subagent-phase3-contract, the startup-ordering anchor moved from createMainWindow() to openProcessStartupIpcAdmission(). The window is now created early, but the renderer stays blocked until reconciliation finishes.

🤖 Generated with Claude Code

sambitcreate and others added 7 commits October 3, 2026 20:27
…N-1)

The main window used to be created only after ~20 sequential reconcile
awaits. Create it as soon as the theme is known so the renderer bundle loads
in parallel, and hold every renderer invoke behind a startup admission gate
(installed before any ipcMain.handle registration) until reconciliation
finishes, preserving the "no renderer reads before reconcile" invariant.
Tool-output pruning no longer blocks startup. Adds a startup-reconciled
diagnostic milestone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
electron-updater (~37 ms of module evaluation) was imported eagerly on the
startup path, though it is only reachable from start() after the main
window or a user update action. Load it through createRequire on first use
so the protected install handoff stays synchronous.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unified/remark stack (~44 ms) was evaluated at startup only to back
read-aloud. Load it on the first read-aloud request, before the
reservation check so the synchronous preparation section is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…IN-2)

bonjour-service (~20 ms) was evaluated at every startup although only the
Linux local-discovery publisher uses it (macOS uses dns-sd). Import it when
that publisher starts, keeping the existing stopped-before-ready contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…IN-3)

The 289 KB Aiden Remote OpenAPI document and the Ajv 2020 validator were
imported at startup only to validate peer-host responses. Load both on the
first validation; peer response validation becomes async and the handler
awaits it, with identical accept/reject behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parse5, acorn, postcss and postcss-value-parser (~16 ms) were evaluated
at startup only for browser-preview asset discovery. Load them on the
first discovery; reference extraction becomes async with unchanged output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The earlier window introduces a startup-versus-quit race: reconciliation can resume and start services after shutdown has stopped them. This lifecycle interleaving needs to be addressed before merging.

Reviewed changes Reviewed the complete startup-ordering and lazy-loading changes across all seven commits.

  • Earlier window: Window loading overlaps persisted-state reconciliation, with process-wide IPC admission holding renderer invokes until reconciliation completes.
  • Startup diagnostics and cleanup: Adds the startup-reconciled milestone, defers expired tool-output cleanup, and destroys an unadmitted window on startup failure.
  • Lazy updater: Loads electron-updater on service start or update use while preserving the guarded Linux AppImage installation path.
  • Lazy feature dependencies: Defers the read-aloud Markdown stack, Node Bonjour publisher, and preview asset parsers until use, updating async callers and tests.
  • Lazy peer validation: Defers the OpenAPI contract and Ajv until the first peer response while retaining existing response validation.

TypeScript checking and the focused startup, updater, TTS, peer, Remote, diagnostics, and browser suites passed. The browser suite initially lacked its Chromium executable and passed after installation; full Electron E2E was not run locally.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread main/index.ts
nativeTheme.themeSource = normalizeAppearanceConfig(
(await configStore.getSettings()).appearance,
).mode;
initialMainWindow = createMainWindow({ startupAdmissionHeld: true });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Coordinate accepted quit with pending startup

An accepted Quit on the newly visible window can enter shutdownAndQuit() while this startup callback is still suspended in reconciliation. The callback resumes without a shutdown fence, allowing reconciliation to race store teardown and Remote, schedules, and Telegram to start after shutdown has already stopped them.

Technical details
# Startup resumes after service shutdown

## Affected sites
- [main/index.ts:1726](https://github.com/sambitcreate/aiden-agent/blob/6d47046a6e9929a33a5059869b2d71832f02bcd3/main/index.ts#L1726) exposes a native window before the reconciliation chain settles.
- [main/index.ts:588-625](https://github.com/sambitcreate/aiden-agent/blob/6d47046a6e9929a33a5059869b2d71832f02bcd3/main/index.ts#L588-L625) accepts Quit, closes the renderer, and enters shutdown independently of startup.
- [main/index.ts:407-426](https://github.com/sambitcreate/aiden-agent/blob/6d47046a6e9929a33a5059869b2d71832f02bcd3/main/index.ts#L407-L426) stops Remote and background services and closes persistence while startup may still be pending.
- [main/index.ts:2031-2075](https://github.com/sambitcreate/aiden-agent/blob/6d47046a6e9929a33a5059869b2d71832f02bcd3/main/index.ts#L2031-L2075) initializes Remote, opens IPC admission, and starts background services without checking whether Quit was accepted.
- [main/services/aiden-remote-service-main.ts:917-928](https://github.com/sambitcreate/aiden-agent/blob/6d47046a6e9929a33a5059869b2d71832f02bcd3/main/services/aiden-remote-service-main.ts#L917-L928) allows initialization after a stop with no existing runtime; [main/services/schedule-service-core.ts:296-300](https://github.com/sambitcreate/aiden-agent/blob/6d47046a6e9929a33a5059869b2d71832f02bcd3/main/services/schedule-service-core.ts#L296-L300) allows start after stop.

## Reproduction
Executed the actual AST-extracted `whenReady` callback, `shutdownAndQuit`, and `cleanupApplication` with deferred service dependencies. Hold `migrateLegacyEmptyWorkspaceChats`, enter shutdown, pause browser teardown after Remote has stopped, then release reconciliation. The observed ordering was:

`window shown -> remote stopped -> remote initialized -> admission opened -> schedule started -> telegram started -> updater started -> app quit`

This is an ordering reproduction with service stubs, not a full Electron E2E test.

## Required outcome
- Coordinate accepted Quit with pending startup so reconciliation settles or is cancelled before its stores/services are torn down.
- Do not open admission or initialize/start background services after Quit has committed to shutdown.
- Add behavioral coverage for accepting Quit while reconciliation and `app:getInfo` admission remain pending; assert that services cannot restart after their shutdown.

## Suggested approach
Make accepted shutdown terminal for startup and coordinate the outstanding startup task with teardown. A check only at the final service-start block would not prevent earlier reconciliation from racing store closure.

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline review — 2 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment thread main/index.ts
Comment on lines +2046 to +2049
event: "startup-reconciled",
outcome: "completed",
});
await initialMainWindow;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2 · logic] Replacing startup createMainWindow call breaks subagents and command-system contract tests
Confidence: 0.95

Line 2049 replaces 'await createMainWindow();' with 'await initialMainWindow;', causing main.indexOf('await createMainWindow()', finalizeOrphanedJournals) in main/services/subagents/subagent-phase3-contract.test.ts:421 to return -1 and main.lastIndexOf('await createMainWindow()') in main/services/native-menu-command-contract.test.ts:55 to resolve before resolveIndex.

Repair: Update both contract tests to match 'await initialMainWindow' instead of 'await createMainWindow()'.

Comment thread main/index.ts
Comment on lines +1031 to +1040
async function createMainWindow(
options: { startupAdmissionHeld?: boolean } = {},
): Promise<void> {
let rendererCrashTimes: number[] = [];
// macOS activate, a second-instance event, or a newly registered global
// shortcut can all arrive while whenReady is still initializing. Never let
// those alternate paths expose a renderer to a partial shortcut snapshot.
await shortcutInitializationPromise;
// The startup window may skip the wait: the startup IPC admission holds its
// renderer's invokes until shortcuts and reconciliation have finished.
if (!options.startupAdmissionHeld) await shortcutInitializationPromise;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2 · logic] Parameterizing createMainWindow breaks shortcut barrier contract test
Confidence: 0.95

Adding options to createMainWindow changes its signature from 'async function createMainWindow(): Promise' to 'async function createMainWindow(', causing main.indexOf('async function createMainWindow()') in main/services/native-menu-command-contract.test.ts:48 to return -1 and fail createFunctionIndex >= 0.

Repair: Update main/services/native-menu-command-contract.test.ts:48 to search for 'async function createMainWindow(' and align the test with the startupAdmissionHeld bypass.

@very-hermes-bot

very-hermes-bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Hermes Review Bot

Confidence: 5

Engine: agy/gemini-3.8-flash-high
Review mode: full
Head: 35767135ec8612332068c5dca57723889a6264a9
Generated: 2026-10-04T13:34:05+00:00
Reviews: 1

Summary

Accelerates the application startup path by creating and loading the main browser window concurrently with persisted-state reconciliation, rather than waiting for ~20 sequential initialization awaits before window creation. Renderer IPC calls are queued in arrival order behind a new startup admission gate installed before handler registration in main/bootstrap.ts and opened once reconciliation completes. Heavy external dependencies (electron-updater, bonjour-service, parse5/acorn/postcss, ajv/OpenAPI schema, and unified/remark) are converted to load on first use rather than at module evaluation. The maintainer should verify and update the test contract in main/services/native-menu-command-contract.test.ts, which breaks because its source assertions still expect the former createMainWindow signature and startup ordering anchor.

Confidence Score: 5/5

Fully traced startup sequencing, concurrency gates, lazy module initialization, error paths, and all contract test suites reading main/index.ts.

📁 Important Files Changed
  • main/services/startup-ipc-admission.ts: Implements the process-wide startup IPC admission gate that queues ipcMain.handle invocations until reconciliation finishes and flushes them in arrival order.
  • main/bootstrap.ts: Installs the startup IPC admission hook into Electron's ipcMain before dynamically importing main/index.ts and registering any handlers.
  • main/index.ts: Moves createMainWindow({ startupAdmissionHeld: true }) up into the reconciliation chain immediately after theme normalization, marks toolOutputStore.pruneExpired() as fire-and-forget, and opens IPC admission after shortcuts and remote services reconcile.
  • main/services/app-updater.ts: Defers requiring electron-updater until start() or user-initiated update checks, using CommonJS createRequire to preserve synchronous installer execution.
  • main/services/peer-response.ts: Defers importing ajv, ajv-formats, and the 289 KB OpenAPI contract until the first peer response validation, making validatePeerResponse asynchronous.
  • main/services/browser/asset-discovery.ts: Defers loading parse5, acorn, postcss, and postcss-value-parser until the first preview asset reference extraction, making browserAssetReferences asynchronous.
  • main/services/tts/speech-text.ts & main/services/tts/service.ts: Defers loading the unified/remark Markdown parser stack until ensureSpeechTextParser() is awaited on read-aloud requests.
  • main/services/subagents/subagent-phase3-contract.test.ts: Updates the startup sequence assertion anchor from await createMainWindow() to openProcessStartupIpcAdmission().
  • main/services/native-menu-command-contract.test.ts (unmodified): Fails against main/index.ts due to unadapted function signature and ordering checks.

Findings

  • [P1 · logic] main/index.ts:1031 — Native menu command contract test fails on unadapted createMainWindow signature and startup ordering anchor → commented inline
📊 Sequence Diagram
sequenceDiagram
  participant Renderer
  participant Preload
  participant IPCAdmission as Startup IPC Admission
  participant MainReconcile as Main Startup & Reconcile
  participant Stores as Core Stores & Services

  MainReconcile->>MainReconcile: createMainWindow({ startupAdmissionHeld: true })
  MainReconcile->>Stores: Run reconciliation concurrently
  Renderer->>Preload: appApi.getInfo()
  Preload->>IPCAdmission: ipcRenderer.invoke("app:getInfo")
  Note over IPCAdmission: Hold invoke (opened == false)
  Stores-->>MainReconcile: Reconciliation complete
  MainReconcile->>IPCAdmission: openProcessStartupIpcAdmission()
  Note over IPCAdmission: Flush held invokes in arrival order
  IPCAdmission-->>Preload: Resolve app:getInfo
  Preload-->>Renderer: App capabilities & info
  Renderer->>Renderer: First React render
Loading

Machine-Readable Findings

[
  {
    "file": "main/index.ts",
    "start_line": 1031,
    "end_line": 1040,
    "severity": "P1",
    "comment_type": "logic",
    "confidence": 0.95,
    "title": "Native menu command contract test fails on unadapted createMainWindow signature and startup ordering anchor",
    "mechanism": "Changing createMainWindow's signature and moving its startup await breaks main/services/native-menu-command-contract.test.ts because createFunctionIndex evaluates to -1 and resolveIndex < createIndex fails.",
    "repair": "Update main/services/native-menu-command-contract.test.ts to match createMainWindow without parameter parentheses and anchor the startup completion assertion to openProcessStartupIpcAdmission().",
    "id": "3537661f51d5bc5f"
  }
]

Last reviewed commit: 35767135ec86
Reviews (1) · Comment /hermes review to trigger a new review · /hermes review full for full re-review

sambitcreate and others added 2 commits October 4, 2026 03:59
…creation

The startup window is now created while reconciliation runs, and the
startup IPC admission holds every renderer invoke until reconciliation
finishes. The ordering contract still requires private-run and worktree
deletion reconciliation to finish before the renderer is admitted and
before schedules start, so anchor it on openProcessStartupIpcAdmission().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

No new issues found in this delta. The previously reported startup-versus-quit race remains unresolved, so approval is still withheld.

Reviewed changes Reviewed the changes since 6d47046a, with the complete current PR diff as context.

  • Updated startup-ordering coverage to use openProcessStartupIpcAdmission() as the renderer-readiness boundary instead of window creation, matching the renderer's blocked bootstrap.
  • Merged current main into the branch and retained startup-admission test registration alongside its parallel test runner and test:serial inventory.

The revised ordering, startup-admission, and bootstrap suites passed all 36 tests; test-inventory validation passed all 10 tests. Full Electron E2E was not run locally, and hosted CI on this head was still in progress when checked.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment thread main/index.ts
Comment on lines +1031 to +1040
async function createMainWindow(
options: { startupAdmissionHeld?: boolean } = {},
): Promise<void> {
let rendererCrashTimes: number[] = [];
// macOS activate, a second-instance event, or a newly registered global
// shortcut can all arrive while whenReady is still initializing. Never let
// those alternate paths expose a renderer to a partial shortcut snapshot.
await shortcutInitializationPromise;
// The startup window may skip the wait: the startup IPC admission holds its
// renderer's invokes until shortcuts and reconciliation have finished.
if (!options.startupAdmissionHeld) await shortcutInitializationPromise;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1 · logic] Startup window signature change and deferred invocation break native-menu-command-contract.test.ts
Confidence: 0.95

Changing the createMainWindow signature to accept options and replacing the post-reconciliation createMainWindow call with await initialMainWindow breaks native-menu-command-contract.test.ts (createFunctionIndex evaluates to -1 and resolveIndex < createIndex fails), causing npm run test:command-system to fail.

Repair: Update native-menu-command-contract.test.ts to match createMainWindow's updated signature and verify that resolveShortcutInitialization precedes openProcessStartupIpcAdmission.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

No new issues found in this delta. The previously reported startup-versus-quit race remains unresolved, so approval is still withheld.

Reviewed changes Reviewed the changes since 3b9bdce7, using the complete current PR diff as context.

  • Updated updater test dependencies to accommodate the merged shared path-containment helper while retaining isolated filesystem mocks and the existing lazy-loading and disposal assertions.
  • Added shared-main test coverage to test:serial, preserving the complete test inventory after merging main.

The focused updater and startup-related suites passed all 62 tests; test:main-shared passed all 17 tests; CI test-inventory validation passed all 10 tests. Full Electron/macOS E2E was not run locally.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

sambitcreate and others added 2 commits October 4, 2026 09:11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The spec pressed Enter twice right after filling, without the Queue-enabled
check every other queue spec uses, so an Enter could land before the composer
accepted queueing and the queue showed one item instead of two. It failed
this way on #327 and #328.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 57b4896)
sambitcreate added a commit that referenced this pull request Oct 4, 2026
The spec pressed Enter twice right after filling, without the Queue-enabled
check every other queue spec uses, so an Enter could land before the composer
accepted queueing and the queue showed one item instead of two. It failed
this way on #327 and #328.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 57b4896)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

No new issues found in this delta. The previously reported startup-versus-quit race remains unresolved, so approval is still withheld.

Reviewed changes Reviewed the changes since 36cea956, using the complete current PR diff as context.

  • Updated queued-message Steer coverage to wait for the Queue action to become enabled before each queued Enter and verify the first queue row before submitting the second, retaining the existing delivery and uniqueness assertions.
  • Merged current main and preserved its added renderer test registrations alongside startup-admission coverage; the complete serial test inventory still validates.

E2E TypeScript checking passed, and Playwright collected all 19 tests in the changed spec. The focused queue and startup-admission suites passed all 29 tests; CI test-inventory validation passed all 10 tests. Electron E2E was not run because this Linux checkout lacks the required macOS-only native helpers, so the recorded flake's resolution is not independently confirmed. Hosted CI on this exact head was still in progress when inspected.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment thread main/index.ts
Comment on lines +1031 to +1040
async function createMainWindow(
options: { startupAdmissionHeld?: boolean } = {},
): Promise<void> {
let rendererCrashTimes: number[] = [];
// macOS activate, a second-instance event, or a newly registered global
// shortcut can all arrive while whenReady is still initializing. Never let
// those alternate paths expose a renderer to a partial shortcut snapshot.
await shortcutInitializationPromise;
// The startup window may skip the wait: the startup IPC admission holds its
// renderer's invokes until shortcuts and reconciliation have finished.
if (!options.startupAdmissionHeld) await shortcutInitializationPromise;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1 · logic] Native menu command contract test fails on unadapted createMainWindow signature and startup ordering anchor
Confidence: 0.95

Changing createMainWindow's signature and moving its startup await breaks main/services/native-menu-command-contract.test.ts because createFunctionIndex evaluates to -1 and resolveIndex < createIndex fails.

Repair: Update main/services/native-menu-command-contract.test.ts to match createMainWindow without parameter parentheses and anchor the startup completion assertion to openProcessStartupIpcAdmission().

sambitcreate added a commit that referenced this pull request Oct 4, 2026
* perf(main): cache MCP tool lists, discover servers in parallel under deadlines (MAIN-20, MAIN-21)

- Cache tools/list per connected client; notifications/tools/list_changed
  and reconnects invalidate it, so a warm generation issues no tools/list.
- Discover enabled servers concurrently with Promise.allSettled. Connect
  (initialize) is bounded at 10 s, tools/list at 5 s, and each server's
  whole step at 17 s; a server that misses its deadline loses its tools for
  the turn and is reported as a timed-out mcp-degraded diagnostic.
- Tool calls pass an explicit 60 s timeout and maxTotalTimeout alongside
  the caller's signal (unchanged from the SDK default bound).
- closeAll disconnects servers in parallel and shutdown awaits it within a
  2 s budget. Connections idle for 10 minutes are closed without
  superseding their generation, so an older turn's tools reconnect on use.
- Removing a server prunes its generation bookkeeping. Generations now come
  from one monotonic sequence so pruning cannot revive a stale caller.
- The merge step moved into a pure core with behavioral tests, replacing
  the mcp.ts source-grep assertion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(main): bound Telegram requests and coalesce thinking edits (MAIN-26)

Every Bot API fetch now carries a deadline combined with the caller's
signal: long polls get the poll window plus 10 s, file downloads and
uploads get size-scaled deadlines, and stopping the poller aborts the
in-flight getUpdates socket instead of only abandoning it. Streamed
reasoning edits are coalesced to one per 900 ms with the latest text,
and unchanged renders are skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(main): bound cloud voice transcription requests

OpenAI and Gemini transcription now run under a size-scaled deadline
(2 min base, 5 min cap) that covers upload, response and body read, even
for callers without a signal such as Telegram voice notes. A deadline
abort is reported as a timeout; user cancellation passes through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(main): read subagent process identity without blocking the event loop (MAIN-24)

The PID-reuse fence now reads ps asynchronously. Launch keeps its ten
25 ms identity attempts, concurrent reads share one ps, and hard-kill and
exit proofs are awaited by the owner, re-checking the exit flag after the
read. Owner semantics are unchanged: indeterminate proof still fails closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(main): bound and stagger scheduled catch-up (MAIN-25)

Startup catch-up of missed runs now goes through a queue that runs at
most two at a time, 3 s apart, holds while the screen is locked, and
re-evaluates on resume and unlock. Stopping the service drops queued
entries so a restart starts clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(main): throttle portable-config refresh on window focus (MAIN-28)

Focus storms now cost one re-read per 2 s plus one trailing pass. An
mtime gate was not used: DataStore.reload deliberately avoids stat
gating because coarse mtimes can drop a second edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(main): stop forking the speech worker for every voice status read (MAIN-28)

Whether the native engine loads is fixed for the app's lifetime, so the
first engine answer is reused; transient launch failures are not cached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(main): pause hidden browser PiP and skip unchanged frames (MAIN-28)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(e2e): wait for Queue before each queued Enter in the Steer spec

The spec pressed Enter twice right after filling, without the Queue-enabled
check every other queue spec uses, so an Enter could land before the composer
accepted queueing and the queue showed one item instead of two. It failed
this way on #327 and #328.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 57b4896)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@sambitcreate
sambitcreate merged commit 147d01d into main Oct 4, 2026
25 checks passed
@sambitcreate
sambitcreate deleted the perf/startup-path branch October 4, 2026 15:17
sambitcreate added a commit that referenced this pull request Oct 4, 2026
#327 now loads electron-updater lazily through createRequire, so the
bundle no longer lists it as an external. Record it in RUNTIME_LOADED so
the production-dependency check keeps it in dependencies (and app.asar).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants