Skip to content

install into openclaw, pi, and hermes - #14

Open
DexterStorey wants to merge 6 commits into
mainfrom
harness-installs
Open

install into openclaw, pi, and hermes#14
DexterStorey wants to merge 6 commits into
mainfrom
harness-installs

Conversation

@DexterStorey

@DexterStorey DexterStorey commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #11.

tokenmaxx install <openclaw|pi|hermes> adds a tokenmaxx-anthropic and a tokenmaxx-openai provider to that harness's config, pointed at the local proxy. tokenmaxx uninstall <target> removes exactly what we added, and doctor reports each harness that exists on the machine as routed or not.

Per harness, from each project's current docs and source:

  • OpenClaw: providers merge into models.providers in ~/.openclaw/openclaw.json, with the schema-required model entries, adapters (anthropic-messages, openai-responses), and zeroed cost. We never touch agents.defaults.model; picking a tokenmaxx model stays the user's choice. If the file uses JSON5 comments, we leave it alone and print the exact block to paste, rather than eating their comments.
  • Pi: providers merge into ~/.pi/agent/models.json, which pi re-reads every time /model opens, so no restart is needed.
  • Hermes: a marked block appends to ~/.hermes/config.yaml with api_mode set explicitly for each endpoint, since hermes only auto-detects the mode for the anthropic host. If the config already has a providers: mapping, we print instructions instead of writing, because yaml duplicate keys silently override and we will not stomp someone's providers.

The proxy now speaks the ChatGPT backend's dialect

Config alone was not enough. Harnesses send standard Responses API requests: system prompts as messages in the input array, and max_output_tokens set. The ChatGPT codex backend rejects both (400 System messages are not allowed, Unsupported parameter: max_output_tokens). The proxy now adapts requests on the openai route for OAuth accounts: system and developer messages lift into instructions, and max_output_tokens is dropped. Codex's own requests already have that shape, so the adapter is a no-op for them. API-key accounts hit api.openai.com, where the standard shape is correct, so they are left untouched.

The openai provider ships exactly one model, gpt-5.6-sol. We probed the backend live, and that is the only id it accepts for subscription accounts.

Anthropic route wants an API key

Anthropic bills third-party harness traffic to extra usage rather than the plan window, and their terms do not allow subscription auth from third-party harnesses. So the anthropic provider pairs with #10's API-key accounts: add one with tokenmaxx login claude --api-key, make it the active anthropic account, and harness traffic routes and meters against it.

Tested for real

Every cell of the matrix is a live completion through the actual harness binary into the running proxy, verified against the daemon's metering:

harness openai route (codex OAuth) anthropic route (API key)
openclaw 2026.7.1-2 ✅ 18,479 in / 13 out ✅ 26k cache-create / 20 out
pi 0.81.1 ✅ 17 in / 11 out ✅ 495 in / 41 out
hermes 0.19.0 ✅ 11,494 in / 13 out ✅ 14k cache-create / 20 out

Each run appears in token_events under the right account, so the dashboard's analytics count harness traffic like any other. An install, a live completion, then an uninstall leaves zero residue in all three configs, and doctor shows a per-harness line for whichever of the three are installed.

Unit tests cover the three writers (including the JSON5 and existing-providers: fallbacks) and the dialect adapter.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

try this branch: bun add -g tokenmaxx@0.0.60-alpha.81

Third-party harnesses send standard Responses requests: system messages
in the input array and max_output_tokens set. The ChatGPT codex backend
rejects both. The proxy now adapts oauth-bound openai requests (system
and developer messages move into instructions, max_output_tokens drops)
so openclaw, pi, and hermes work without harness-specific dialects.
Also ships only gpt-5.6-sol — the one model the backend accepts.
A harnesses box joins settings: green on when routed, warn off with an
enter hint when installed but not routed, grey when the harness is not
on the machine (binary or config detection). Enter installs or removes
the providers inline — no CLI round-trip. The settings tab now windows
its rows to the terminal height with more indicators, and the 2s
background tick no longer holds the busy flag that was eating
keypresses.
A panel cut off by scrolling keeps its title but drops its bottom
border, so it reads as continuing into the more line instead of
finished.
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.

install into openclaw, pi, and hermes

1 participant