arthur041691 (Discord #help) runs OpenClaw for WhatsApp and asked for it in
Agents. Connecting writes magpie as a custom provider of OpenClaw's own, in
openclaw.json, and makes the picked model agents.defaults.model's primary.
What is written, from OpenClaw's source at 5bab0c14 (npm 2026.10.8, dc2523e):
- the file: OPENCLAW_CONFIG_PATH, else $OPENCLAW_STATE_DIR/openclaw.json,
else ~/.openclaw-<profile> for a named OPENCLAW_PROFILE, else
~/.openclaw; ~ is OPENCLAW_HOME when set (src/config/paths.ts,
src/config/state-dir.ts, src/cli/profile-utils.ts). OPENCLAW_PROFILE is
a name, not a path (agentenv.NotPaths); the other three expand a
leading ~, as resolveUserPath does (appdir.usable).
- models.providers.magpie: baseUrl (the gateway's /v1), apiKey (the
OpenClaw-named gateway key), api "openai-completions", and every model
magpie serves with id, name, input, reasoning and contextWindow
(src/config/zod-schema.core.ts, docs/gateway/config-tools/custom-providers.md).
A user's own keys on a model entry (headers, maxTokens…) stay on Sync.
- agents.defaults.model keeps its shape (string or {primary, fallbacks});
agents.defaults.models gets the ref's {} entry as `openclaw models set`
adds it (src/commands/models/shared.ts), only when that map exists; a
non-empty modelPolicy.allow gets "magpie/*" when nothing there lets
magpie's models in (src/agents/model-selection-normalize.ts).
- Model changes are hot-reloaded (docs/gateway/configuration/hot-reload.md);
a chat that already has a model keeps it (docs/concepts/models.md), so
the notice says to send /model default there. Translated in every
language.
- The file is written through temp-and-rename; a new one is 0600 in a
0700 folder, as OpenClaw makes it (src/config/io.write.ts). A file that
isn't JSON after comments are blanked (JSON5's bare keys) is left alone
with an error, never read as empty.
- Disconnect puts back the model there was, removes magpie's provider,
its {} entries, the allow entry and any object magpie made, and the
file itself if magpie made it.
Icon: a mask drawn from OpenClaw's ui/public/favicon.svg (MIT).
Run, on mote at this tree:
- go test -tags nogui ./internal/agent -run OpenClaw plus the every-agent
tests (drift, port move, sync on another machine, reverse proxy, LAN,
pinned key per writer, notices translated), ./internal/appdir,
./internal/agentenv: ok.
- Broken by hand, each red then green again: no stash restore
(TestOpenClaw, Shapes, AllowList), user keys dropped
(SyncKeepsTheirs), no allow entry (AllowList), no JSON5 guard
(JSON5LeftAlone), profile ignored (Paths), OPENCLAW_PROFILE back as a
path variable (Paths).
- Real OpenClaw 2026.10.8 from npm, Node 24.22.2, sandbox HOME on mote:
onboard --non-interactive made the file (its bytes are the test
fixture); magpie's code connected it; `openclaw config validate` ok;
`openclaw models list` shows magpie/kimi/k2 as default; `openclaw agent
--local` sent POST /v1/chat/completions with Bearer magpie-openclaw and
model kimi/k2 to a fake gateway on 3425 and showed its reply; no
agents/*/models.json override was written; Disconnect gave the file
back byte for byte and it validates.
- GUI: i18n-keys, agent-notice-lang, icon-tile, about-notices,
agent-connect (Chromium and WebKit): 53/53.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok.
- Full suite, go test -tags nogui -timeout 45m ./... at fe05f0a72 + this
change: 76 packages ok; internal/provider red on
TestClaudeAccountServesModelsListedSinceItsFetch only, green alone
-count=5: the known #3174 (untouched here).
- Rebased on b2d005bf3 (grok.go, i18n.js changed there): internal/agent,
appdir, agentenv, gui and the five GUI files above again, all ok.
Not tried: per-agent model overrides (agents.list[].model), a config
split with $include, a chat already pinned to a model, Windows and Linux
OpenClaw installs, a real WhatsApp channel.
459 lines
14 KiB
Go
459 lines
14 KiB
Go
package agent
|
|
|
|
import (
|
|
"encoding/json"
|
|
"os"
|
|
"path/filepath"
|
|
"reflect"
|
|
"runtime"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/yetone/magpie/internal/catalog"
|
|
"github.com/yetone/magpie/internal/provider"
|
|
)
|
|
|
|
// openClawConfig is openclaw.json as OpenClaw 2026.10.8 writes it after
|
|
// `openclaw onboard --non-interactive --accept-risk --auth-choice
|
|
// deepseek-api-key …` (the folder and the gateway token changed).
|
|
const openClawConfig = `{
|
|
"agents": {
|
|
"entries": {
|
|
"main": {
|
|
"name": "main",
|
|
"workspace": "/Users/u/.openclaw/workspace",
|
|
"agentDir": "/Users/u/.openclaw/agents/main/agent",
|
|
"identity": {
|
|
"name": "main"
|
|
}
|
|
}
|
|
},
|
|
"defaults": {
|
|
"workspace": "/Users/u/.openclaw/workspace",
|
|
"models": {
|
|
"deepseek/deepseek-v4-pro": {
|
|
"alias": "DeepSeek"
|
|
}
|
|
},
|
|
"model": {
|
|
"primary": "deepseek/deepseek-v4-pro"
|
|
}
|
|
}
|
|
},
|
|
"plugins": {
|
|
"entries": {
|
|
"anthropic": {
|
|
"config": {
|
|
"sessionCatalog": {
|
|
"enabled": false
|
|
}
|
|
}
|
|
},
|
|
"codex": {
|
|
"config": {
|
|
"sessionCatalog": {
|
|
"enabled": false
|
|
}
|
|
}
|
|
},
|
|
"deepseek": {
|
|
"enabled": true
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"migrations": {
|
|
"modelPolicyAllowlist": true,
|
|
"utilityModelSeparation": true
|
|
},
|
|
"lastTouchedVersion": "2026.10.8"
|
|
},
|
|
"gateway": {
|
|
"mode": "local",
|
|
"auth": {
|
|
"mode": "token",
|
|
"token": "gateway-token"
|
|
},
|
|
"port": 18799,
|
|
"bind": "loopback",
|
|
"tailscale": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"tools": {
|
|
"profile": "full"
|
|
},
|
|
"auth": {
|
|
"profiles": {
|
|
"deepseek:default": {
|
|
"provider": "deepseek",
|
|
"mode": "api_key"
|
|
}
|
|
}
|
|
},
|
|
"models": {
|
|
"mode": "merge",
|
|
"providers": {
|
|
"deepseek": {
|
|
"baseUrl": "https://api.deepseek.com",
|
|
"api": "openai-completions",
|
|
"models": []
|
|
}
|
|
}
|
|
},
|
|
"wizard": {
|
|
"lastRunAt": "2026-10-28T20:43:15.671Z",
|
|
"lastRunVersion": "2026.10.8",
|
|
"lastRunCommand": "onboard",
|
|
"lastRunMode": "local"
|
|
}
|
|
}
|
|
`
|
|
|
|
// openClawHomeWith is a HOME with OpenClaw's ~/.openclaw holding body as
|
|
// its openclaw.json ("" for none), and magpie with a provider of two
|
|
// models, one of them with effort levels.
|
|
func openClawHomeWith(t *testing.T, body string) (home, path string) {
|
|
t.Helper()
|
|
home = t.TempDir()
|
|
t.Setenv("HOME", home)
|
|
t.Setenv("USERPROFILE", home)
|
|
t.Setenv("XDG_CONFIG_HOME", filepath.Join(home, ".config"))
|
|
t.Setenv("XDG_CACHE_HOME", filepath.Join(home, ".cache"))
|
|
for _, k := range []string{"OPENCLAW_CONFIG_PATH", "OPENCLAW_STATE_DIR", "OPENCLAW_PROFILE", "OPENCLAW_HOME"} {
|
|
t.Setenv(k, "")
|
|
}
|
|
if err := provider.Save(provider.Provider{ID: "kimi", Name: "Kimi", Key: "k",
|
|
Chat: "https://api.moonshot.cn/v1", Models: []string{"k2", "k2.5-vision"}}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if err := catalog.SaveLive("kimi", "https://api.moonshot.cn/v1", []catalog.Model{
|
|
{ID: "k2", Context: 262144, Efforts: []string{"low", "medium", "high"}},
|
|
{ID: "k2.5-vision", Images: true},
|
|
}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
path = filepath.Join(home, ".openclaw", "openclaw.json")
|
|
if body != "" {
|
|
writeFile(t, path, body)
|
|
}
|
|
return home, path
|
|
}
|
|
|
|
func openClawParse(t *testing.T, path string) map[string]any {
|
|
t.Helper()
|
|
b, err := os.ReadFile(path)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
var m map[string]any
|
|
if err := json.Unmarshal(b, &m); err != nil {
|
|
t.Fatalf("%s is not JSON: %v\n%s", path, err, b)
|
|
}
|
|
return m
|
|
}
|
|
|
|
func openClawAt_(m map[string]any, keys ...string) any {
|
|
var v any = m
|
|
for _, k := range keys {
|
|
o, _ := v.(map[string]any)
|
|
v = o[k]
|
|
}
|
|
return v
|
|
}
|
|
|
|
// Connecting OpenClaw adds magpie as a provider of its own — the gateway,
|
|
// with a key naming OpenClaw, and every one of magpie's models — and makes
|
|
// the model picked the primary. The rest of OpenClaw's file stays, and
|
|
// Disconnect gives it back byte for byte.
|
|
func TestOpenClaw(t *testing.T) {
|
|
home, path := openClawHomeWith(t, openClawConfig)
|
|
a := openClaw(home)
|
|
if a.Path != path || !a.Detected() {
|
|
t.Fatalf("path %q, detected %v", a.Path, a.Detected())
|
|
}
|
|
f := a.Field("model")
|
|
if got := f.Get(); got != "deepseek/deepseek-v4-pro" || a.Wired() || a.Check() != "" {
|
|
t.Fatalf("before: %q wired %v check %q", got, a.Wired(), a.Check())
|
|
}
|
|
var own, ours bool
|
|
for _, o := range f.Options(a.Values()) {
|
|
own = own || o.Value == "deepseek/deepseek-v4-pro"
|
|
ours = ours || o.Value == "magpie/kimi/k2"
|
|
}
|
|
if !own || !ours {
|
|
t.Fatalf("options: own %v magpie %v", own, ours)
|
|
}
|
|
|
|
if err := a.Pick("model", "magpie/kimi/k2"); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
m := openClawParse(t, path)
|
|
if p := openClawAt_(m, "agents", "defaults", "model"); !reflect.DeepEqual(p, map[string]any{"primary": "magpie/kimi/k2"}) {
|
|
t.Fatalf("agents.defaults.model: %v", p)
|
|
}
|
|
if !a.Wired() || f.Get() != "magpie/kimi/k2" {
|
|
t.Fatalf("wired %v, model %q", a.Wired(), f.Get())
|
|
}
|
|
if c := a.Check(); c != "" {
|
|
t.Fatalf("check: %s", c)
|
|
}
|
|
p, _ := openClawAt_(m, "models", "providers", "magpie").(map[string]any)
|
|
if p["baseUrl"] != here(home).v1() || p["api"] != "openai-completions" || p["apiKey"] != agentKeyAt("openclaw", here(home).gw()) {
|
|
t.Fatalf("magpie's provider: %v", p)
|
|
}
|
|
models := map[string]map[string]any{}
|
|
for _, x := range p["models"].([]any) {
|
|
e := x.(map[string]any)
|
|
models[e["id"].(string)] = e
|
|
}
|
|
k2, vision := models["kimi/k2"], models["kimi/k2.5-vision"]
|
|
if len(models) != 2 || k2 == nil || vision == nil {
|
|
t.Fatalf("models: %v", models)
|
|
}
|
|
if k2["name"] != "kimi/k2" || k2["contextWindow"] != float64(262144) || k2["reasoning"] != true {
|
|
t.Fatalf("k2: %v", k2)
|
|
}
|
|
if vision["contextWindow"] != float64(openClawContext) || !reflect.DeepEqual(vision["input"], []any{"text", "image"}) || vision["reasoning"] != false {
|
|
t.Fatalf("k2.5-vision: %v", vision)
|
|
}
|
|
// as `openclaw models set` does, beside the user's own entry
|
|
if ms := openClawAt_(m, "agents", "defaults", "models"); !reflect.DeepEqual(ms, map[string]any{
|
|
"deepseek/deepseek-v4-pro": map[string]any{"alias": "DeepSeek"}, "magpie/kimi/k2": map[string]any{}}) {
|
|
t.Fatalf("agents.defaults.models: %v", ms)
|
|
}
|
|
for _, k := range []string{"plugins", "meta", "gateway", "tools", "auth", "wizard"} {
|
|
var want map[string]any
|
|
json.Unmarshal([]byte(openClawConfig), &want)
|
|
if !reflect.DeepEqual(m[k], want[k]) {
|
|
t.Fatalf("%s changed: %v", k, m[k])
|
|
}
|
|
}
|
|
if d := openClawAt_(m, "models", "providers", "deepseek"); d == nil {
|
|
t.Fatal("the user's own provider is gone")
|
|
}
|
|
|
|
// switching between magpie's models keeps what OpenClaw was on before;
|
|
// a model ref with a dot is one key
|
|
if err := a.Pick("model", "magpie/kimi/k2.5-vision"); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if got := f.Get(); got != "magpie/kimi/k2.5-vision" {
|
|
t.Fatalf("model %q", got)
|
|
}
|
|
ms, _ := openClawAt_(openClawParse(t, path), "agents", "defaults", "models").(map[string]any)
|
|
if _, on := ms["magpie/kimi/k2.5-vision"]; !on || len(ms) != 2 {
|
|
t.Fatalf("agents.defaults.models after a switch: %v", ms)
|
|
}
|
|
if err := a.Disconnect(); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if got, _ := os.ReadFile(path); string(got) != openClawConfig {
|
|
t.Fatalf("Disconnect left:\n%s", got)
|
|
}
|
|
if a.Wired() {
|
|
t.Fatal("still wired")
|
|
}
|
|
}
|
|
|
|
// A model OpenClaw names as a bare string stays a string, and one with no
|
|
// model at all, or no file at all, is given back as it was.
|
|
func TestOpenClawShapes(t *testing.T) {
|
|
for name, body := range map[string]string{
|
|
"string": "{\n \"agents\": {\n \"defaults\": {\n \"model\": \"anthropic/claude-opus-4-6\"\n }\n }\n}\n",
|
|
"fallback": "{\n \"agents\": {\n \"defaults\": {\n \"model\": {\n \"primary\": \"anthropic/claude-opus-4-6\",\n \"fallbacks\": [\"openai/gpt-5.5\"]\n }\n }\n }\n}\n",
|
|
"no model": "{\n \"gateway\": {\n \"port\": 18789\n }\n}\n",
|
|
"no file": "",
|
|
} {
|
|
t.Run(name, func(t *testing.T) {
|
|
home, path := openClawHomeWith(t, body)
|
|
if body == "" {
|
|
os.MkdirAll(filepath.Dir(path), 0o700) // detected
|
|
}
|
|
a := openClaw(home)
|
|
if err := a.Pick("model", "magpie/kimi/k2"); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
m := openClawParse(t, path)
|
|
got := openClawAt_(m, "agents", "defaults", "model")
|
|
switch name {
|
|
case "fallback":
|
|
if !reflect.DeepEqual(got, map[string]any{"primary": "magpie/kimi/k2", "fallbacks": []any{"openai/gpt-5.5"}}) {
|
|
t.Fatalf("model: %v", got)
|
|
}
|
|
default:
|
|
if got != "magpie/kimi/k2" {
|
|
t.Fatalf("model: %v", got)
|
|
}
|
|
}
|
|
if body == "" && runtime.GOOS != "windows" {
|
|
if st, err := os.Stat(path); err != nil || st.Mode().Perm() != 0o600 {
|
|
t.Fatalf("a new openclaw.json holding a key: %v %v", st.Mode(), err)
|
|
}
|
|
}
|
|
if err := a.Disconnect(); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
b, err := os.ReadFile(path)
|
|
if body == "" {
|
|
if !os.IsNotExist(err) {
|
|
t.Fatalf("magpie's own file is left: %v\n%s", err, b)
|
|
}
|
|
return
|
|
}
|
|
if string(b) != body {
|
|
t.Fatalf("Disconnect left:\n%s\nwant:\n%s", b, body)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
// A model allow-list that has nothing of magpie's gets magpie's models
|
|
// in, or OpenClaw refuses them; Disconnect takes them out again.
|
|
func TestOpenClawAllowList(t *testing.T) {
|
|
body := "{\n \"agents\": {\n \"defaults\": {\n \"model\": \"deepseek/deepseek-v4-pro\",\n \"modelPolicy\": {\n \"allow\": [\n \"deepseek/*\"\n ]\n }\n }\n }\n}\n"
|
|
home, path := openClawHomeWith(t, body)
|
|
a := openClaw(home)
|
|
if err := a.Pick("model", "magpie/kimi/k2"); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
allow := openClawAt_(openClawParse(t, path), "agents", "defaults", "modelPolicy", "allow")
|
|
if !reflect.DeepEqual(allow, []any{"deepseek/*", "magpie/*"}) {
|
|
t.Fatalf("allow: %v", allow)
|
|
}
|
|
if err := a.Disconnect(); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
m := openClawParse(t, path)
|
|
if allow := openClawAt_(m, "agents", "defaults", "modelPolicy", "allow"); !reflect.DeepEqual(allow, []any{"deepseek/*"}) {
|
|
t.Fatalf("allow after Disconnect: %v", allow)
|
|
}
|
|
if got := openClawAt_(m, "agents", "defaults", "model"); got != "deepseek/deepseek-v4-pro" {
|
|
t.Fatalf("model after Disconnect: %v", got)
|
|
}
|
|
}
|
|
|
|
// A model of OpenClaw's own picked while it is on magpie takes magpie
|
|
// out, and keeps the fallbacks.
|
|
func TestOpenClawOwnModelTakesMagpieOut(t *testing.T) {
|
|
home, path := openClawHomeWith(t, openClawConfig)
|
|
a := openClaw(home)
|
|
if err := a.Pick("model", "magpie/kimi/k2"); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if err := a.Pick("model", "deepseek/deepseek-v4-flash"); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
want := strings.Replace(openClawConfig, `"primary": "deepseek/deepseek-v4-pro"`, `"primary": "deepseek/deepseek-v4-flash"`, 1)
|
|
if got, _ := os.ReadFile(path); string(got) != want {
|
|
t.Fatalf("got:\n%s\nwant:\n%s", got, want)
|
|
}
|
|
if a.Wired() {
|
|
t.Fatal("still wired")
|
|
}
|
|
}
|
|
|
|
// What the user sets in magpie's provider — a header, a timeout, a
|
|
// model's maxTokens — is theirs: a catalog sync rewrites the endpoint and
|
|
// the models, not those. A sync with nothing to change doesn't write.
|
|
func TestOpenClawSyncKeepsTheirs(t *testing.T) {
|
|
home, path := openClawHomeWith(t, openClawConfig)
|
|
a := openClaw(home)
|
|
if err := a.Pick("model", "magpie/kimi/k2"); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
m := openClawParse(t, path)
|
|
p := openClawAt_(m, "models", "providers", "magpie").(map[string]any)
|
|
p["headers"] = map[string]any{"X-Mine": "1"}
|
|
p["timeoutSeconds"] = 600
|
|
p["baseUrl"] = "http://127.0.0.1:1/v1"
|
|
for _, x := range p["models"].([]any) {
|
|
if e := x.(map[string]any); e["id"] == "kimi/k2" {
|
|
e["maxTokens"] = 32000
|
|
e["reasoning"] = false
|
|
}
|
|
}
|
|
b, _ := json.MarshalIndent(m, "", " ")
|
|
writeFile(t, path, string(b)+"\n")
|
|
if c := a.Check(); !strings.Contains(c, "baseUrl") {
|
|
t.Fatalf("check with the URL changed: %q", c)
|
|
}
|
|
if err := a.Sync(); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
p = openClawAt_(openClawParse(t, path), "models", "providers", "magpie").(map[string]any)
|
|
if p["baseUrl"] != here(home).v1() || p["timeoutSeconds"] != float64(600) || !reflect.DeepEqual(p["headers"], map[string]any{"X-Mine": "1"}) {
|
|
t.Fatalf("after a sync: %v", p)
|
|
}
|
|
for _, x := range p["models"].([]any) {
|
|
if e := x.(map[string]any); e["id"] == "kimi/k2" && (e["maxTokens"] != float64(32000) || e["reasoning"] != true) {
|
|
t.Fatalf("k2 after a sync: %v", e)
|
|
}
|
|
}
|
|
if a.Check() != "" {
|
|
t.Fatalf("check: %s", a.Check())
|
|
}
|
|
st, _ := os.Stat(path)
|
|
before, _ := os.ReadFile(path)
|
|
if err := a.Sync(); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
st2, _ := os.Stat(path)
|
|
if after, _ := os.ReadFile(path); string(after) != string(before) || !st2.ModTime().Equal(st.ModTime()) {
|
|
t.Fatal("a sync with nothing to change wrote the file")
|
|
}
|
|
}
|
|
|
|
// openclaw.json in JSON5, which OpenClaw reads and magpie can't, is left
|
|
// as it is, and said so.
|
|
func TestOpenClawJSON5LeftAlone(t *testing.T) {
|
|
body := "// mine\n{\n agents: { defaults: { model: 'deepseek/deepseek-v4-pro' } },\n}\n"
|
|
home, path := openClawHomeWith(t, body)
|
|
a := openClaw(home)
|
|
if err := a.Pick("model", "magpie/kimi/k2"); err == nil {
|
|
t.Fatal("a JSON5 file was written")
|
|
}
|
|
if got, _ := os.ReadFile(path); string(got) != body {
|
|
t.Fatalf("changed:\n%s", got)
|
|
}
|
|
if c := a.Check(); !strings.Contains(c, "JSON5") {
|
|
t.Fatalf("check: %q", c)
|
|
}
|
|
}
|
|
|
|
// openclaw.json is where OpenClaw itself looks: $OPENCLAW_CONFIG_PATH, its
|
|
// state folder, a named profile's folder, ~ as $OPENCLAW_HOME.
|
|
func TestOpenClawPaths(t *testing.T) {
|
|
home := t.TempDir()
|
|
at := here(home)
|
|
env := map[string]string{}
|
|
set := func(k, v string) { env[k] = v; t.Setenv(k, v) }
|
|
for _, k := range []string{"OPENCLAW_CONFIG_PATH", "OPENCLAW_STATE_DIR", "OPENCLAW_PROFILE", "OPENCLAW_HOME"} {
|
|
set(k, "")
|
|
}
|
|
check := func(wantDir, wantPath string) {
|
|
t.Helper()
|
|
dir, path := openClawPaths(at)
|
|
if dir != wantDir || path != wantPath {
|
|
t.Fatalf("%v: %s %s, want %s %s", env, dir, path, wantDir, wantPath)
|
|
}
|
|
}
|
|
def := filepath.Join(home, ".openclaw")
|
|
check(def, filepath.Join(def, "openclaw.json"))
|
|
set("OPENCLAW_PROFILE", "default")
|
|
check(def, filepath.Join(def, "openclaw.json"))
|
|
set("OPENCLAW_PROFILE", "../x")
|
|
check(def, filepath.Join(def, "openclaw.json"))
|
|
set("OPENCLAW_PROFILE", "Work")
|
|
w := filepath.Join(home, ".openclaw-Work")
|
|
check(w, filepath.Join(w, "openclaw.json"))
|
|
set("OPENCLAW_HOME", "~/oc")
|
|
w = filepath.Join(home, "oc", ".openclaw-Work")
|
|
check(w, filepath.Join(w, "openclaw.json"))
|
|
set("OPENCLAW_STATE_DIR", "~/state")
|
|
s := filepath.Join(home, "oc", "state")
|
|
check(s, filepath.Join(s, "openclaw.json"))
|
|
set("OPENCLAW_CONFIG_PATH", filepath.Join(home, "cfg", "my.json"))
|
|
check(s, filepath.Join(home, "cfg", "my.json"))
|
|
}
|