Commit Graph

6 Commits

Author SHA1 Message Date
ShawnPana 454dbfdaba style: flatten assert to pass pre-commit formatter 2026-04-02 12:34:27 -07:00
ShawnPana 7db93b7ac7 fix: accept shutting-down race in test_close_orphaned_daemon
SIGTERM may not kill daemon before the CLI re-probes, producing a
"daemon may still be shutting down" warning instead of "Browser closed".
2026-04-02 12:28:15 -07:00
ShawnPana 0bf1f02d97 fix: CI failures — ruff formatting, type errors, test_setup_command
- Ruff format all skill_cli and test files
- Fix type: get_config_value returns str|int|None, callers cast properly
- Fix type: BrowserWrapper.actions is non-optional (always provided)
- Fix type: config comparison uses 'is' not '=='
- Rewrite test_setup_command for new setup.handle(yes=True) API
- Add None guard in test_cli_lifecycle for state file
2026-04-01 19:58:33 -07:00
ShawnPana 8577c789eb fix: close log file handle on successful daemon start in test 2026-04-01 19:29:27 -07:00
ShawnPana d59c0e6984 fix: CLI reconciliation gaps found by codex review
- ensure_daemon now phase-aware: waits for initializing/starting/
  shutting_down with staleness timeouts, errors on unhealthy sessions
- _close_session only cleans files after confirmed PID death
- _handle_sessions won't delete live daemon's files on stale terminal state
- _probe_session uses socket_pid for split-brain PID resolution
- _is_daemon_process works on Windows (wmic)
- Updated + added robustness tests (codex-authored)
2026-03-30 19:49:57 -07:00
ShawnPana 7c7fd37220 test: add daemon lifecycle tests with real subprocess daemons
15 tests covering state file transitions, _probe_session branches (live
daemon, dead PID, no files, corrupt state), close via socket, close
orphaned daemon, close --all with mixed sessions, sessions listing with
phase column, and stale/terminal state cleanup.

Uses real daemon subprocesses with BROWSER_USE_HOME overridden to temp
dirs. No mocking.
2026-03-30 19:09:00 -07:00