Skip to content

Models, providers (GLM + Kimi first-class), and the jsclaw onboard wizard - #26

Merged
melvincarvalho merged 1 commit into
mainfrom
issue-25-models-onboarding
Jun 11, 2026
Merged

melvincarvalho merged 1 commit into
mainfrom
issue-25-models-onboarding

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Closes #25

Models & providers

Per-agent and per-heartbeat model selection with input > group > config precedence, and provider routing through the Anthropic API surface the Claude Code runtime actually speaks:

  • Anthropic direct
  • GLM (Z.ai) and Kimi (Moonshot) — first-class presets via their published Anthropic-compatible endpoints, no proxy needed
  • Bedrock / Vertex via the standard env switches
  • Custom endpoint for LiteLLM → OpenAI, Gemini, Grok, DeepSeek, Ollama

heartbeatModel routes the autonomy loop to a cheap model — openclaw's biggest cost lever, now wired into jsclaw gateway.

Security fix riding along

ANTHROPIC_API_KEY is out of docker argv (it was ps-visible — audit finding #4). All provider credentials and endpoints now travel via stdin (ContainerInput.providerEnv) behind a whitelist; the E2E proves the container receives them on stdin while process.env.ANTHROPIC_API_KEY from -e flags is null, and a unit test asserts no ANTHROPIC* string ever appears in container argv.

jsclaw onboard

openclaw-parity setup wizard, zero-dep on node:readline/promises: environment checks, offers to build the agent image, provider + key + model selection (keys written as ${ENV_VAR} references — never literals), groups/main scaffold with starter SOUL.md/HEARTBEAT.md + memory, gateway token, next-steps summary. The config-building core is pure and unit-tested across all six providers; non-TTY invocations exit 2 cleanly.

Verification

10 new tests; full suite 119/119 including Docker E2E. Zero new dependencies.

v0.0.11 (not published).

Models:
- config.model / heartbeatModel / group.model / input.model with
  input > group > config precedence; heartbeat runs on the cheap
  model when configured (the 48-cycles/day cost lever)
- src/providers.js: presets — Anthropic, Z.ai GLM, Moonshot Kimi
  (both via their Anthropic-compatible endpoints, first-class today),
  Bedrock, Vertex, custom/LiteLLM; PROVIDER_ENV_KEYS whitelist;
  resolveProviderEnv (config beats host env)
- Security: ANTHROPIC_API_KEY removed from docker argv (was
  ps-visible — audit finding #4); all provider credentials/endpoints
  now travel via stdin in ContainerInput.providerEnv; agent-runner
  applies them before querying and passes model to the SDK

Onboarding (openclaw parity):
- bin/onboard.js: interactive wizard on node:readline/promises —
  env checks, optional image build, provider/key/model selection,
  groups/main scaffold (SOUL.md, HEARTBEAT.md, memory), gateway
  token, jsclaw.json merge preserving raw ${ENV} references
- Pure logic (buildOnboardConfig, mergeConfigFile, scaffoldGroup)
  exported and unit-tested; non-TTY guarded (exit 2)
- gatewayToken config key; jsclaw gateway uses it

Tests: 10 new — provider presets, env whitelist + config precedence,
no-credentials-in-argv, onboard config building for all six providers,
config merge preserving raw refs, idempotent scaffold, plus E2E
proving model + credentials cross via stdin (envApiKey null in
container) and model precedence. Full suite 119/119.

v0.0.11, no npm publish.

Closes #25
@melvincarvalho
melvincarvalho merged commit 9a2bb1a into main Jun 11, 2026
@melvincarvalho
melvincarvalho deleted the issue-25-models-onboarding branch June 11, 2026 00:35
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.

Models + onboarding: provider presets (incl. GLM, Kimi), per-agent models, jsclaw onboard wizard

1 participant