Skip to content

feat(openclaude): OpenClaude CLI provider (#213) - #905

Open
ozymandiashh wants to merge 1 commit into
getagentseal:mainfrom
ozymandiashh:feat/213-openclaude-provider
Open

feat(openclaude): OpenClaude CLI provider (#213)#905
ozymandiashh wants to merge 1 commit into
getagentseal:mainfrom
ozymandiashh:feat/213-openclaude-provider

Conversation

@ozymandiashh

Copy link
Copy Markdown
Collaborator

Implements #213, with @iamtoruk's May yes standing as the feature sign-off (offered in the issue thread tonight; kick it back if that reading was too generous).

What OpenClaude turned out to be (this is why the provider is small): the active distribution is @gitlawb/openclaude on npm, and it is a Claude Code fork. Transcripts are Claude-Code-schema JSONL at ~/.openclaude/projects/<slug>/<uuid>.jsonl, tool names are already codeburn-canonical, usage is Anthropic-shaped. The provider therefore follows the cline-cli reference shape with no tool mapping table.

Semantics: only usage-bearing assistant lines become calls; queue-operation/last-prompt bookkeeping and replay.json siblings are skipped; isSidechain: true subagent lines are counted (real spend); no cost field exists in the transcript, so every call is priced through the shared tables with costIsEstimated: true; project = basename of the first cwd, slug fallback; CODEBURN_OPENCLAUDE_DIR overrides the root; probeRoots() reports the projects dir per the NEW_PROVIDER checklist.

Real local testing proof (CONTRIBUTING bar): I installed the actual CLI and generated real sessions against DeepSeek (--provider openai + base URL https://api.deepseek.com/v1, model deepseek-chat), then ran the provider end to end on them:

sources: 4, calls: 13, cost: $0.0062
models: [deepseek-chat, <synthetic>]
projects: [demo-proj, second-proj]   <- basename of real cwds
probeRoots: ~/.openclaude/projects (projects)

Honest limitation, documented in docs/providers/openclaude.md: streamed responses can split tool_use blocks across assistant events and only usage-bearing events are parsed, so tool breakdowns are a floor. Token and cost accounting are exact.

18 new tests (discovery incl. replay-skip, parsing, dedup across files sharing a session_id, sidechain counting, project resolution, cost estimation), registry updated, tsc --noEmit clean, 36/36 across the two touched suites.

OpenClaude is a Claude Code fork routing to any LLM; transcripts are
Claude-Code-schema JSONL under ~/.openclaude/projects/<slug>/<uuid>.jsonl
with replay.json siblings skipped. Only usage-bearing assistant lines
become calls; sidechain lines are counted as real spend; costs are always
computed (the transcript reports none) through the shared tables.

Real local testing: sessions generated with the actual CLI against
DeepSeek (deepseek-chat), parsed end to end.
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.

1 participant