@@ -15,10 +15,10 @@ Complete reference for ClawRouter configuration options.
1515
1616## Environment Variables
1717
18- | Variable | Default | Description |
19- | ----------| ---------| -------------|
20- | ` BLOCKRUN_WALLET_KEY ` | - | Ethereum private key (hex, 0x-prefixed). Used if no saved wallet exists. |
21- | ` BLOCKRUN_PROXY_PORT ` | ` 8402 ` | Port for the local x402 proxy server. |
18+ | Variable | Default | Description |
19+ | --------------------- | ------- | ------------------------------------------------------------------------ |
20+ | ` BLOCKRUN_WALLET_KEY ` | - | Ethereum private key (hex, 0x-prefixed). Used if no saved wallet exists. |
21+ | ` BLOCKRUN_PROXY_PORT ` | ` 8402 ` | Port for the local x402 proxy server. |
2222
2323### BLOCKRUN_WALLET_KEY
2424
@@ -29,6 +29,7 @@ export BLOCKRUN_WALLET_KEY=0x...your_private_key...
2929```
3030
3131** Resolution order:**
32+
32331 . Saved file (` ~/.openclaw/blockrun/wallet.key ` ) — checked first
33342 . ` BLOCKRUN_WALLET_KEY ` environment variable — used if no saved file
34353 . Auto-generate — creates new wallet and saves to file
@@ -45,6 +46,7 @@ openclaw gateway restart
4546```
4647
4748** Behavior:**
49+
4850- If a proxy is already running on the configured port, ClawRouter will ** reuse it** instead of failing with ` EADDRINUSE `
4951- The proxy returns the wallet address of the existing instance, not the configured wallet
5052- A warning is logged if the existing proxy uses a different wallet
@@ -66,6 +68,7 @@ curl "http://localhost:8402/health?full=true" | jq
6668```
6769
6870Response:
71+
6972``` json
7073{
7174 "status" : " ok" ,
@@ -115,6 +118,7 @@ Session 2: startProxy() → detects existing, reuses handle
115118```
116119
117120** Behavior:**
121+
118122- Health check is performed on the configured port before starting
119123- If responsive, returns a handle that uses the existing proxy
120124- ` close() ` on reused handles is a no-op (doesn't stop the original server)
@@ -129,10 +133,10 @@ const proxy = await startProxy({
129133 walletKey: " 0x..." ,
130134
131135 // Port configuration
132- port: 8402 , // Default: 8402 or BLOCKRUN_PROXY_PORT
136+ port: 8402 , // Default: 8402 or BLOCKRUN_PROXY_PORT
133137
134138 // Timeouts
135- requestTimeoutMs: 180000 , // 3 minutes (covers on-chain tx + LLM response)
139+ requestTimeoutMs: 180000 , // 3 minutes (covers on-chain tx + LLM response)
136140
137141 // API base (for testing)
138142 apiBase: " https://blockrun.ai/api" ,
@@ -191,8 +195,8 @@ plugins:
191195
192196 # Context-based overrides
193197 overrides :
194- largeContextTokens : 100000 # Force COMPLEX above this
195- structuredOutput : true # Bump to min MEDIUM for JSON/YAML
198+ largeContextTokens : 100000 # Force COMPLEX above this
199+ structuredOutput : true # Bump to min MEDIUM for JSON/YAML
196200` ` `
197201
198202---
@@ -201,12 +205,12 @@ plugins:
201205
202206### Default Tier Mappings
203207
204- | Tier | Primary Model | Fallback Chain |
205- |------| ---------------| ----------------|
206- | SIMPLE | ` google/gemini-2.5-flash` | `deepseek/deepseek-chat` |
207- | MEDIUM | `deepseek/deepseek-chat` | `openai/gpt-4o-mini`, `google/gemini-2.5-flash` |
208- | COMPLEX | `anthropic/claude-sonnet-4` | `openai/gpt-4o`, `google/gemini-2.5-pro` |
209- | REASONING | `deepseek/deepseek-reasoner` | `openai/o3-mini`, `anthropic/claude-sonnet-4` |
208+ | Tier | Primary Model | Fallback Chain |
209+ | --------- | ---------------------------- | ----------------------------------------------- |
210+ | SIMPLE | ` google/gemini-2.5-flash` | `deepseek/deepseek-chat` |
211+ | MEDIUM | `deepseek/deepseek-chat` | `openai/gpt-4o-mini`, `google/gemini-2.5-flash` |
212+ | COMPLEX | `anthropic/claude-sonnet-4` | `openai/gpt-4o`, `google/gemini-2.5-pro` |
213+ | REASONING | `deepseek/deepseek-reasoner` | `openai/o3-mini`, `anthropic/claude-sonnet-4` |
210214
211215# ## Fallback Chain
212216
@@ -226,7 +230,7 @@ Max fallback attempts: 3 models per request.
226230routing:
227231 tiers:
228232 COMPLEX:
229- primary: "openai/gpt-4o" # Use GPT-4o instead of Claude
233+ primary: "openai/gpt-4o" # Use GPT-4o instead of Claude
230234 fallback:
231235 - "anthropic/claude-sonnet-4"
232236 - "google/gemini-2.5-pro"
@@ -238,22 +242,22 @@ routing:
238242
239243The 14-dimension weighted scorer determines query complexity :
240244
241- | Dimension | Weight | Detection |
242- |-----------| --------| -----------|
243- | `reasoningMarkers` | 0.18 | "prove", "theorem", "step by step" |
244- | `codePresence` | 0.15 | "function", "async", "import", "```" |
245- | `simpleIndicators` | 0.12 | "what is", "define", "translate" |
246- | `multiStepPatterns` | 0.12 | "first...then", "step 1", numbered lists |
247- | `technicalTerms` | 0.10 | "algorithm", "kubernetes", "distributed" |
248- | `tokenCount` | 0.08 | short (<50) vs long (>500) |
249- | `creativeMarkers` | 0.05 | "story", "poem", "brainstorm" |
250- | `questionComplexity` | 0.05 | Multiple question marks |
251- | `constraintCount` | 0.04 | "at most", "O(n)", "maximum" |
252- | `imperativeVerbs` | 0.03 | "build", "create", "implement" |
253- | `outputFormat` | 0.03 | "json", "yaml", "schema" |
254- | `domainSpecificity` | 0.02 | "quantum", "fpga", "genomics" |
255- | `referenceComplexity` | 0.02 | "the docs", "the api", "above" |
256- | `negationComplexity` | 0.01 | "don't", "avoid", "without" |
245+ | Dimension | Weight | Detection |
246+ | --------------------- | ------ | ---------------------------------------- |
247+ | `reasoningMarkers` | 0.18 | "prove", "theorem", "step by step" |
248+ | `codePresence` | 0.15 | "function", "async", "import", "```" |
249+ | `simpleIndicators` | 0.12 | "what is", "define", "translate" |
250+ | `multiStepPatterns` | 0.12 | "first...then", "step 1", numbered lists |
251+ | `technicalTerms` | 0.10 | "algorithm", "kubernetes", "distributed" |
252+ | `tokenCount` | 0.08 | short (<50) vs long (>500) |
253+ | `creativeMarkers` | 0.05 | "story", "poem", "brainstorm" |
254+ | `questionComplexity` | 0.05 | Multiple question marks |
255+ | `constraintCount` | 0.04 | "at most", "O(n)", "maximum" |
256+ | `imperativeVerbs` | 0.03 | "build", "create", "implement" |
257+ | `outputFormat` | 0.03 | "json", "yaml", "schema" |
258+ | `domainSpecificity` | 0.02 | "quantum", "fpga", "genomics" |
259+ | `referenceComplexity` | 0.02 | "the docs", "the api", "above" |
260+ | `negationComplexity` | 0.01 | "don't", "avoid", "without" |
257261
258262# ## Custom Keywords
259263
@@ -265,13 +269,13 @@ routing:
265269 - "prove"
266270 - "theorem"
267271 - "formal verification"
268- - "type theory" # Custom
272+ - "type theory" # Custom
269273
270274 # Add framework-specific code triggers
271275 codeKeywords:
272276 - "function"
273- - "useEffect" # React-specific
274- - "prisma" # ORM-specific
277+ - "useEffect" # React-specific
278+ - "prisma" # ORM-specific
275279` ` `
276280
277281---
@@ -285,6 +289,7 @@ confidence = 1 / (1 + exp(-k * (score - midpoint)))
285289` ` `
286290
287291Parameters :
292+
288293- ` k = 8` — steepness of the sigmoid curve
289294- ` midpoint = 0.5` — score at which confidence = 50%
290295
@@ -294,10 +299,10 @@ Parameters:
294299routing:
295300 classifier:
296301 # Require higher confidence for tier assignment
297- confidenceThreshold: 0.8 # Default: 0.7
302+ confidenceThreshold: 0.8 # Default: 0.7
298303
299304 # Force REASONING tier at lower confidence
300- reasoningConfidence: 0.90 # Default: 0.97
305+ reasoningConfidence: 0.90 # Default: 0.97
301306` ` `
302307
303308---
0 commit comments