Incorporate verified upstream fixes (#1504, #1596, #1562)#6
Merged
Conversation
…#1596, obra#1562) Cherry-picks three verified fixes from obra/superpowers open PRs into the fork. - obra#1504: guard handleMessage against null/primitive WebSocket payloads. JSON.parse('null') returns null; reading .choice on it threw a TypeError that escaped the socket 'data' handler and killed the server process. - obra#1596: make the brainstorm server idle timeout configurable via --idle-timeout-minutes (BRAINSTORM_IDLE_TIMEOUT_MS) and raise the default from 30 minutes to 2 hours. Surface idle_timeout_ms in server-info. - obra#1562: detect the package manager by lockfile in using-git-worktrees Step 3 (pnpm/yarn/bun/npm for Node, uv/poetry/pip for Python) instead of running npm install / poetry install unconditionally. Verified: brainstorm-server suite 32/32 green (includes new null-crash and idle-timeout regression tests); --idle-timeout-minutes checked end-to-end (5 -> 300000ms, default -> 7200000ms, 0/abc -> error + exit 1).
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.
Summary
Incorporates three fixes from
obra/superpowersopen PRs into this fork. Each was diff-reviewed against our current files and empirically verified before inclusion (not just trusted from the upstream description).null/primitive WebSocket payloads.JSON.parse('null')returnsnull; reading.choiceon it threw aTypeErrorthat escaped the socket'data'handler and killed the process. Fixed with anevent && event.choiceguard.--idle-timeout-minutes(BRAINSTORM_IDLE_TIMEOUT_MS), default raised from 30 min → 2 h, andidle_timeout_msis surfaced inserver-info.using-git-worktreesStep 3 now detects the package manager by lockfile (pnpm/yarn/bun/npm for Node, uv/poetry/pip for Python) instead of unconditionally runningnpm install/poetry install, which breaks pnpm/yarn workspaces and uv/hatch/pdm projects.Files:
server.cjs,start-server.sh,visual-companion.md,using-git-worktrees/SKILL.md,tests/brainstorm-server/server.test.js(+144/−13).Test Plan
node --check server.cjsandbash -n start-server.sh— both clean; SKILL.md Step 3 bash block parses.npm test(brainstorm-server) — 32/32 pass, including 3 new fix(brainstorm-server): guard handleMessage against null event payload obra/superpowers#1504 null/primitive crash tests and 5 new fix: make visual companion idle timeout configurable obra/superpowers#1596 timeout tests.--idle-timeout-minutes:5→idle_timeout_ms:300000; no flag →7200000;0andabc→ error JSON + exit 1.Notes
Internal incorporation PR against the fork — not a contribution to
obra/superpowers. From the same triage, obra#1558 (ultrathink keyword) and obra#1097 (worktree timing) were evaluated and dropped: obra#1558 targets a non-existent problem (the keyword is lowercase/case-sensitive and fires on the user prompt) and obra#1097's worktree is created downstream at execution time by design.