fix: resolve build errors and add launcher script#168
fix: resolve build errors and add launcher script#168mattleaverton wants to merge 1 commit intodanshapiro:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af76a06933
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
scripts/launch.sh
Outdated
|
|
||
| # Wait for the URL to appear in log output (up to 30s) | ||
| for i in $(seq 1 60); do | ||
| if url_line=$(grep -o 'http://[^ ]*token=[^ ]*' "$LOG_FILE" 2>/dev/null | head -1); then |
There was a problem hiding this comment.
Strip ANSI escapes before persisting startup URL
The URL extraction regex reads directly from server.log, but startup URLs are printed with ANSI color wrappers, so grep -o 'http://[^ ]*token=[^ ]*' captures trailing escape bytes (for example \x1b[0m) as part of the match. This makes ~/.freshell/url contain non-printable characters, which can break downstream consumers that parse or open the saved URL programmatically.
Useful? React with 👍 / 👎.
scripts/launch.sh
Outdated
| cd "$FRESHELL_DIR" | ||
|
|
||
| # Check for already-running server | ||
| if [[ -f "$PID_FILE" ]] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then |
There was a problem hiding this comment.
Verify PID ownership before declaring server already running
The startup guard only checks whether the PID in server.pid exists via kill -0; if a stale PID file points to a reused PID from an unrelated process, the script exits early with "already running" even though Freshell is not running. This false-positive blocks recovery after crashes/reboots until users manually remove the pid file.
Useful? React with 👍 / 👎.
|
Addressed both review items in 6e0d41d:
|
6e0d41d to
9fb7305
Compare
Add scripts/launch.sh that pulls upstream and builds when on main, or warns and proceeds when on another branch. Starts the server backgrounded and captures the access URL to ~/.freshell/url. Validates PID ownership before declaring server already running (checks process args, not just PID existence). Strips ANSI escapes from log output before extracting the URL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9fb7305 to
ae46942
Compare
Summary
server/agent-api/layout-store.ts—ensurePaneTitleMaps()guarantees nested objects exist but TypeScript can't narrow across function boundaries; added non-null assertions at the call siteslean-qr—SetupWizard.tsxwas statically importing whileApp.tsxdynamically imported, defeating code splitting. Switched SetupWizard to dynamic imports to matchscripts/launch.sh— one-command server startup that pulls upstream, builds, launches the server backgrounded, and captures the access URL to~/.freshell/urlTest plan
npm run buildpasses with no errors or warningsnpm testpasses (2 pre-existing failures unrelated to these changes)svg-DjJviKnF.js+index-BnEwwU7r.js)🤖 Generated with Claude Code