mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
Both third-party CLI context tools are removed, and with them the context-tool selector itself. Headroom no longer downloads, installs or configures either one, and there is no replacement. The previous pass (#2344) gated only three entry points inside headroom/cli/wrap.py, which left the feature reachable in practice: * scripts/install.sh and install.ps1 ran `rtk init --global --auto-patch` from bash/PowerShell, bypassing the Python gate entirely, so `curl | sh` still wrote a Claude Code PreToolUse hook regardless of HEADROOM_RTK. * `wrap openhands` was broken by default: rtk_required=True met a gate returning None and raised SystemExit(1). Every openhands test patched _ensure_rtk_binary to a fake path, so it was invisible. * The proxy shelled out to `rtk gain` from /stats, the dashboard and `headroom perf`, and the subscription tracker polled it per contribution. * Nothing removed artifacts an earlier default had already installed, so a machine that once ran the old default kept rtk in the loop forever. Removed: the headroom/rtk and headroom/lean_ctx packages, headroom/cli/wrap_rtk_metrics.py, _selected_context_tool / _setup_context_tool_for_agent / _VALID_CONTEXT_TOOLS, the --rtk, --no-rtk, --no-project-rtk and --keep-rtk flags, HEADROOM_RTK*, the proxy-side gain polling and the dashboard CLI-filtering panel. --context-tool / --no-context-tool / HEADROOM_CONTEXT_TOOL survive only to fail loudly. They live in shell profiles, aliases and CI jobs, and accepting them as a no-op would read as Headroom having quietly stopped working. The installers reject them too: their arg parsers forward the first unknown flag *and everything after it* to the wrapped tool, so a leftover --no-rtk would have silently swallowed a following --port and been ignored downstream. Added headroom/context_tool_cleanup.py. Deleting the code cannot help a machine that already ran the old default, so purge_context_tool_artifacts() runs once per wrap/unwrap and removes the registered hook entries, the generated hook scripts, the Headroom-managed ~/.local/bin symlinks, the vendored ~/.headroom/bin/{rtk,lean-ctx} binaries, the lean-ctx MCP server entry and the injected instruction fences. It is idempotent, skips a malformed config rather than overwriting it, and only unlinks a symlink that resolves inside Headroom's own bin dir, so a user's own build is untouched. It reports on stderr, because `wrap/unwrap openclaw --prepare-only` emit machine-readable JSON on stdout as their entire contract. It is skipped for `wrap selfheal` (runs from a SessionStart hook, must not race Claude Code's writer for ~/.claude.json) and for --help, which must stay read-only. Also hardens the client-config writes this work touched. wrap.py reset a settings file to {} when an existing file would not parse and then wrote that back, turning one hand-edited typo or a transient read error into total loss of a user's permissions/env/hooks on every `wrap claude`; it now refuses to write. fsutil.write_text is atomic (temp file + fsync + os.replace), which fixes all 14 non-atomic client-config writes at once, follows symlinks rather than replacing them, and preserves an existing file's mode. rtk stays in the wrapper-peel list in transforms/content_router.py on purpose: it sits beside sudo/env/timeout as shell-command grammar, so `rtk cat f` is still classified as a file read for anyone running their own rtk install, which the purge deliberately leaves alone. |
||
|---|---|---|
| .. | ||
| app | ||
| components | ||
| content/docs | ||
| lib | ||
| overrides | ||
| screenshots | ||
| .gitignore | ||
| bun.lock | ||
| claude-code-bedrock-headroom.md | ||
| next.config.mjs | ||
| observability.md | ||
| package-lock.json | ||
| package.json | ||
| platform-feature-matrix.json | ||
| platform-stabilization.md | ||
| postcss.config.mjs | ||
| proxy.ts | ||
| README.md | ||
| source.config.ts | ||
| tsconfig.json | ||
| vercel.json | ||
docs
This is a Next.js application generated with Create Fumadocs.
Run development server:
npm run dev
# or
pnpm dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
Explore
In the project, you can see:
lib/source.ts: Code for content source adapter,loader()provides the interface to access your content.lib/layout.shared.tsx: Shared options for layouts, optional but preferred to keep.
| Route | Description |
|---|---|
app/(home) |
The route group for your landing page and other pages. |
app/docs |
The documentation layout and pages. |
app/api/search/route.ts |
The Route Handler for search. |
Fumadocs MDX
A source.config.ts config file has been included, you can customise different options like frontmatter schema.
Read the Introduction for further details.
Learn More
To learn more about Next.js and Fumadocs, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- Fumadocs - learn about Fumadocs