Skip to content

Commit d524d8f

Browse files
committed
docs: polish README and metadata for the public repository
Add CI badge, Compatibility section (tool calls, reasoning levels, streaming/usage, transport routing — all verified against the live API), Troubleshooting section, and updated develop/test/file listings. Add repository/homepage/bugs/author metadata to package.json.
1 parent 0fb18df commit d524d8f

3 files changed

Lines changed: 57 additions & 8 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ Command Code (commandcode.ai) model provider plugin for OpenClaw, with three-tie
2929

3030
## Testing instructions
3131

32-
- Unit tests: `npm test` (Vitest, `test/modelMapping.test.ts`)
32+
- Unit tests: `npm test` (Vitest, `test/modelMapping.test.ts`) — covers the projection, the dynamic model resolver, and a drift guard that compares the manifest `modelCatalog` against the baseline projection
3333
- Discovery smoke: `node scripts/smoke.discovery.mjs` (hits the live public endpoint)
3434
- Live inference: `node scripts/live-test.mjs` (reads the key from `~/.openclaw/secrets/providers.json`, never prints it)
35-
- Baseline refresh: `node scripts/generate-baseline.mjs` (rewrites `src/baseline.models.ts` **and** the `modelCatalog` block of `openclaw.plugin.json` from the same projection as `projectModel` in `index.ts` — keep the two in sync)
35+
- Baseline refresh: `node scripts/generate-baseline.mjs` (rewrites `src/baseline.models.ts` **and** the `modelCatalog` block of `openclaw.plugin.json` from the same projection as `projectModel` in `index.ts` — keep the two in sync), then `npm run build` to refresh `dist/`
36+
- CI also fails when the committed `dist/` does not match a fresh build — always rebuild before committing source changes
3637
- Add tests for every new behavior; all tests must pass before opening a PR
3738

3839
## PR & commit conventions

README.md

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# openclaw-command-code
22

3+
[![CI](https://github.com/TheStreamCode/openclaw-command-code/actions/workflows/ci.yml/badge.svg)](https://github.com/TheStreamCode/openclaw-command-code/actions/workflows/ci.yml)
4+
35
Command Code ([commandcode.ai](https://commandcode.ai)) model provider plugin for
46
OpenClaw, with **three-tier model resolution**: a generated static baseline for
57
pre-credential discovery, a live catalog refreshed at runtime, and a dynamic
@@ -102,6 +104,27 @@ Then select a model, e.g.:
102104
openclaw config set agents.defaults.model.primary "commandcode/deepseek/deepseek-v4-flash"
103105
```
104106

107+
## Compatibility
108+
109+
Verified against the live Provider API through OpenClaw's OpenAI-compatible
110+
transport (endpoint class `custom`, payload captured and inspected):
111+
112+
- **Tool calls**: OpenAI function-calling format (`tools`, `tool_choice`,
113+
`tool_calls` results) — full tool loops work in agent runs.
114+
- **Reasoning levels**: OpenClaw `--thinking` levels are sent as
115+
`reasoning_effort` (+ `thinking: {"type": "enabled"}`) and accepted;
116+
reasoning content is streamed back in `reasoning`/`reasoning_details`.
117+
- **Streaming + usage**: SSE streaming with `stream_options.include_usage`;
118+
token usage and prompt-cache hits (`cacheRead`) are accounted.
119+
- **Output budgets**: both `max_completion_tokens` and `max_tokens` are
120+
accepted by the endpoint.
121+
- **Transport routing**: `claude-*` ids use Anthropic Messages
122+
(`/provider/v1/messages`); every other model uses OpenAI Chat Completions
123+
(`/provider/v1/chat/completions`).
124+
125+
Model availability depends on your Command Code plan: models outside the plan
126+
return HTTP `403 MODEL_NOT_IN_PLAN` (see Troubleshooting).
127+
105128
## Model resolution
106129

107130
The static baseline, the manifest catalog, and the live catalog share one
@@ -127,12 +150,25 @@ conservative provider-neutral definition (by `claude-*` transport convention
127150
where applicable), so newly published models work without re-installing the
128151
plugin or refreshing the baseline.
129152

153+
## Troubleshooting
154+
155+
- **`No API key found for provider "commandcode"`** — inference requires a
156+
resolvable key. Configure one as shown in [Configure auth](#configure-auth)
157+
and check `openclaw models auth list`.
158+
- **HTTP `403 MODEL_NOT_IN_PLAN`** — the selected model is not included in
159+
your Command Code plan. Pick a model your plan covers, or upgrade the plan /
160+
enable on-demand usage on commandcode.ai.
161+
- **HTTP `403 upgrade_required`** — the Go plan has no Provider API access.
162+
- **Model missing from `models list`** — refresh the bundled snapshot with
163+
`node scripts/generate-baseline.mjs` (the live catalog picks new models up
164+
automatically at runtime anyway).
165+
130166
## Develop / Test
131167

132168
```bash
133169
npm install
134170
npm run build # tsc -> dist/index.js
135-
npm test # vitest: transport + projection + dynamic resolution
171+
npm test # vitest: projection, dynamic resolution, manifest drift guard
136172
node scripts/generate-baseline.mjs # refresh baseline + manifest modelCatalog
137173
node scripts/smoke.discovery.mjs # static(pre-credential) + live discovery smoke
138174
node scripts/live-test.mjs # live inference (reads the key from ~/.openclaw/secrets/providers.json)
@@ -147,9 +183,10 @@ TypeScript-source fallback only applies to local dev paths (`plugins.load.paths`
147183
`prepack` script also builds it for npm publish).
148184

149185
A GitHub Actions workflow (`.github/workflows/ci.yml`) runs type-check, build,
150-
and unit tests on every push to `main` and on pull requests. Updates to this
151-
tooling are applied manually on purpose — there is no Dependabot or any other
152-
automatic update / notification bot configured.
186+
unit tests, and a freshness check that fails when the committed `dist/` does
187+
not match the TypeScript sources, on every push to `main` and on pull
188+
requests. Updates to this tooling are applied manually on purpose — there is
189+
no Dependabot or any other automatic update / notification bot configured.
153190

154191
## Publish (optional)
155192

@@ -169,11 +206,13 @@ src/baseline.models.ts # generated baseline snapshot (never hand-edited)
169206
openclaw.plugin.json # manifest (provider id, auth env var, onboarding choice, modelCatalog)
170207
package.json # package + openclaw extension metadata
171208
LICENSE # MIT
172-
test/modelMapping.test.ts # vitest unit tests (transport, projection, dynamic resolution)
209+
test/modelMapping.test.ts # vitest unit tests (projection, dynamic resolution, manifest drift guard)
173210
scripts/generate-baseline.mjs # rewrites the baseline module + manifest modelCatalog
174211
scripts/smoke.discovery.mjs # live discovery smoke test against the public endpoint
175212
scripts/live-test.mjs # live inference test using the stored key (never printed)
176-
.github/workflows/ci.yml # GitHub Actions: typecheck + build + tests
213+
.github/workflows/ci.yml # GitHub Actions: typecheck + build + dist freshness + tests
214+
.gitattributes # LF normalization
215+
AGENTS.md # agent-oriented project guide
177216
```
178217

179218
## License

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
"type": "module",
66
"license": "MIT",
77
"private": false,
8+
"author": "TheStreamCode",
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/TheStreamCode/openclaw-command-code.git"
12+
},
13+
"homepage": "https://github.com/TheStreamCode/openclaw-command-code#readme",
14+
"bugs": {
15+
"url": "https://github.com/TheStreamCode/openclaw-command-code/issues"
16+
},
817
"main": "./dist/index.js",
918
"files": [
1019
"dist",

0 commit comments

Comments
 (0)