Adds a "second brain" to the DeepSeek Harness agent: a stronger model reviews dangerous commands before execution, and connects 60+ models to DSH via wallet signing (x402/USDC) without API keys.
- Language
- TypeScript
- License
- MIT
- Branch
- main
Install
$ dsh plugin --profile web add dsh-clawrouterRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
Install via your agent
Install the DeepSeek Harness plugin BlockRunAI/dsh-clawrouter for me: review the repository at https://github.com/BlockRunAI/dsh-clawrouter first, then run the install command and verify the plugin loads successfully.
Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.
One-Line Positioning
Equip DeepSeek Harness agents with a "second brain": before an agent executes dangerous operations, have a stronger model review the command first before allowing it to proceed; meanwhile, connect BlockRun's 60+ models to DSH via wallet signature—no API Key, no account, pay-per-use in USDC.
Core Capabilities
- Automatically review dangerous commands before tool execution: recursive deletion, raw disk writes,
curl | sh, forced pushes,sudo, accessing~/.sshor/etc/passwd, and file writes that will be "executed later" (git hooks, CI workflows,postinstall, shell startup files)—a stronger model decides "allow / deny / escalate to human" - Register BlockRun as a model router: use EVM wallet signature instead of API Key, pay-per-use via x402 in USDC; one wallet gives access to Claude / GPT / Gemini / Grok / Kimi and 60+ models
- Provide
/spendcommand to query current session's request count, input/output tokens, and costs grouped by model - Provide
/reviewcommand to submit any diff / plan / conclusion to the reviewer model for a one-time manual triggered review - Provide
/gatecommand to see if the gate is actually enabled and what rules are loaded;/gate drillcan run an end-to-end drill with the real reviewer model without executing any tools - Support visual input and reasoning effort (
high/max) selection for in-pipeline models, with image capabilities only enabled for actually tested vision models by default
Technical Implementation
- Language: TypeScript (
tsupbundles ESM, main entrylib/index.js, type declarationslib/index.d.ts) - Key Dependencies:
@blockrun/llm(x402 wallet signature client),@deepseek-ai/schemastery(runtime config schema),@deepseek-ai/cordis(DSH plugin runtime withinject: ['llm','tools','commands']injection points) - Architecture Pattern: Dual bundle plugin—
cordis.patch.ymlsynthesizesblockrun-llm(provider route registration) andblockrun-review(tools/pre-executelistener +/review/gatecommands) in the profile; gate logic matches rules in pre-execution events, and on hit asynchronously calls a stronger model withsafe/dangerous/uncertainthree-tier verdict; the gate can only "tighten" not "release" - Entry Files:
src/index.ts(provider route +/spendcommand),src/review.ts(gate +/review/gatecommands),src/adapter.ts(BlockRun LLM adapter, wrapping wallet signature and streaming responses)
Use Cases
When you're stuck in DSH with the dilemma of "Full Access is too permissive, per-command approval is too tedious," this plugin provides a third option: allow everything by default for daily operations (read/edit/build/commit), only when the agent is about to execute destructive or privilege-escalating operations let a stronger model take a look first; if rejected, give the reason to the agent for correction. At the same time, if you want to leverage capabilities beyond DeepSeek—for example, using Claude for review, Gemini for image understanding, GPT for plan verification—this plugin provides a path without account registration, without API Key, pay-per-use.
Prerequisites & Compatibility
| Dependency | Min Version | Notes |
|---|---|---|
| DeepSeek Harness | >=0.1.0-rc.6 | peerDependencies lists six host packages: dsh-attachment / dsh-commands / dsh-credentials / dsh-launch-environment / dsh-llm / dsh-tools, all require >=0.1.0-rc.6; dsh-attachment is marked optional in peerDependenciesMeta, only needed for visual capabilities |
| Node.js | >=22.19 or >=24 | package.json#engines.node explicitly declares `^22.19 |
| Cordis | >=4.0.1 | peerDependencies."@deepseek-ai/cordis": ">=4.0.1", provided internally by DSH |
| Base Chain USDC | ≥ a few dollars | Wallet key authorized via EIP-3009 signing charges per-use; typical gate review is ~$0.0057, $5 USDC is enough for ~2500 reviews or 5 Opus calls with 100K tokens |
| Platform | Cross-platform | No os / cpu restrictions, no native module dependencies like node-pty, node:sqlite |
Installation
dsh plugin --profile web add dsh-clawrouter
Configuration
The plugin injects two lines into profile's cordis.patch.yml, respectively blockrun-llm (model route) and blockrun-review (gate). The "Purpose" column in the table below is in plain language.
blockrun-llm Route Configuration
| Config | Type | Purpose | Default |
|---|---|---|---|
provider | string | Registration name for this route in DSH | blockrun |
walletKeyEnv | string | Environment variable name holding the EVM wallet private key; the plugin only reads variables you explicitly specify, never scans the disk | BASE_CHAIN_WALLET_KEY |
apiUrl | string | BlockRun API entry point | https://blockrun.ai/api |
timeoutMs | integer | Single request timeout | 300000 (5 minutes) |
requestFeeUsd | number | Fixed fee per request (used for /spend estimation) | 0.002 |
visionModels | string array | List of models allowed to receive images; only includes actually tested working models by default | google/gemini-2.5-flash, google/gemini-3.5-flash, google/gemini-3.6-flash, moonshot/kimi-k3 |
maxOutputCeiling | integer | Default output token ceiling; the gateway settles by "requested max_tokens", so limiting the ceiling avoids being charged full flagship model output by default | 8192 |
auxiliaryModel | string | Cheap model for "maintenance" calls like compressing context, generating session titles; main conversation body won't be rerouted | off |
blockrun-review Gate Configuration
| Config | Type | Purpose | Default |
|---|---|---|---|
enabled | boolean | Whether to actually intercept tool execution; when off, /review and /gate are still usable | false |
reviewerProvider | string | Which provider route the reviewer model uses | blockrun |
reviewerModel | string | Reviewer model id, deliberately chosen to be stronger than the agent itself | anthropic/claude-opus-5 |
timeoutMs | integer | Maximum wait time for a single review | 30000 |
reviewerMaxTokens | integer | Max output tokens for a single review request; the gateway settles by "requested max_tokens", so setting a limit avoids a single review being charged at flagship model's 128K output ceiling | 512 |
onReviewerFailure | ask | deny | When the reviewer model is unreachable, ask for human approval or deny directly | ask |
extraRules | array | Append custom rules {name, pattern, tools?}; pattern is JS regex source string, wrong patterns throw errors at load time rather than silently skipping | [] |
FAQ
Q: After installation it shows "✕ missing peer"—did it fail?
A: Not a failure. The 6 host packages listed in package.json's peerDependencies are injected by Harness at runtime—this is the common practice for all official Bundles; explicit dependencies would cause a second copy of cordis in the profile, which would make instanceof LlmError fail across copies and all error codes become UNKNOWN. To verify, run dsh --profile web --dump-config, you should see both blockrun-llm and blockrun-review synthesized.
Q: Where does the wallet key come from? I don't have an API Key.
A: BlockRun uses wallet signature instead of API Key. Existing BlockRun wallet: export from ~/.blockrun/.session or ~/.openclaw/blockrun/wallet.key; brand new users run npx -y @blockrun/clawrouter to generate a new wallet, fund the address with some Base chain USDC, then export BASE_CHAIN_WALLET_KEY=.... The plugin only reads the environment variable you explicitly specify via walletKeyEnv, never auto-scans the disk—avoiding your configured key being "secretly overwritten" by another key.
Q: After installation, did my default model change?
A: No change. Mounting the blockrun route doesn't change dsh-base's default deepseek-official; that route is either explicitly selected by you or invoked by the review gate. The reviewer model defaults to anthropic/claude-opus-5, charged per-use in USDC.
Q: What operations does the review gate intercept? Will ordinary git commit be asked?
A: No. The rules are deliberately narrow—only intercept truly irreversible or privilege-escalating operations: recursive deletion, raw disk writes, curl … | sh, force push, git reset --hard, chmod 777, sudo, accessing ~/.ssh / ~/.aws / /etc/passwd, and "will be auto-executed later" file writes (git hooks, CI workflows, shell startup files, .gitconfig, postinstall). Daily read/edit/build/commit all pass through; just "mentioning" dangerous commands in command line (grep -rn "rm -rf" docs/) won't trigger false positives because rules anchor to command start position.
Q: What if the reviewer model goes down? Will it be silently allowed through?
A: No. Default onReviewerFailure: ask—when unreachable, escalate to human approval; users needing unattended automation can change to deny, letting the gate reject directly. deny makes the gate "fail closed" (don't let through), ask makes the gate "fail open" (let humans decide), both ensure dangerous commands don't slip through during network jitter.
Q: What does /gate drill do? Can I run it without enabling the gate?
A: /gate drill sends rm -rf / --no-preserve-root through the risk matcher and real reviewer model, but never hands it to any tool for execution. It's used to prove the gate is actually working—/review command registers successfully even when the gate is closed, so just seeing /review work can't prove the gate is active; when gate is disabled, /gate drill directly errors ("nothing to drill").
Q: How do I add custom review rules?
A: In profile's cordis.patch.yml, append {name, pattern, tools?} to blockrun-review's config.extraRules, pattern is JS regex source string, matched against the tool's rendered parameters; tools being empty means applies to all tools. Rules are validated at compile time during load, wrong patterns throw immediately without silent skip.
Q: Will this make DeepSeek cheaper for me?
A: No, this plugin doesn't replace DeepSeek's official billing. BlockRun doesn't support DeepSeek's cache hit discount: cache-hit turns cost ~$0.000056 with official direct connection, ~$0.007 through this plugin with 22K input. It's recommended to keep the main loop using DeepSeek official, this plugin is for things DeepSeek can't do (stronger model review, calling Claude / GPT / Gemini / Grok, x402 micropayments).
Learning Curve
Beginner—installation immediately gives you /spend and 60+ model entry points; the gate is closed by default, you need to manually set enabled: true in cordis.patch.yml to intervene in the execution flow, and you need to have BASE_CHAIN_WALLET_KEY configured beforehand or go through the credential service.
Known Issues & Limitations
- Image requests are rejected rather than silently dropped: When
dsh-attachmentisn't configured, sending images through this route returnsUNSUPPORTED, explicitly pointing to "compose @deepseek-ai/dsh-attachment" (src/serialize.ts:128-133 / README.md:288) - Setting reasoning effort for non-reasoning models is rejected locally: Under the premise of per-request settlement by gateway, the
reasoning_effortfield is first judged locally by directory, models not declaring reasoning capability directly getUNSUPPORTEDrather than being rejected after payment (src/adapter.ts:156-164 / README.md:213) - In-flight requests that haven't finished cannot be interrupted by
AbortSignal:@blockrun/llmcurrently doesn't support passing the signal through to socket, local abort only stops reading; underlying connection remains occupied until SDK's own timeout (src/adapter.ts:218-225 / README.md:290-291) - This plugin doesn't persist spending to disk: Harness session log rejects unknown event types, external repo plugins can't declare their events ignorable;
/spendonly gives in-memory stats, lost across processes, ledger is based on wallet balance (src/spend.ts:8-21 / README.md:292) - "Smart routing" virtual model not enabled: Gateway has
blockrun/autorouter but this plugin doesn't wire it up, because virtual models must declare a context window, declaring max candidate causes smaller models to be incorrectly assigned long context, declaring min candidate causes premature context compression each session (README.md:293) - Compression may trigger earlier than model's actual capability: This route reports capacity based on gateway directory declared windows, no实测 expansion to avoid silent overflow; some models' actual windows are larger than directory values (README.md:294)
- Context overflow judged by request size rather than error text: Gateway rewrites all upstream errors to
{"message":"API request failed"}, regular text matching all fails, so this plugin forcibly judges requests returning 400 with body exceeding declared window as overflow to trigger compression (src/adapter.ts:51-54 / README.md:295) - Previous round reasoning content not passed back: DeepSeek's think mode recommends passing
reasoning_contentback in tool-call cycles, but this route serves multiple vendor models simultaneously, a vendor's mandatory field may be another vendor's rejection field, so multi-step tool calls may slightly degrade on reasoning models (README.md:296)
A second brain for your DeepSeek Harness agent
DeepSeek is fast and cheap — keep it for the loop.
This adds what it cannot do: a stronger model reviews the dangerous command before it runs.
67 models from one wallet. No accounts. No API keys. No credit card.
English | 中文
dsh-clawrouter is a DeepSeek Harness plugin that puts a stronger model in front of your agent's dangerous actions. When the agent proposes
rm -rf ~, a reviewer model reads it and answers allow / deny / ask — enforced by the real tool executor, not by a prompt. It also registers a BlockRun provider route, so the reviewer (and any of 67 models) is reachable from one wallet with no accounts and no API keys, paid per request in USDC over x402. MIT licensed.
dsh plugin --profile web add dsh-clawrouter
Why this exists
Two things people keep asking for in the Harness discussions:
「是否有类似 Codex 或者 CC 的审查模式?即额外调用模型审查指令,以解放双手?Full Access 还是太让人担心了。」 — #421 Is there a review mode like Codex or Claude Code — call an extra model to review the command, to free up my hands? Full Access is too worrying.
「使用 Full Access 模式创建并测试插件时误删了我的整个家目录」 — #461 Testing a plugin in Full Access mode, it deleted my entire home directory.
Full Access is all-or-nothing: approve every command by hand, or approve nothing and hope. This adds a third option.
How it compares
| Approve everything | Full Access | Permission rules | dsh-clawrouter | |
|---|---|---|---|---|
| Hands-free | No | Yes | Yes | Yes |
Catches rm -rf ~ | Only if you notice | No | Only if you wrote the rule | Yes |
| Understands intent | You do | Nothing does | No — literal match | Yes, a model reads it |
| Enforced where | UI prompt | — | Executor | Executor |
| Fails | — | open | closed | to a human, never open |
| Reviews ordinary work | Everything | Nothing | Nothing | Nothing |
What it does
1. Review gate
When the agent proposes something destructive, a strong model (default anthropic/claude-opus-5) reads it and answers:
| Verdict | What happens |
|---|---|
| safe | proceeds to the normal permission chain, untouched |
| dangerous | denied, with a reason the agent can act on |
| uncertain | escalated to you — the normal approval prompt |
It only ever narrows. A call the reviewer clears still faces every sandbox, permission, and approval gate you already have — and an escalation defers to them too: if a stricter policy would have denied the call, you get that denial rather than an approval prompt. This does not replace your permission system; it sits in front of it.
Enable it in your profile's cordis.patch.yml:
- id: blockrun-review
config:
enabled: true
reviewerModel: anthropic/claude-opus-5
What gets reviewed. Deliberately narrow — a gate that fires on ordinary work gets switched off, and then it protects nobody. Reads, edits and builds are never reviewed. The shipped rules flag recursive deletes, raw disk writes, fork bombs, curl … | sh, force-pushes and hard resets, chmod 777, sudo, and anything touching ~/.ssh, ~/.aws, or /etc/passwd — plus destruction that isn't spelled rm: git clean -fdx, find … -delete, git checkout -- ., terraform destroy, and npm publish (a registry will not let you take a release back).
Mentioning a command is not running one — grep -rn "rm -rf" docs/ is not flagged — and neither is writing one: a Makefile containing rm -rf build, a cleanup script, or a README quoting git reset --hard are all ordinary work. File-body arguments (content, new_string, diff, …) are treated as data, because what a file eventually does happens when something executes it, and that execution is a separate call this gate still reads. Add your own rules:
extraRules:
- name: no-prod-deploy
pattern: "deploy\\s+--env[= ]prod"
If you mistype reviewerModel, every flagged command escalates or is denied — which looks exactly like the gate working cautiously. The failure now carries the cause, so a denial reads "BlockRun does not serve model … Did you mean …?" rather than a bare timeout, and a warning is logged wherever a log exporter is composed.
When the reviewer is unreachable, the gate escalates to you (onReviewerFailure: ask, the default). It never silently allows — a safety gate that fails open is worse than none — and never hard-blocks on a network blip. Unattended automation can set deny.
What it costs to leave on
Measured, because this is the question that decides whether you keep it enabled:
| Fires on ordinary work | never — 0 of 59, including commands that merely mention a destructive one (grep -rn "rm -rf" docs/, echo "DROP TABLE" >> notes.md) |
| Misses dangerous work | none of 39, across git, containers, clusters, cloud storage, databases, and host state |
| Catches files that execute later | git hooks, CI workflows, shell startup files, launch agents, .gitconfig, .env, npm postinstall, sandbox escalation — 10 of 10, 0 false positives across 15 ordinary file edits |
| Survives evasion | \rm -rf /, command rm, env rm, eval "rm -rf $DIR", bash -c "…", | xargs rm, and heredocs piped into a shell |
| Cost when it does fire | $0.0057 on claude-opus-5, at the 512-token reviewer cap — $0.0249 without it |
| Latency when it does fire | ~3s |
| What the reviewer sees | ~356 tokens — the flagged call, not your conversation |
That figure depends on the cap. This gateway quotes from the request — input size plus the max_tokens asked for — and settles that amount whichever way the model answers, so a review that asks for room it never uses pays for it every time the gate fires. reviewerMaxTokens (512) is what keeps a two-field JSON verdict priced like one. Before 0.10.0 the reviewer inherited claude-opus-5's advertised 128,000-token output and cost $0.28–0.33 per review; if you are on an earlier version, upgrade rather than switching to a weaker reviewer.
So during normal work it is invisible: no latency, no cost, no prompts. It bills roughly half a cent on the rare command that deserves a second opinion. Both corpora are tests, so a rule that starts flagging npm test — or stops flagging kubectl delete namespace — fails CI rather than your session.
Not every dangerous action is a shell command. Writing .git/hooks/pre-commit, .github/workflows/ci.yml, or an npm postinstall runs code later — on the next commit, the next CI run with your secrets, the next npm install on someone else's machine. These are quieter than rm -rf, and worse for it: a user watching for destruction sees nothing happen at all. Measured before those rules existed, 2 of 10 were flagged.
Recall is the ceiling on everything above: a command the matcher never flags is a command the reviewer never sees. An earlier version of this table claimed nothing was missed, measured against the six commands the rules had been written for. Against the 39 above, those same rules caught one. The corpus exists so that number can never again be taken on faith.
2. /spend
/spend
What this route has cost since the process started — total, per model, tokens and flat fees separately.
You pay for what you request, not what you get. The gateway quotes from the request — input size plus the max_tokens you ask for — and settles that quoted amount whichever way the model answers. Measured against production:
max_tokens requested | claude-opus-5 | deepseek-chat |
|---|---|---|
| 16 | $0.0020 | $0.0020 |
| 1,000 | $0.0036 | $0.0020 |
| 8,000 | $0.0211 | $0.0020 |
| 60,000 | $0.1511 | $0.0027 |
Two things follow, and the second one costs real money.
There is a floor of $0.002 — a $0.001 minimum payment plus a flat $0.001 transaction fee. Below it everything quotes the same, which is why deepseek-chat barely moves in that table: it is cheap enough that even 8,000 output tokens stays under the floor. An earlier version of this section concluded from exactly that observation that billing was per request rather than per token. It was measured only on deepseek-chat, the cheapest model on the route, where the floor hides the rate entirely.
A large max_tokens is billed even when the reply is short. This is why defaultMaxTokens is capped at maxOutputCeiling (8,192) rather than taken from a model's advertised max_output. Left uncapped, claude-opus-5 advertises 128,000, and a request carrying that default quotes $0.3211 — against $0.0216 with no cap at all and $0.0036 capped at 1,000. Eighty-nine times the cost, decided by a field the caller never set. Raise maxOutputCeiling when a workload genuinely needs long replies; you are then paying for them deliberately.
Input size drives the other half of the quote. The same request at growing prompt sizes, max_tokens held small:
| Model | small | ~22K in | ~112K in |
|---|---|---|---|
openai/gpt-4.1-nano | $0.002 | $0.005 | $0.023 |
deepseek/deepseek-chat | $0.002 | $0.007 | $0.031 |
google/gemini-3.5-flash | $0.002 | $0.066 | $0.325 |
anthropic/claude-opus-5 | $0.002 | $0.217 | $1.081 |
Everything starts at the same floor and then diverges by more than thirty-fold. A coding agent holding a 100K-token context pays roughly fifteen times the floor per call on DeepSeek — and five hundred times on Opus. /spend says so whenever your average call carries a large context, and points you at your own model's rate rather than one number. It is also blind to a request that failed after paying. Your wallet balance is the authority.
Reading a 402 quote is free, so every figure above is reproducible without spending anything.
The default requestFeeUsd is 0.002 because that is what the gateway quotes: a 402 for a ~17-token request returns {"amount":"0.002000"}. BlockRun's published pricing page currently says $0.001.
3. /review
/review <paste a diff, a plan, or the agent's conclusion>
Runs the same strong model over material you choose. For the case one user reported: the agent read the right evidence, drew the wrong conclusion, and only a direct challenge surfaced the real bug.
4. /gate — check the net is actually up
/gate # is the gate armed, and with what?
/gate drill # put a dangerous command through the live reviewer
A safety feature that is quietly off is worse than one never installed, because you stopped watching. This gate can be off while everything a user can see looks right: enabled defaults to false, a patch layer replaces a row's whole config rather than merging keys, and /review registers either way — so a working /review tells you the plugin loaded and nothing about whether tool calls are being inspected.
/gate is therefore registered whether or not the gate is armed, and says which. /gate drill sends rm -rf / --no-preserve-root through the risk matcher and the real reviewer — never to a tool — and reports each stage separately, because they fail for unrelated reasons: a rule that stopped matching is a policy problem, an unreachable reviewer is a wallet or model problem. At runtime those both collapse into "escalate", which is indistinguishable from the gate working. The drill is what tells them apart. It costs one reviewer call.
5. Vision — give your agent eyes it does not have
DeepSeek serves no vision model, so this is capability rather than savings. Attach an image and a vision model reads it:
- id: blockrun-llm
config:
visionModels: [google/gemini-3.5-flash] # the default; widen as you verify
The gateway's vision tag is not sufficient, so this plugin does not trust it. Thirty-five entries carry it. Ten were sent the same inline PNG and asked its colour:
| Model | Result |
|---|---|
google/gemini-2.5-flash, gemini-3.5-flash, gemini-3.6-flash | answered correctly |
moonshot/kimi-k3 | answered correctly |
openai/gpt-4o, gpt-4.1, gpt-5.6-sol | HTTP 400 after taking payment |
xai/grok-4.5 | HTTP 503 after taking payment |
anthropic/claude-sonnet-5, claude-opus-5 | HTTP 200, upstream 400 relayed as the model's answer |
Anthropic's is the worst of these. The call returns 200 and streams [Error: 400 {"message":"Could not process image"}] as assistant text, so the harness sees an ordinary successful turn and the agent acts on the error string as though the model wrote it. This plugin now detects that exact shape — the whole message being nothing but a relayed error — and finishes the request as a failure with the status mapped as if it had arrived as one. An answer that merely mentions an error, or a turn that also called a tool, is left alone. So a model is offered image input only when the gateway tags it vision and it appears in visionModels, which defaults to the four measured to work. Both signals must agree — the tag alone over-claims, and the list alone would keep claiming vision for a model the gateway has since retagged.
Widen it yourself as you verify others; that is a config change, not a release here.
6. Reasoning effort
Reasoning models get high and max, declared per model from the catalog's reasoning tag.
max is DeepSeek's vocabulary, which the harness adopts. OpenAI's is low | medium | high, and it returns HTTP 400 after taking payment for anything else — so max is translated to each vendor's nearest value rather than refused. Asking for the most thinking available should not fail over a spelling.
Asking a model that does not reason at all is a different case, and is refused locally, before paying: openai/gpt-4o charges and then rejects reasoning_effort outright. The catalog says which models qualify, so that costs nothing to discover.
7. 67 models from one wallet
Registers a blockrun provider route. Authentication is a wallet signature, not an API key: each request is paid per call in USDC over x402. No signup, no KYC, no credit card, no per-lab account.
That matters most for models DeepSeek does not serve — Claude, GPT, Gemini, Grok — which is exactly what a reviewer needs.
Quick Start
dsh plugin --profile web add dsh-clawrouter
export BASE_CHAIN_WALLET_KEY=0x... # or store it via the credentials service
The install prints ✕ missing peer for six harness packages. That is expected. The harness itself supplies them at runtime, and every first-party bundle declares its peers the same way — the alternative, depending on them directly, gives the profile a second copy of cordis and breaks the plugin in ways that are much harder to read. Verified on a clean install: the profile composes and dsh --profile web --dump-config lists both rows. Nothing is missing.
Where does the key come from? There is no API key to paste — authentication is a wallet signature.
- Already run a BlockRun tool? You have a wallet already. The SDK keeps it at
~/.blockrun/.session, ClawRouter at~/.openclaw/blockrun/wallet.key. Export whichever exists:export BASE_CHAIN_WALLET_KEY=$(cat ~/.blockrun/.session) - No wallet yet?
npx -y @blockrun/clawroutergenerates one and prints its address. Stop it once you have the address, send it a few USDC on Base, then export the key.
This plugin reads neither file on its own. A credential nobody configured, quietly shadowing the one they did, is exactly what the harness credentials seam exists to prevent — so it only ever reads the reference you name.
$5 of USDC on Base covers about 2,500 gate reviews, which run at the $0.002 floor — and about 5 calls carrying a 100K-token context on Opus. Both figures are the same $5; fund for the way you intend to use the route rather than for its floor. The key is a reference in configuration (walletKeyEnv), resolved per request — rotating it takes effect on the very next call, and no secret enters a config file.
Configuration
blockrun-llm — the provider route:
| Key | Default | Meaning |
|---|---|---|
provider | blockrun | harness route key to register |
walletKeyEnv | BASE_CHAIN_WALLET_KEY | credential reference holding the EVM wallet key |
apiUrl | https://blockrun.ai/api | API root |
timeoutMs | 300000 | per-request timeout |
auxiliaryModel | (off) | model for the harness's own maintenance calls — see below |
requestFeeUsd | 0.002 | flat per-request fee, used by /spend — the quoted figure, see below |
Cutting compaction cost
The harness compacts long sessions by summarizing them — and it does that on whatever model the conversation is using. On a flagship model that means paying flagship input rates to summarize, repeatedly, for the whole session.
A ~100K-token compaction runs about $0.90 on Claude Opus 5 and about $0.026 on DeepSeek V4 Flash — read from live 402 quotes at that size, consistent with the table above. Summarizing is a job a cheap model does well, and those calls share no prefix with your conversation — so moving them forfeits no prompt-cache hit:
- id: blockrun-llm
config:
auxiliaryModel: deepseek/deepseek-chat
Off by default, and it only ever affects calls the harness itself marks as maintenance (compaction, session titles). A conversation request is never redirected.
blockrun-review — the gate:
| Key | Default | Meaning |
|---|---|---|
enabled | false | whether the automatic gate intercepts tool calls |
reviewerProvider | blockrun | provider route carrying the reviewer |
reviewerModel | anthropic/claude-opus-5 | use a different, stronger model than the agent |
timeoutMs | 30000 | how long one review may take |
reviewerMaxTokens | 512 | output cap asked for per review, and billed whether or not it is used |
onReviewerFailure | ask | ask escalates to you; deny blocks (unattended runs) |
extraRules | [] | additional {name, pattern, tools} risk rules |
Mounting the route does not change your default model. dsh-base keeps deepseek-official; this route is used only where you ask for it.
Honest notes
- This will not make DeepSeek cheaper. Each request is priced from its own 402 quote — $0.002 at small sizes, climbing with input — and BlockRun does not price DeepSeek's cache-hit discount. A cache-warm agent turn costs DeepSeek about $0.000056 directly against roughly $0.007 here at 22K input tokens. Keep your DeepSeek key for the loop; use this for what DeepSeek cannot do.
- The free tier is a smoke test, not a workhorse. The free NVIDIA models may use prompts for service improvement, so do not point them at a private codebase, and never use one as the reviewer.
- A review costs a model call. It runs only on flagged calls, with a 30s ceiling.
- The reviewer sees the flagged tool call, not your whole repository.
Known limitations
- Images are refused, not silently dropped — image content through this route fails with
UNSUPPORTED; vision is planned. - Reasoning-effort selection is refused rather than quietly ignored.
- An aborted request stops delivery immediately, but the in-flight HTTP request is not itself cancelled until
@blockrun/llmaccepts anAbortSignal; the socket closes on the SDK's own timeout. - This plugin does not record what it spends. Harness session logs refuse event types a build does not know, and an out-of-repo plugin cannot mark its events ignorable, so it writes no session events. It also does not reach
~/.blockrun/cost_log.jsonl: that ledger is written by@blockrun/llm'sLLMClient, and the streaming client this adapter uses tracks its spend in memory only. Check the wallet itself for now — an earlier version of this note pointed at the ledger, which would have shown you other tools' spending rather than this one's. - Smart routing (
blockrun/auto) is not wired up, and not for lack of a router. A virtual model has to report one context window, and the harness sizes compaction from it: report the largest candidate and a turn routed to a smaller model overflows with compaction never firing; report the smallest and every session compacts far too early. Until that has an honest answer, pin a model id —auxiliaryModelalready moves the expensive maintenance calls, which is where the savings actually were. - Compaction may fire earlier than it needs to. This route reports the context window the gateway's model catalog declares. Measured against the live gateway,
openai/gpt-4.1-nanoaccepted a 450,037-token prompt and recalled a marker from the very first line — no truncation, but 3.5x the 128,000 the catalog states. The harness sizes compaction from the declared figure, so a session can compact while the model would still have taken the whole thing. Reported upstream; this plugin reports what the catalog says rather than guessing higher, because over-claiming would trade early compaction for silent overflow. - Context overflow is detected by request size, not by the error text. A real overflow comes back from the gateway as
{"message":"API request failed"}— the provider's wording is sanitized away, so the usual text detectors match nothing. After a 400, a request larger than the model's declared window is therefore treated as an overflow so compaction can recover. The text detectors still run first, so this corrects itself if the gateway stops sanitizing. - Prior-turn reasoning is not sent back. DeepSeek's thinking-mode guide says
reasoning_contentshould be returned on tool-call turns, but this one route serves 67 models from many vendors, and a field one of them requires is a field another may reject. Multi-step tool use on a reasoning model may be slightly degraded as a result; please report it if you hit it.
Development
npm test # 185 offline tests, including two real-cordis-Loader compositions
npm run test:e2e # live gateway tests — spends real USDC (~$0.02); skips without a wallet
npm run sync:models # refresh the model count in both READMEs from the live catalog
npm run test:docker # install the PUBLISHED package in a clean container and assert it composes
Developing against a linked checkout (dsh plugin add /path/to/dsh-clawrouter) pulls this package's devDependencies into the profile, giving a second copy of @deepseek-ai/dsh-llm. instanceof LlmError then fails across the two copies and the harness reports every failure as UNKNOWN instead of its real code. Test error codes from a packed tarball (npm pack) rather than a link.
The live suite is the only thing that exercises the x402 handshake, because the signature is the authentication and no mock can stand in for it. It is deliberately excluded from npm test so it never runs by accident.
Changelog
See CHANGELOG.md. Several early releases fixed silent bugs, so upgrading is worth it if you are on an earlier version.
License
Read the usage guide →
Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.
Listing badge
[](https://deepseek-plugin.org/plugins/BlockRunAI/dsh-clawrouter)Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.