Fix keepAlive supervisor in node SEA binary, fix relative path construction#1701
Fix keepAlive supervisor in node SEA binary, fix relative path construction#1701pirate wants to merge 42 commits into
Conversation
|
6761dda to
78b6690
Compare
78b6690 to
a0c8b31
Compare
Greptile SummaryThis PR refactors path resolution across the codebase to use Key Changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Stagehand Init] --> B{Environment?}
B -->|Node.js| C[Launch via cli.js]
B -->|SEA Binary| D[sea-entry.ts]
C --> E{Args contain --supervisor?}
D --> E
E -->|Yes| F[Parse config from argv]
E -->|No| G[Start Stagehand Server]
F --> H[supervisor.ts runs]
H --> I[Setup stdin lifeline]
H --> J[Setup IPC channel]
I --> K{Parent alive?}
J --> L{Receive message?}
K -->|stdin closes| M[Trigger cleanup]
L -->|exit message| N[Exit without cleanup]
M --> O{keepAlive?}
O -->|false| P[Cleanup resources]
O -->|true| Q[Exit gracefully]
P --> R{Config kind?}
R -->|LOCAL| S[Kill Chrome + Remove temp profile]
R -->|STAGEHAND_API| T[Request Browserbase session release]
S --> U[Exit]
T --> U
Q --> U
N --> U
Last reviewed commit: 1f9629d |
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="turbo.json">
<violation number="1" location="turbo.json:18">
P2: API secret keys in `globalEnv` will unnecessarily bust all build caches. `globalEnv` vars are hashed into every cacheable task's key — but build/lint tasks never use `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, etc. Previously these were only in test task `env` arrays (which all have `cache: false`), so they had zero caching impact. Rotating any API key will now invalidate all build caches.
Consider keeping only build-relevant variables in `globalEnv` (e.g., `CI`, `NODE_OPTIONS`, `NODE_V8_COVERAGE`, `CHROME_PATH`) and either moving the API keys back to task-specific `env` or using Turborepo's `globalPassThroughEnv` so they're available but not hashed.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/ci.yml">
<violation number="1" location=".github/workflows/ci.yml:670">
P2: The `merge-coverage` job is unconditionally disabled with `if: false`. This means no merged code-coverage report will ever be generated or uploaded. If this is a temporary measure, consider adding a TODO/tracking issue reference so it doesn't stay disabled indefinitely. If coverage reporting has moved elsewhere, this entire job block should be removed to avoid confusion.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Resolve paths relative to each source module instead of the repo root to stabilize ESM/CJS behavior, CI, and packaging. Adds a supervisor CLI/API and SEA entry that avoid bin resolution, improves Turbo caching, and makes page and session timeouts configurable (first page: 5s default, 30s in CI; Browserbase session: 60s in CI).
Refactors
New Features
Written for commit 9782860. Summary will update on new commits. Review in cubic