RFC/draft: add OpenClaw as a 5th provider#28
Draft
wook95 wants to merge 2 commits intoaroido:mainfrom
Draft
Conversation
Mirrors the codex file-watch pattern. Watches
~/.openclaw/agents/<agent>/sessions/<session>.jsonl and ingests usage
events from message.usage.{input,output,cacheRead,cacheWrite}, with the
session id taken from the file basename.
- 4 new files under Sources/Tokenmon{Providers,Persistence}/Openclaw*
(storage locator, observer, backfill adapter, recovery service)
- case .openclaw on ProviderCode and the switch sites the compiler
surfaces (UI views, persistence, automation, presentation)
- en/ko Localizable.strings for the new provider states
a5e9bc5 to
a2e4fd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First-time contributor. I have a separate PR (#27) opening for mise/asdf executable discovery; this one is bigger and I'm marking it draft because I'd like to confirm direction before asking for review.
I run openclaw (367k★, multi-channel AI assistant) locally as a daily-driver gateway in front of Anthropic, OpenAI, Gemini, and Bedrock. It writes JSONL session files under
~/.openclaw/agents/<name>/sessions/<session-id>.jsonlwith token usage on each assistant message atmessage.usage.{input,output,cacheRead,cacheWrite}. Same shape as the Codex transcript adapter you already have, just a different on-disk layout — so I mirrored the Codex file-watch pattern exactly:Sources/Tokenmon{Providers,Persistence}/Openclaw*.swift(storage locator, observer, backfill adapter, recovery service)case .openclawonProviderCodeplus the switch sites the compiler surfacesswift buildis clean. I have not added new unit tests; the new files mirror the Codex provider's coverage shape (which also has no dedicated unit tests in the public repo). Happy to add tests if you want — just let me know what level of coverage you'd accept.A generic external-JSONL-provider plugin is the obvious alternative, but I'd rather not push schema knowledge onto users. Most people just want a zero-config experience for tools they already have installed.
If you accept this in principle, I'll commit to staying on top of bug reports filed against the openclaw paths. Issues are disabled on this repo so I'm using a draft PR as the RFC vehicle — please don't hesitate to close if this isn't a direction you want to take.