Skip to content

Integrate PR #7 macOS support with current main - #11

Merged
llm-learner merged 9 commits into
llm-learner:mainfrom
lska367:codex/macos-support-upstream
Sep 26, 2026
Merged

llm-learner merged 9 commits into
llm-learner:mainfrom
lska367:codex/macos-support-upstream

Conversation

@lska367

@lska367 lska367 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

PR #7's macOS changes now conflict with upstream main after the multi-agent updates. This PR integrates those changes with the current hook and scorer interfaces so the macOS support can be reviewed and merged here.

  • Add macOS/Linux hook installation and uninstall that preserve unrelated Codex hooks.
  • Add the macOS menu bar display and a web fallback when native UI dependencies are unavailable, while retaining Windows behavior.
  • Remove Codex's ambient browser context before scoring the direct user request. For example, 现在呢? scores as four characters even when the app prepends a long browser-state block.
  • Add installed-hook end-to-end coverage for charging, duplicate events, background skips, uninstall, and ambient context.

Validation: 104 Python tests passed (7 platform/dependency skips); the dashboard JavaScript regression test passed. Supersedes #7.

fuxiuht and others added 9 commits September 25, 2026 15:36
install_hooks.py merges headroom's SessionStart and UserPromptSubmit hooks
into $CODEX_HOME/hooks.json without touching other hooks, backs up a
changed file, is idempotent, and supports --dry-run and --uninstall.
Hook commands use the installing Python (python3), shell-quoted, with no
PowerShell. It refuses interpreters older than 3.10, can set
HEADROOM_DISPLAY for SessionStart (--display), and can symlink the skill
into ~/.agents/skills (--link-skill). install.sh finds Python 3.10+.

The non-destructive merge/backup/uninstall design follows the installer
from PR llm-learner#2 on the wenkesheng branch.

Co-authored-by: cat0825 <97736187+cat0825@users.noreply.github.com>
- Tray: on macOS the pystray status item runs detached on Tk's main
  thread (AppKit requirement) and hides the Dock icon.
- Desktop: POSIX flock single-instance lock, Aqua transparency, fonts,
  right-click and colored buttons; the card opens below the menu bar.
- The WebView2 card stays Windows-only; elsewhere the Tk card is the
  default, and a missing Tk/pystray falls back to the web dashboard.
- tkinter is imported lazily so Pythons without Tk still work.
- Hook: detach display processes into a new session on POSIX.
- headroom.py --codex-home honors CODEX_HOME like the hook/dashboard.
- Node test defaults to python3 outside Windows.
Add platform tests (installer dry-run/merge/uninstall in a temporary HOME,
hook command generation, detached launches, POSIX lock, menu bar logic)
that run on any OS, and replace the manual macOS/Linux README steps with
the installer and the menu bar display in both languages.
@llm-learner
llm-learner merged commit 72185fd into llm-learner:main Sep 26, 2026
12 checks passed
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.

3 participants