Skip to content

Sessions#5

Merged
roodboi merged 11 commits intomainfrom
sessions
Jan 22, 2026
Merged

Sessions#5
roodboi merged 11 commits intomainfrom
sessions

Conversation

@roodboi
Copy link
Contributor

@roodboi roodboi commented Jan 22, 2026

No description provided.

…ding

This fixes HTTPS access to local dev domains (*.hack) when running with
OrbStack and/or Tailscale VPN active. OrbStack's localhost port forwarding
has issues with TLS on port 443 - IPv4 connections time out (stuck in
SYN_RCVD) and IPv6 TLS handshakes fail with internal errors.

Solution: Configure dnsmasq to return the Caddy container's static IP
(172.30.0.2) directly, bypassing OrbStack's port forwarding entirely.
This works reliably because:
- The container IP is stable (defined in compose template)
- Docker bridge networks are routable from macOS host
- No port forwarding layer means no TLS interception issues

Changes:
- global.ts: Configure dnsmasq with container IP instead of localhost
- doctor.ts: Accept container IP in checks, add migration from legacy configs
- doctor-utils.ts: Accept container IP, IPv6, and legacy IPv4 configs
- Added DNS cache flushing after config changes (dscacheutil + mDNSResponder)
- Auto-migration: doctor --fix updates old 127.0.0.1/::1 configs

Also includes session management improvements, tickets extension updates,
biome linting setup, and various code quality improvements.
- Rename `escape` to `escaped` in config.ts (avoid shadowing global)
- Remove unused `isTailscaleRunning` function in doctor.ts
- Use template literal in session.ts for string concatenation
- Update README.md and docs/architecture.md to reflect container IP
  DNS resolution instead of localhost
Two issues fixed:

1. "Install Hack CLI.command" now signed with Developer ID certificate
   - Gatekeeper was blocking the unsigned .command file in the DMG
   - Now codesign --options runtime is applied before DMG creation

2. Local release script now generates hack-install.sh
   - Previously only the GitHub workflow created the download installer
   - Now build-macos-release.sh outputs both hack-install.sh and
     hack-VERSION-install.sh for upload to GitHub releases

This ensures local releases have all the same artifacts as CI releases.
Biome now only checks src/, tests/, and scripts/ directories.
Reduces checked files from 224 to 198 and removes false positives
from example code and vendored dependencies.
- Fix 285 useBlockStatements (auto-fixed)
- Fix 107 noNestedTernary (refactored to if-else/helpers)
- Fix 61 useTopLevelRegex (moved to module-level constants)
- Fix 58 useLiteralKeys (auto-fixed)
- Fix 24 useAwait (removed unnecessary async)
- Fix 20 noNonNullAssertion (added null checks)
- Fix misc warnings (shadow names, switch defaults, etc.)

Simplify biome.jsonc:
- Turn off rules for intentional patterns globally
- Keep test/script overrides for test-specific patterns
- Remaining 74 warnings are cognitive complexity (acceptable for CLI)

All tests pass.
Implements T-00075 with tmux session management via REST API:
- GET /v1/sessions - list sessions
- POST /v1/sessions - create session
- GET /v1/sessions/:id - get session details
- POST /v1/sessions/:id/stop - stop session
- POST /v1/sessions/:id/exec - execute command (with Enter)
- POST /v1/sessions/:id/input - send raw keystrokes
- Add `hack ssh` command for remote SSH access via Tailscale or direct SSH
- Show QR code for mobile SSH apps (Blink, Termius)
- Interactive clack prompts for method selection and session picking
- Add Tailscale status detection and turn-on prompt
- Update `hack session` picker to use clack instead of fzf
- Add attach/create-new option when session is attached elsewhere
- Use `tmux attach -d` to detach other clients (fixes terminal size conflicts)
- Add tailscale.ts library for Tailscale status and SSH command building
- Simplify session API SSH command (no tmux baked in)
Add comprehensive documentation for session management:
- docs/sessions.md: Session CLI commands, SSH access, and daemon API
- Update gateway-api.md to include sessions endpoints in summary
- Update docs/README.md to link to sessions documentation

Documents:
- hack session commands (list, start, stop, attach, exec)
- hack ssh command with Tailscale/direct support
- Daemon sessions API endpoints and examples
- global.ts: Use nullish coalescing for cloudflare config params
- tickets/commands.ts: Use union type for agent doc results
- daemon-sessions.test.ts: Use non-null assertion after null check
@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2026

⚠️ No Changeset found

Latest commit: 451a3a3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Running releases locally until Mac CI signing is configured.
The workflow can still be triggered manually via workflow_dispatch.
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Important

Review skipped

Too many files!

82 files out of 232 files are above the max files limit of 150.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Session route tests require tmux which isn't available in CI.
Use describe.skipIf to skip the entire test suite when tmux
is not found.
@roodboi roodboi merged commit a2e303c into main Jan 22, 2026
3 checks passed
@roodboi roodboi deleted the sessions branch January 22, 2026 03:47
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

Comments