Skip to content

perf(script): clear script command timeout on output limit#560

Closed
JustYannicc wants to merge 71 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-script-command-timeout-cleanup
Closed

perf(script): clear script command timeout on output limit#560
JustYannicc wants to merge 71 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-script-command-timeout-cleanup

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Clear the script command timeout from the shared finalize path so stdout/stderr output-limit early settlement releases the timer immediately.
  • Extend the script-command runner harness with an opt-in fake child_process.spawn mock.
  • Add focused stdout and stderr overflow regression tests with fake timer instrumentation.

Why

Output-limit settlement killed and resolved the subprocess result but left the original timeout armed until its full timeout window elapsed. Centralizing cleanup in finalize keeps close, error, timeout, and output-limit paths single-settle while preventing retained timeout handles.

Compatibility impact

No user-visible behavior changes. Exit codes, output-limit messages, timeout messages, subprocess killing, and result shaping are preserved.

How tested

  • LSP diagnostics on src/main/script-command-runner.ts: no diagnostics found.
  • node --test scripts/test-script-command-runner.mjs scripts/test-exec-command-timeout-cleanup.mjs: 12 tests passed.
  • pnpm test: 240 tests passed.
  • pnpm run build:main: passed.

Performance evidence

Fake timer/process instrumentation for the output-limit early-finalize path reports:

  • stdout overflow timeout handles: before=1 after=0 cleared=1
  • stderr overflow timeout handles: before=1 after=0 cleared=1

Stack validation

Started from fork/codex/perf-consolidated-integration-stack at 264fb89dc5c867d6c3d77bc4b95e26e235e326ea; implementation branch is codex/perf-script-command-timeout-cleanup at f5cf07c.

Replaces

None

…ated-integration-stack

# Conflicts:
#	src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…ated-integration-stack

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime-renderers.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…ated-integration-stack

# Conflicts:
#	src/renderer/src/CameraExtension.tsx
…ated-integration-stack

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime.tsx
… into codex/perf-consolidated-integration-stack
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by consolidated lifecycle/media wave-2 PR: #575

@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #575.

@JustYannicc JustYannicc closed this Jul 4, 2026
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.

1 participant