Skip to content

Runs OpenClaw

Alexander Kurganov edited this page Nov 26, 2026 · 5 revisions

Runs of model-router in OpenClaw. Newest first. Home holds the entry template.

2026-11-26 · Whether the text of a before_prompt_build hook reaches a main session and not a spawned child, with the conversation grant and without it

OpenClaw 2026.11.1 · branch claude/brief-text-9d30c8 at 25c5cb4 · live

Question. With hooks.allowConversationAccess set to true, does a main session get the plugin's text once in its system prompt and a spawned child none? With the grant unset, is there no text and no warning about the hook, although the package holds a rule file for omp?

Verdict. With the grant, each request of the main session carries the text once, in a block of the system prompt that OpenClaw heads "OpenClaw plugin-injected system context", and the request of the spawned child carries none. With the grant unset, no request carries the text, and neither the Gateway's console nor its file log names the hook or the grant. OpenClaw does not put the text of rules/model-router-briefs.md into a prompt.

Command

# The plugin came from the packed npm package: npm pack in packages/model-router, unpacked to <package>.
# The model was a stub on the loopback interface. It recorded each request and answered "ok".
# Every command ran with OPENCLAW_HOME, OPENCLAW_STATE_DIR and OPENCLAW_CONFIG_PATH set to a fresh
# home, with standard input closed, and with OPENCLAW_DISABLE_BONJOUR, OPENCLAW_NO_RESPAWN,
# OPENCLAW_SKIP_CHANNELS, OPENCLAW_SKIP_CRON and OPENCLAW_NO_AUTO_UPDATE set to 1.
openclaw config set logging.file <home>/state/gateway.log
openclaw config set gateway.mode local
openclaw config set gateway.bind loopback
openclaw config set gateway.port <port> --strict-json
openclaw config set gateway.auth.mode token
openclaw config set gateway.tools.allow '["sessions_spawn"]' --strict-json
openclaw config set models.providers.stub '{"baseUrl":"http://127.0.0.1:<stub port>/v1","apiKey":"stub","api":"openai-completions","models":[{"id":"stub","name":"stub","reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":8192}]}' --strict-json
openclaw config set agents.defaults.model.primary stub/stub
openclaw config set plugins.load.paths '["<package>"]' --strict-json
openclaw config set plugins.entries.model-router-openclaw.config.small_model stub/stub
# The same value for middle_model and large_model.
openclaw plugins enable model-router-openclaw --accept-capabilities

# First half, with the grant. The Gateway token came from OPENCLAW_GATEWAY_TOKEN.
openclaw config set plugins.entries.model-router-openclaw.hooks.allowConversationAccess true --strict-json
openclaw gateway run --port <port> --bind loopback --auth token
openclaw agent --agent main -m "MAIN-PROBE reply with ok" --json --timeout 60
curl -sS -X POST http://127.0.0.1:<port>/tools/invoke \
  -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' \
  --data '{"tool":"sessions_spawn","args":{"task":"CHILD-PROBE reply with ok"}}'
# Then SIGTERM to the Gateway this run started.

# Second half, without the grant.
openclaw config unset plugins.entries.model-router-openclaw.hooks.allowConversationAccess
openclaw gateway run --port <port> --bind loopback --auth token
openclaw agent --agent main --session-key agent:main:nogrant -m "MAIN-PROBE reply with ok" --json --timeout 60
# The same curl request, then SIGTERM to the Gateway.

Observed

# openclaw config set and unset, for the grant:
Updated plugins.entries.model-router-openclaw.hooks.allowConversationAccess. Change will apply without restarting the gateway.
Removed plugins.entries.model-router-openclaw.hooks.allowConversationAccess. Change will apply without restarting the gateway.

# The answer of /tools/invoke, in part, first half:
"status": "accepted"
"childSessionKey": "agent:main:subagent:3442a8db-1b6e-47fa-896c-bd67fca8769d"

# The requests the stub recorded, read by a script: the roles of the messages, and how often the
# system message holds the plugin's text. The third request of each half is the main session's
# turn on the child's completion event.
with the grant     1  main   roles system,user,user                                 text in system: 1
with the grant     2  child  roles system,user,user                                 text in system: 0
with the grant     3  main   roles system,user,user,assistant,user,user             text in system: 1
without the grant  1  main   roles system,user,user                                 text in system: 0
without the grant  2  child  roles system,user,user                                 text in system: 0
without the grant  3  main   roles system,user,user,assistant,user,assistant,user,user  text in system: 0

# The system message of a main session with the grant, around the text:
---

OpenClaw plugin-injected system context. This block is not workspace file content.

When model-router routes a subagent, it picks the model from this brief. Say what is already decided. If nothing is left to decide, say that nothing is; otherwise name what you leave to the subagent.

---

# The Gateway's console, the lines that name the plugin, the same in both halves but for the numbers:
[gateway] [plugins] OpenClaw can't verify where this plugin came from. Review it with 'openclaw plugins inspect model-router-openclaw'. [...]
[plugins] model-router L0 stub/stub · medium · p=0.93/0.98 · typesafe jev-1.14.0 · 700/30 tok

# No line of the console or of the file log holds before_prompt_build or allowConversationAccess, in either half.

2026-11-21 · A manifest with a gateway setting and two key settings, and a new command

OpenClaw 2026.11.1 · branch main at a3a199f · live

Question. Does a manifest that adds a gateway string setting and two secret key settings load with no diagnostic, does openclaw config set accept a value for each of them under additionalProperties: false, and does a command added beside the plugin's two commands register in a running Gateway?

Verdict. The manifest with the three settings loaded, its one diagnostic being the provenance warning; config set took a value for each setting and declined an undeclared key; and the added command registered in the running Gateway beside the plugin's two, though no chat turn ran, so no command was called.

Command

# Every command ran with OPENCLAW_HOME, OPENCLAW_STATE_DIR and OPENCLAW_CONFIG_PATH set to a fresh home, with OPENCLAW_DISABLE_BONJOUR, OPENCLAW_NO_RESPAWN, OPENCLAW_SKIP_CHANNELS, OPENCLAW_SKIP_CRON and OPENCLAW_NO_AUTO_UPDATE set to 1, and standard input closed.
# The plugin was a copy of the built plugin folder: its manifest got the three settings, and its entry registered one more command.
openclaw config set gateway.mode local
openclaw config set gateway.bind loopback
openclaw config set gateway.port <port> --strict-json
openclaw config set gateway.auth.mode token
openclaw config set update.checkOnStart false --strict-json
openclaw config set discovery.mdns.mode off
openclaw config set logging.level debug
openclaw config set logging.file <home>/gateway-file.log
openclaw config set plugins.load.paths '["<scratch>/plugin"]' --strict-json
openclaw plugins enable model-router-openclaw --accept-capabilities
openclaw config set plugins.entries.model-router-openclaw.config.gateway auto
openclaw config set plugins.entries.model-router-openclaw.config.openai_api_key <value>
openclaw config set plugins.entries.model-router-openclaw.config.google_api_key <value>
openclaw config get plugins.entries.model-router-openclaw.config.gateway
openclaw config validate
openclaw plugins inspect model-router-openclaw --runtime --json
openclaw plugins doctor
OPENCLAW_GATEWAY_TOKEN=<token> openclaw gateway run --port <port> --bind loopback --auth token --verbose
# After the Gateway has stopped:
openclaw config set plugins.entries.model-router-openclaw.config.not_declared x

Observed

Updated plugins.entries.model-router-openclaw.config.gateway. Change will apply without restarting the gateway.
Updated plugins.entries.model-router-openclaw.config.openai_api_key. Change will apply without restarting the gateway.
Updated plugins.entries.model-router-openclaw.config.google_api_key. Change will apply without restarting the gateway.
auto
Config valid: $OPENCLAW_HOME/state/openclaw.json

{
  "status": "loaded",
  "imported": true,
  "enabled": true,
  "contracts.tools": [
    "model_router_config"
  ],
  "diagnostics": [
    {
      "level": "warn",
      "pluginId": "model-router-openclaw",
      "source": "<scratch>/plugin/index.js",
      "message": "OpenClaw can't verify where this plugin came from. Review it with 'openclaw plugins inspect model-router-openclaw'. Adding it to plugins.allow lets it load, but does not make it trusted. If it's an official plugin, reinstall it from its official npm package or its official ClawHub listing to enable trusted features. reason=record-missing; registryPath=\"<home>/state/state/openclaw.sqlite\"; origin=\"config\"; installSource=null; installSpec=null."
    }
  ],
  "commands": []
}

Diagnostics:
- model-router-openclaw: OpenClaw can't verify where this plugin came from. Review it with 'openclaw plugins inspect model-router-openclaw'. Adding it to plugins.allow lets it load, but does not make it trusted. If it's an official plugin, reinstall it from its official npm package or its official ClawHub listing to enable trusted features. reason=record-missing; registryPath="<home>/state/state/openclaw.sqlite"; origin="config"; installSource=null; installSpec=null.

Gateway exit status: 0
Registered plugin command: /model-router-provider (plugin: model-router-openclaw)
Registered plugin command: /model-router-scope (plugin: model-router-openclaw)
Registered plugin command: /model-router-gateway (plugin: model-router-openclaw)
[gateway] [plugins] OpenClaw can't verify where this plugin came from. Review it with 'openclaw plugins inspect model-router-openclaw'. Adding it to plugins.allow lets it load, but does not make it trusted. If it's an official plugin, reinstall it from its official npm package or its official ClawHub listing to enable trusted features. reason=record-missing; registryPath="<home>/state/state/openclaw.sqlite"; origin="config"; installSource=null; installSpec=null. (plugin=model-router-openclaw, source=<scratch>/plugin/index.js)
[gateway] http server listening (16 plugins: …, model-router-openclaw, …; 2.4s)

Config change declined. No settings were saved.
Config validation failed: plugins.entries.model-router-openclaw.config: invalid config: must not have additional properties: "not_declared"

2026-11-20 · A spawned session routes with the limit and the outcome taken from the core

OpenClaw 2026.11.1 · branch claude/shared-harness-parts-13c4af at ffd3e0e · live

Question. With the handler racing its deadline through the core's limit, taking the model, the effort and the line from the core's outcome, collecting the keys by the core's rule and passing a clock to the scoring call, does one sessions_spawn in OpenClaw get routed by a real scoring call?

Verdict. The spawn is routed: the scoring call returns a decision, the Gateway's console holds the line with the level, the model, the effort, both probabilities, the provider, the Jev model and the token counts, and the tool's answer names the same model as applied.

Command

# Every command ran with OPENCLAW_HOME, OPENCLAW_STATE_DIR and OPENCLAW_CONFIG_PATH set to a fresh home and standard input closed.
openclaw config set gateway.mode local
openclaw config set gateway.bind loopback
openclaw config set gateway.port <port> --strict-json
openclaw config set gateway.auth.mode token
openclaw config set gateway.tools.allow '["sessions_spawn"]' --strict-json
openclaw config set agents.defaults.model.primary openrouter/openai/gpt-4.1
openclaw config set plugins.load.paths '["<checkout>/plugins/model-router-openclaw"]' --strict-json
openclaw config set plugins.entries.model-router-openclaw.config.small_model openrouter/openai/gpt-4.1-mini
# The same value for middle_model and large_model.
openclaw plugins enable model-router-openclaw --accept-capabilities
# The provider keys came from the environment, and the Gateway token from OPENCLAW_GATEWAY_TOKEN.
openclaw gateway run --port <port> --bind loopback --auth token
curl -sS -X POST http://127.0.0.1:<port>/tools/invoke \
  -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' \
  --data '{"tool":"sessions_spawn","args":{"task":"Read the file sample.json in your workspace folder and report the value of its color field in one short sentence."}}'
# Then SIGTERM to the Gateway this run started.

Observed

The Gateway's console:
[plugins] model-router L0 openrouter/openai/gpt-4.1-mini · medium · p=0.92/0.96 · typesafe jev-1.14.0 · 691/30 tok

The answer of /tools/invoke, in part:
"status": "accepted"
"resolvedModel": "openrouter/openai/gpt-4.1-mini"
"resolvedProvider": "openrouter"
"modelApplied": true

2026-11-19 · A spawned session routes through the plugin's own transport

OpenClaw 2026.11.1 · branch claude/own-transport-d96ec0 at f631cf1 · live

Question. With the scoring request sent by the plugin's own transport and no TypeSafe SDK, does one sessions_spawn in OpenClaw get routed by a real scoring call?

Verdict. The spawn is routed: the scoring call returns a decision, the Gateway's console holds the line with the level, the model, the effort, both probabilities, the Jev model and the token counts, and the tool's answer names the same model as applied.

Command

# Every command ran with OPENCLAW_HOME, OPENCLAW_STATE_DIR and OPENCLAW_CONFIG_PATH set to a fresh home and standard input closed.
openclaw config set gateway.mode local
openclaw config set gateway.bind loopback
openclaw config set gateway.port <port> --strict-json
openclaw config set gateway.auth.mode token
openclaw config set gateway.tools.allow '["sessions_spawn"]' --strict-json
openclaw config set agents.defaults.model.primary openrouter/openai/gpt-4.1
openclaw config set plugins.load.paths '["<checkout>/plugins/model-router-openclaw"]' --strict-json
openclaw config set plugins.entries.model-router-openclaw.config.small_model openrouter/openai/gpt-4.1-mini
# The same value for middle_model and large_model.
openclaw plugins enable model-router-openclaw --accept-capabilities
# The provider keys and the Gateway token came from the environment.
openclaw gateway run --port <port> --bind loopback --auth token
curl -sS -X POST http://127.0.0.1:<port>/tools/invoke \
  -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' \
  --data '{"tool":"sessions_spawn","args":{"task":"Read the file sample.json in your workspace folder and report the value of its color field in one short sentence."}}'
# Then SIGTERM to the Gateway this run started.

Observed

The Gateway's console:
[plugins] model-router L0 openrouter/openai/gpt-4.1-mini · medium · p=0.89/0.96 · jev jev-1.14.0 · 691/30 tok

The answer of /tools/invoke, in part:
"status": "accepted"
"resolvedModel": "openrouter/openai/gpt-4.1-mini"
"resolvedProvider": "openrouter"
"modelApplied": true