Repository navigation
Conversation
…dows launcher PR #1004 (#1002) routed three of the four detached launches through the hidden wscript.exe launcher; SessionStart's own consolidation launch was deferred because inlining lib-detach.sh directly into session-start-hook.sh would push that hook's compiled size over its 120 KiB release-tree budget (check_release_tree.py's HOOK_SCRIPT_MAX_BYTES), with no margin left to absorb it. Adds scripts/consolidation-launch.sh, a separate, non-hook file that sources lib-detach.sh and decides Windows vs. the unchanged nohup fallback in its OWN process, invoked synchronously from session-start-hook.sh's staging-backlog branch. Since this file is not one of compile_hooks.py's four HOOK_SCRIPT_NAMES, lib-detach.sh's compiled body is never inlined into session-start-hook.sh's own output, so the call site there shrinks to one line and the hook's own byte budget stays comfortably under its 120 KiB cap (52-byte margin, measured against the real release-tree build) instead of needing ~4.5 KB of unrelated code removed elsewhere -- lib-detach.sh has grown substantially since #1004 (TTL caching, slow- verdict throttling), so the ~1,518-byte estimate in the issue is stale. tests/test_windows_hidden_detach_1002.py's own regression guard (test_every_nohup_detach_site_guards_with_the_shared_helper) now also names consolidation-launch.sh, the file that actually calls _remember_detach_windows. SessionEnd's self-redetach and the Antigravity Stop hook's save remain out of scope, per the issue's own narrowing (a real stdin-inheritance regression caught under review on PR #1004). docs/windows.md and lib-detach.sh's own module comment updated to reflect SessionStart's consolidation as wired. Co-Authored-By: Claude Sonnet 5 <[email protected]>
tests/test_windows_skip_triage_497.py failed on every ubuntu-latest leg of PR #1065 (the fix/1006 branch): tests/test_session_start_windows_detach_1006.py carries a module-level win32 blanket skip (its own fixture stubs wscript.exe, which only exists conceptually on Windows CI -- the test is Linux/macOS-only by design) but was never added to docs/windows-skip-triage.md, which this repo's own convention (#497, #589) requires in the same commit that introduces a new blanket skip. Verdict: unclear -- same ambiguity as the table's templated majority. The reason names the bash-subprocess dependency plus an unspecified "stub-based simulation" claim; the stubs themselves are plain shell scripts, so whether Git-Bash discovery alone would let this run on a real win32 runner, or whether something else about the harness blocks it, is not settled by the reason string alone. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…launch MEDIUM: scripts/session-start-hook.sh's staging-backlog branch invoked consolidation-launch.sh synchronously. That file's Windows route (_remember_detach_windows, lib-detach.sh) waits on wscript.exe up to a 15s watchdog cap, not "a few milliseconds" as the comments there and in the changelog fragment claimed -- so this reintroduced the #646 SessionStart-stall class. Fixed by backgrounding the call (trailing `&`); its exit status was already unused. Added a red-then-green test (test_session_start_returns_promptly_even_when_windows_route_is_slow) that stubs wscript.exe to sleep 5s and asserts the hook still returns well under that, paired with the positive control that the hidden route still actually runs in the background. LOW: the existing Windows-route test asserted `not marker.exists()` immediately after subprocess.run() returned, racing the backgrounded nohup fallback -- a double launch could have passed undetected. Both that assertion and the `captured.exists()` check now use a bounded (up-to-5s) wait, matching the sibling nohup test's own poll. Corrected the stale "a few milliseconds" / "SYNCHRONOUSLY" claims in consolidation-launch.sh's header and session-start-hook.sh's call-site comments, and updated the changelog fragment to describe the backgrounded launch. session-start-hook.sh's compiled size grows by 2 bytes (the trailing ` &`) -- 122,830 bytes built, still under the 122,880-byte release-tree budget. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1006.
PR #1004 (#1002) routed three of the four detached launches through the hidden
wscript.exelauncher;session-start-hook.sh's own consolidation launch was deferred because inlininglib-detach.shdirectly would push that hook's compiled size over its 120 KiB release-tree budget (check_release_tree.py'sHOOK_SCRIPT_MAX_BYTES), with no margin left to absorb it.What changed
Adds
scripts/consolidation-launch.sh, a separate, non-hook file that sourceslib-detach.shand decides Windows vs. the unchangednohupfallback in its OWN process, invoked synchronously fromsession-start-hook.sh's staging-backlog branch. Since this file is not one ofcompile_hooks.py's fourHOOK_SCRIPT_NAMES,lib-detach.sh's compiled body is never inlined intosession-start-hook.sh's own output, so the call site there shrinks to one line and the hook's own byte budget stays comfortably under its 120 KiB cap (52-byte margin, measured against the real release-tree build).tests/test_windows_hidden_detach_1002.py's own regression guard (test_every_nohup_detach_site_guards_with_the_shared_helper) now also namesconsolidation-launch.sh, the file that actually calls_remember_detach_windows.session-end-hook.sh's self-redetach and the Antigravity Stop hook's save remain out of scope, per the issue's own narrowing (comment on #1006, 2026-10-09) -- SessionEnd has a real stdin-inheritance regression blocking it, and Antigravity Stop is lower priority.docs/windows.mdandlib-detach.sh's own module comment are updated to reflect SessionStart's consolidation launch as wired.A stale premise in the issue, corrected
The issue's byte-budget estimate (~1,518 bytes to inline the detach helper) was stale:
lib-detach.shhas grown substantially since #1004 (TTL caching, slow-verdict throttling), and its real comment-stripped size is 4,236 bytes -- the true inlining cost is ~4,536 bytes, about 3x the issue's estimate. Rather than hunting that much removable code out of an already tight, heavily tested hook (candidates considered and rejected: extracting_remember_prune_stale_session_filesor the promo-JSON-wrapping block, both of which still inline the same bytes viacompile_hooks.pysince they'd be sourced by the same hook), this PR satisfies the issue's own alternative phrasing ("a... separately compiled helper") by moving the dispatch to a filecompile_hooks.pynever inlines at all, rather than shrinkingsession-start-hook.sh's own existing code as the issue's first phrasing describes. Flagging this explicitly for review.Below-bar finding (not filed, recorded here)
The new
consolidation-launch.shdispatch (hidden launcher vs.nohup) is REASONED, not OBSERVED, on real Windows: windows-latest CI exerciseslib-detach.shandpost-tool-hook.sh's own call site against a realwscript.exe(tests/test_windows_real_wscript_1002.py), but not this new call path, and the new test (tests/test_session_start_windows_detach_1006.py) is stub-based and skipped on win32. This is the same REASONED-not-OBSERVED gap the whole Windows-hidden-detach feature already discloses for itself (lib-detach.sh's own module docstring anddocs/windows.mdboth say so explicitly), now extended by one more call site -- not a new defect introduced by this diff. Adding a real-wscript.exeCI leg for this one path was judged too risky to attempt blind (no Windows box to verify against) within this change's scope.Tests
Red: reverted
session-start-hook.shto its pre-fix state and removedscripts/consolidation-launch.sh;tests/test_session_start_windows_detach_1006.pywent 1 failed (hidden-launcher test), 1 passed (non-Windows positive control, correctly still green).Green: restored both files; 2 passed.
Also green:
tests/test_strip_shell_comments_900.py,tests/test_release_branch_check_900.py(including the realcheck_release_tree.pyrun against this repo's own built tree),tests/test_windows_hidden_detach_1002.py(full file),tests/test_session_start_fd_leak_646.py(end-to-end through the new chain),tests/test_delivery_record_pruning_373.py-- 70 total passed. Fullpytestnot run locally, per this repo's own CI-is-the-gate policy; CI covers the full matrix.🤖 Generated with Claude Code
[AI-generated]