Dev Intel: agent substrate beats model UX lock-in
モデルを人格ごと乗り換えない。OpenClaw/ひめのは、記憶・スキル・cron・Viewをsubstrateにして、provider/runtimeを差し替える設計に寄せる。
Generated: 2026-05-22T13:08:00+09:00
Lane: 開発ネタ発掘
Why this is useful
OpenClaw/ひめのの設計で一番効くのは「どのモデルが賢いか」だけではなく、記憶・スキル・cron・channel・runtime・安全ゲートをどれだけモデル非依存にできるか。Mager の OpenClaw→Codex 移行記事は、この考え方を実運用の言葉でかなりはっきり言っている。
健人くん向けの刺さりどころは、provider 切替を「別のAIに乗り換える」ではなく「同じ秘書OSのエンジン交換」にできる点。OpenClawを人格/記憶/仕事導線の母艦にしておけば、Anthropic/OpenAI/ローカルモデル/別runtimeの都合でワークフロー全体が死ににくい。
What I made/changed
この記事を OpenClaw の設計メモとして読み替えた。結論は agent_substrate_contract を明示すること。
identity_layer: SOUL/AGENTS/USER/MEMORY のような人格・方針・長期記憶workflow_layer: skills, scripts, task ledger, View, cron, heartbeatruntime_layer: Codex runtime, direct OpenAI API, Claude Code, browser automation などprovider_layer: OpenAI/Anthropic/Google/local などの課金・認証・モデル供給元portability_layer: brainpack/git/export のような移植・バックアップ手段secret_boundary: API key, cookies, browser profiles, private memory を何に含めないか
この境界がないと、モデル変更・価格変更・OAuth停止・CLI仕様変更のたびに「ひめのが別人格になる」「cronやmemoryの前提が壊れる」「秘密情報の扱いが曖昧になる」。
Sources/Evidence
- Mager blog: OpenClaw: I Switched My Agent Stack from Claude to OpenAI Codex
- https://www.mager.co/blog/2026-04-11-openclaw-openai-codex/
- Key evidence: OpenClaw provides routing, channels, sessions, cron jobs, memory files, tooling, persistent identity, and skills; the model becomes a pluggable dependency rather than the whole product.
- OpenClaw OpenAI provider docs
- https://docs.openclaw.ai/providers/openai
- Key evidence: provider, model, runtime, and channel are separate layers; OpenClaw distinguishes OpenAI agent runtime from direct OpenAI API-key surfaces.
- brainpack
- https://github.com/mager/brainpack
- Key evidence: agent “brain” as a folder of text files can be versioned, synced, exported, and moved across OpenClaw/Codex/Claude Code/Cursor/etc.; secrets are separately checked/excluded.
Prediction
If OpenClaw treats model/provider/runtime/channel as separate config layers, provider churn becomes a controlled migration instead of a personality/workflow reset. The next useful implementation is a small local agent_substrate_contract report/check that lists what belongs to the portable brain, what belongs to runtime config, and what must stay secret/local-only.
Verify by
- Check whether local memory/task docs already distinguish provider/model/runtime/channel.
- Check whether any local backup/export idea accidentally includes secrets, browser profiles, or cookies.
- If implementing, add a lint or checklist that refuses to call a workspace portable unless it names its secret exclusions.
Observed
The fetched OpenClaw provider docs explicitly say provider, model, runtime, and channel are separate layers. The brainpack README explicitly frames the “brain” as portable files and includes secret-check commands/exclusions. The Mager article frames the practical switch as changing the engine inside an existing harness.
Next safe action
Create a lightweight agent_substrate_contract artifact for this workspace: portable files, local-only files, runtime config, external credentials, and restore checklist. Do not install brainpack or push/export anything from heartbeat without explicit approval, because backup/sync can touch secrets.
Notify
Yes. This is source-backed and directly relevant to 健人くん's OpenClaw/ひめの direction: it suggests a concrete framing for why memory/skills/cron/View should be treated as the product, with models as swappable dependencies.