Skip to content

feat(decisions): add explicit evaluation and Labs opt-in foundation - #155134

Merged
roboclaw-bot merged 17 commits into
openclaw:mainfrom
jjjhenriksen:feat/decision-evaluate
Sep 22, 2026
Merged

roboclaw-bot merged 17 commits into
openclaw:mainfrom
jjjhenriksen:feat/decision-evaluate

Conversation

@jjjhenriksen

@jjjhenriksen jjjhenriksen commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Related: #155115, #155314, #155317
Supersedes: #155795

What Problem This Solves

Agents need one provider-neutral way to evaluate explicit evidence using their configured Decision model, with discoverable provider constraints and a separate opt-in boundary for future automatic experiments.

User Impact

Agents with an effective decisionModel can use the core decision_evaluate tool under normal tool policy and harness capabilities. It supports Boolean, Choice, and Score questions, preserves provider results and provenance, and provides bounded guidance for unsupported input or unavailable providers. The tool works independently of Labs. An explicit empty per-agent model override disables selection; transient provider health does not churn the tool definition.

Provider-declared capabilities are exposed through models.list.decisionModels and used in tool guidance. TypeSafe and ONNX declare supported question types and constraints, including input limits/accounting and confidence semantics. Undeclared limits remain unknown, not unlimited; metadata is not a live-readiness probe.

The TypeSafe-specific evaluation tool registration, tool-specific configuration, and bundled evaluation skill are removed in favor of the shared tool. TypeSafe remains responsible for provider transport and credentials. Callers use explicit shared state and typed questions; provider/model selection comes from the trusted calling agent, not a per-call vendor model override. This description does not claim an automatic migration of legacy tool-policy/configuration entries.

Settings → Labs gains a default-off Decision assistance preference, backed by agents.defaults.experimental.decisionAssistance. Future automatic consumers can use a shared eligibility check requiring explicit global opt-in and the owning agent's effective Decision model, inherited globally or configured per agent. Saved intent is distinct from eligibility; unreadable configuration is shown as unknown. No automatic consumers are connected, and enabling the switch starts no inference. It neither gates the explicit tool nor grants action authority.

Scope boundary: the public, agent-scoped selection/local-availability inspection API requested in the original tool proposal is not implemented here. This PR is related to that proposal rather than automatically closing its remaining requirements.

Why This Change Was Made

  • Keep explicit evaluation on the existing Decision runtime instead of maintaining a separate vendor-owned tool path. Preserve ordinary tool permissions, agent disablement, cancellation, and provider lifecycle behavior.
  • Carry provider capability declarations through the existing manifest/catalog infrastructure and validate explicit requests before dispatch, without confusing capabilities with service health.
  • Separate explicit tool use from consent to automatic experiments. The pure isDecisionAssistanceEligible(config, agentId) helper consumes prepared config and canonical model selection without provider probes, secret resolution, or inference.
  • Consolidate the standalone Labs foundation while preserving the contributor's tool/provider work and commit history. No provider is selected, provisioned, or enabled by the switch.

Evidence

Current implementation head: 5bbb43b00508e85c768231ffb86dc4a3b67a3206. Earlier foundation and UI evidence below remains historical; fresh combined-head checks and real-provider proof are listed separately, not added to the original test count.

  • Conflict resolved: merged pinned main 9eec298184e08a6a3612016bca9932e30cbc2459 without rewriting contributor ancestry. The sole conflict, docs/.generated/config-baseline.sha256, was regenerated with pnpm config:docs:gen, then config:docs:check; coupled counts were regenerated and unchanged. The Knip entry auto-merge preserves both owners.

  • Combined-head checks passed: 152 focused tests across 7 files (baseline renderer/writer, runtime config publication/reread, Decision eligibility/registered tool, and Labs), core/UI typechecks, relevant formatting, and production/full-tree dead-export checks. All exited 0 in secretless Crabbox. The Labs page, registry, copy, and visual styles are unchanged; existing screenshots are reused, not claimed as new captures.

  • Exact-head real ONNX proof: normal plugin/config/service initialization, registered core tool, and real GLiClass Edge CPU inference. Boolean/Choice/Score succeeded with Labs off → on → off. A 1-MiB-plus state was rejected before provider dispatch; empty agent override disabled evaluation without fallback. Missing local model artifacts returned bounded unavailability while the tool remained present. Captured output, forwarding-only dispatch counts, source/tree, commands, model hashes, timings, and run link are in the proof comment; this is not hosted Jev or credential-failure proof.

  • Compatibility checked: the optional Labs Boolean injects no default or automatic work. TypeSafe is absent from stable v2026.9.5, declares host/API >=2026.9.6, and documents first publication as pending; the public npm lookup returned 404. No stable-release Doctor migration is introduced or claimed for private/nightly legacy entries.

  • 210 focused tests passed for eligibility/schema, registered core tool composition with the real Decision runtime and a fixture provider, and Labs state/save/reset behavior. Coverage includes Labs off → on → off without disabling the explicit tool, inherited/per-agent model selection, empty overrides, ordinary tool denies, and no provider dispatch from eligibility checks alone.

  • Selected format/type/lint/i18n/config-baseline/dead-export/import-cycle checks passed. Generated config baselines were regenerated; docs config examples and 14,329 internal links passed. Independent review of the foundation found no actionable P0–P2 findings.

  • Later UI-copy recheck: 61 Labs tests passed, plus a fresh Chromium save/reload/reset flow with a synthetic Gateway and no console/page errors. All contributor-code execution used secretless AWS isolation with trusted bootstrap tooling.

Focused test wall times (pnpm test <file> --maxWorkers=1): eligibility 2.16s, registered tool 30.34s, final Labs UI 4.62s. The new combined tool case took 0.480s; the registered-flow file includes cold core/runtime imports.

Validation limits: no current-head live TypeSafe/Jev result or all-green hosted CI result is claimed. Pre-port CI at 746c168 had integration failures outside the port's changed paths; they were not repaired in this consolidation. Evaluate current-head checks separately.

Before/after

Actual production-built Control UI with a synthetic Gateway, dark theme, 1280×960. Before: contributor head 746c168. After: current copy with saved consent and no Decision model. The footer version is a fixture; no automatic consumer runs.

Before

Labs before foundation port

After

Labs after foundation port with current copy

Historical proof and temporary foundation scaffolding

MertBasar0's live Jev proof covers the earlier fb90f77c8 head. Its provider invocation, host-bound rejection, and unavailable-provider results are historical evidence; its Labs-gating assertions are superseded and do not describe the current explicit tool. The original transcript remains in that comment rather than being duplicated here.

The consumer-free eligibility module has a narrow Knip entry, documented for removal when its first production consumer imports it. The new Boolean config field is represented in regenerated config baselines. Neither is a second runtime or a new plugin framework.

Contributor credit

Original explicit-tool, provider-capability, and integration work by @jjjhenriksen, preserved with its commit ancestry. Labs foundation and consolidation requested by @jalehman; the port commits include his co-author credit.

Work sessions

These links describe the Labs port, not the contributor's original implementation.


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 22, 2026, 6:01 PM ET / 22:01 UTC (Revision 18).

ClawSweeper review

What this changes

Adds provider-neutral decision evaluation, provider capability metadata, and a separate default-off Labs preference while retiring TypeSafe’s standalone evaluation tool.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this remains useful, coordinated work absent from current main. No blocking patch defect remains, and the supplied proof and verified release boundary resolve the previous compatibility concern.

Priority: P2
Reviewed head: 5bbb43b00508e85c768231ffb86dc4a3b67a3206

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent implementation with strong real-provider evidence, inspected UI proof, and no remaining blocking findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The complete, hash-matched ONNX trace exercises the registered core tool and real provider on the reviewed head, demonstrating successful evaluations and zero dispatch after host rejection or agent disablement. Inspected screenshots and recorded browser save/reload/reset evidence cover Labs. Optional schema and leaf-only writes preserve existing state; TypeSafe’s retired settings are outside the verified stable-release contract, so no migration is needed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The complete, hash-matched ONNX trace exercises the registered core tool and real provider on the reviewed head, demonstrating successful evaluations and zero dispatch after host rejection or agent disablement. Inspected screenshots and recorded browser save/reload/reset evidence cover Labs. Optional schema and leaf-only writes preserve existing state; TypeSafe’s retired settings are outside the verified stable-release contract, so no migration is needed.
Evidence reviewed 10 items Pinned introduced scope: Reviewed the merge-base-to-head changes using the supplied introduction identities. The supplied test merge is stale and was not used to claim removal of current-main behavior. Whitespace checks passed and the checkout remained clean.
Still necessary on current main: Current main lacks both new production modules, and its inspected Labs registry lacks Decision assistance. Existing TypeSafe documentation still describes the vendor-specific tool; no merged replacement was established.
One evaluation owner: The new tool obtains agent identity from core assembly, rejects model/agent routing arguments, validates bounds before hashing, and delegates execution to the existing Decision runtime. That runtime retains selection, provider lifecycle, cancellation, and result validation. No Codex-specific dependency contract is introduced.
Findings None None.
Security None None.

How this fits together

The agent’s configured Decision model routes explicitly supplied evidence through OpenClaw’s shared evaluation runtime to a provider, returning typed answers. Labs separately stores consent for future automatic consumers without starting inference.

flowchart TD
  A[Agent evidence and questions] --> B[Tool policy and agent model selection]
  B --> C[Shared Decision runtime]
  D[Provider capability metadata] --> B
  C --> E[Selected provider]
  E --> F[Typed answers or unavailable result]
  G[Labs preference] --> H[Future automatic consumer eligibility]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
Agent review details

Security

None.

PR surface

Source +492, Tests +623, Docs +146, Config 0, Generated 0, Other +4. Total +1265 across 56 files.

View PR surface stats
Area Files Added Removed Net
Source 27 646 154 +492
Tests 15 876 253 +623
Docs 9 239 93 +146
Config 1 1 1 0
Generated 2 5 5 0
Other 2 4 0 +4
Total 56 1771 506 +1265

Review metrics

Metric Value Why it matters
Configuration and activation 1 optional Labs Boolean; 0 automatic consumers The preference records consent without changing existing defaults or initiating inference.

Technical review

Best possible solution:

Keep explicit evaluation on the shared Decision runtime and reserve Labs consent for separately reviewed automatic consumers.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a bug reproduction: this adds capability. The supplied real-provider trace and inspected UI evidence demonstrate the proposed behavior on the reviewed implementation.

Is this the best way to solve the issue?

Yes: reusing the existing selection, evaluation, manifest, and Labs owners avoids competing implementations; the unshipped TypeSafe cutover does not require speculative legacy compatibility.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against bc635fc9400d.

Labels

Label changes:

  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This is a bounded, actively coordinated capability addition without an established production outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The complete, hash-matched ONNX trace exercises the registered core tool and real provider on the reviewed head, demonstrating successful evaluations and zero dispatch after host rejection or agent disablement. Inspected screenshots and recorded browser save/reload/reset evidence cover Labs. Optional schema and leaf-only writes preserve existing state; TypeSafe’s retired settings are outside the verified stable-release contract, so no migration is needed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The complete, hash-matched ONNX trace exercises the registered core tool and real provider on the reviewed head, demonstrating successful evaluations and zero dispatch after host rejection or agent disablement. Inspected screenshots and recorded browser save/reload/reset evidence cover Labs. Optional schema and leaf-only writes preserve existing state; TypeSafe’s retired settings are outside the verified stable-release contract, so no migration is needed.

Evidence

What I checked:

  • Pinned introduced scope: Reviewed the merge-base-to-head changes using the supplied introduction identities. The supplied test merge is stale and was not used to claim removal of current-main behavior. Whitespace checks passed and the checkout remained clean. (5bbb43b00508)
  • Still necessary on current main: Current main lacks both new production modules, and its inspected Labs registry lacks Decision assistance. Existing TypeSafe documentation still describes the vendor-specific tool; no merged replacement was established. (ui/src/pages/labs/labs-registry.ts:73, bc635fc9400d)
  • One evaluation owner: The new tool obtains agent identity from core assembly, rejects model/agent routing arguments, validates bounds before hashing, and delegates execution to the existing Decision runtime. That runtime retains selection, provider lifecycle, cancellation, and result validation. No Codex-specific dependency contract is introduced. (src/agents/tools/decision-tool.ts:17, 5bbb43b00508)
  • Real-provider proof matches the reviewed source: Read the complete proof comment, including its previously omitted harness, and verified its SHA-256 matches captured identity f945014ce4d202f523181578fe143ba4058db1fd82cf41fa05ff7fad07a9cc34. The registered tool uses real ONNX CPU inference through normal plugin/service initialization: Boolean, Choice, and Score succeed with Labs off/on/off; oversized input and subsequent empty agent override dispatch zero provider calls; missing artifacts return bounded unavailability. This establishes the core-tool/provider boundary, not hosted Jev or LLM-chat coverage. (src/agents/tools/decision-tool.ts:50, 5bbb43b00508)
  • Inspected visual proof: Inspected downloaded before/after images from the PR body. They show the new Decision assistance row, saved preference, disabled default, and explicit notice that no features consume the setting yet. The Labs implementation is unchanged between the screenshot-associated preceding head and the reviewed head. The body separately records Chromium save/reload/reset verification with a synthetic Gateway. (ui/src/pages/labs/labs-page.ts:201, 5bbb43b00508)
  • Existing-state compatibility: The Labs Boolean is optional without a schema default; omission does not opt in. Existing Labs writes/reset target only its leaf, preserving model selections and sibling settings. Inspected preservation tests and supplied save/reload/reset evidence support compatibility without a migration. No automatic consumer is connected. (src/config/zod-schema.agent-defaults-base.ts:98, 5bbb43b00508)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-22T16:23:10.176Z sha 8908db6 :: needs real behavior proof before merge. :: [P2] Defer the Labs switch until an automatic consumer uses it | [P3] Document the capability fields at the linked manifest reference
  • reviewed 2026-09-22T18:43:54.267Z sha 75a565c :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-22T18:51:22.845Z sha 75a565c :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-22T19:03:08.819Z sha 746c168 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-22T20:10:14.568Z sha b846266 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-22T20:34:29.444Z sha 2da5fcb :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-22T21:13:45.976Z sha 0a86137 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-22T21:54:12.092Z sha 5bbb43b :: blocked before merge. :: none

@jjjhenriksen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Copy link
Copy Markdown
Contributor Author

Pushed f6e12f3428e to feat/decision-evaluate.

This addresses the latest review blockers:

  • valid oversized batches now remain valid through parsing so the shared runtime can return unsupported-input instead of a misleading malformed-input error;
  • the skill now documents the shared 1 MiB / 20,000-node / depth-32 bounds and provider-specific limits;
  • provider capabilities now carry bounded encoded-token guidance, with ONNX declaring its 512-token limit and correction text telling callers to shorten state or rubric.

Verification: focused Oxfmt check and git diff --check pass. Vitest and the extension TypeScript check remain blocked in the sparse local repair worktree by omitted repository test-support/workspace package files; no passing result is claimed from those lanes.

@MertBasar0

Copy link
Copy Markdown
Contributor

Live Behavioral Proof for decision_evaluate (JEV via Vercel AI Gateway)

Ran live behavioral verification of the registered decision_evaluate tool against typesafe-ai/jev via Vercel AI Gateway. Verified multi-type question evaluation (boolean, choice, score), bounded capability guidance on unsupported input, and unconfigured fallback:

================================================================================
PR #155134: decision_evaluate Tool Live Behavioral Verification Proof
Model: typesafe-ai/jev (via Vercel AI Gateway)
Provider: vercel-ai-gateway (DecisionProviderV1 compliant)
Endpoint: https://ai-gateway.vercel.sh/v4/ai/evaluation-model
Authentication: Bearer [REDACTED]
================================================================================

--- Test Case 1: Live Multi-Type Question Evaluation (Boolean + Choice + Score) ---
Input State: "The user asks: 'How can I set up automated SSL certificate renewal with Let's Encrypt and Nginx on Debian?'"
Computed canonical rubricVersion: decision-v1-659640875c6b1e91d45266ee
Execution latency: 496ms

Tool execution result:
{
  "status": "ok",
  "result": {
    "model": "typesafe-ai/jev",
    "answers": {
      "is_security_topic": {
        "type": "boolean",
        "probabilityTrue": 0.99
      },
      "os_family": {
        "type": "choice",
        "choice": "debian_ubuntu",
        "probabilities": {
          "windows": 0,
          "redhat_fedora": 0,
          "debian_ubuntu": 1,
          "macos": 0
        },
        "confidence": 1
      },
      "difficulty": {
        "type": "score",
        "score": 1.14,
        "probabilities": [
          0.02,
          0.82,
          0.16
        ],
        "confidence": 0.74
      }
    },
    "usage": {
      "inputTokens": 471,
      "outputTokens": 90
    }
  }
}

--- Test Case 2: Unsupported Input with Bounded Provider Capability Guidance ---
Tool fallback result with bounded capability guidance:
{
  "status": "unavailable",
  "reason": "unsupported-input",
  "guidance": "The selected provider supports boolean, choice, score questions. Limits: at most 256 questions, at most 255 Choice alternatives, at most 10 Score levels, at most 8192 provider input tokens; shorten the state or rubric if exceeded."
}

--- Test Case 3: Provider Not Configured Inspection Handling ---
Tool unconfigured fallback result:
{
  "status": "unavailable",
  "reason": "not-configured"
}

=== Live Verification Complete: All Invariants Validated ===

Feel free to pull this snippet directly into the PR description under ## Evidence to clear ClawSweeper's proof requirement!

Copy link
Copy Markdown
Contributor Author

Follow-up verification: after expanding the sparse repair worktree and linking the existing installed dependencies, the focused lane passed: vitest run --config test/vitest/vitest.extensions.config.ts extensions/onnx/src/decisions.test.ts extensions/typesafe/src/decision-tool.test.ts extensions/typesafe/src/registration.test.ts — 3 files, 18 tests passed. Oxfmt and git diff --check also pass. The extension tsc process reached active compilation but exceeded the local runtime budget/heap behavior; no typecheck pass is claimed. Current remote CI: dependency review and security review passing; openclaw/ci-gate pending.

Bind decision_evaluate to the calling agent and existing Decision runtime.
Move capability discovery to manifests and remove the TypeSafe tool surface.
Validate host resource bounds before hashing and keep diagnostics current.

Preserve the contributor commits and provider transport behavior.
Refs: dec-508
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XL and removed size: L labels Sep 21, 2026
Merge main at a3815a8 while preserving the contributor history.
Regenerate the config baseline from the combined source and retain both
independent SDK documentation changes.

Refs: dec-621
Merge pinned main 9eec298 into the existing contributor branch. Resolve the generated config hash conflict with config:docs:gen; preserve Decision, provider, and Labs behavior.

Co-authored-by: jalehman <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Exact-head real Decision-provider proof

Head: 5bbb43b00508e85c768231ffb86dc4a3b67a3206; tree: 0b19ce14797cb7e0ad5b01da052ed7d1ea089bde.

Real ONNX Runtime 1.29.0 CPU inference with GLiClass Edge v3, not a fixture provider or hosted Jev. The 131,130,181-byte graph and tokenizer were downloaded anonymously from the plugin's revision-pinned preset and verified against its SHA256s. Inference ran in the provider's persistent local child process; there was no network inference endpoint or hosted credential.

The source-mode composition harness used normal config validation/writes, loadAndActivateRootPluginRegistry, startPluginServices, and createOpenClawTools. It invoked the registered core decision_evaluate through the unmodified shared Decision runtime. This is a real-provider/core-tool boundary proof, not an LLM-chat or live-Gateway proof. A forwarding wrapper counted calls to the actual registered provider without replacing inputs or results.

  • Inherited global model, Labs off → on → off: all three calls returned real Boolean, Choice, and Score results; exactly one provider dispatch each. Tool assembly/eligibility checks caused no dispatch. Warmup 1,150ms; calls 49/25/20ms.
  • 1,048,577-byte state: host rejection, unsupported-input, zero dispatches. The captured guidance is the source's generic host-bound guidance, not provider-specific capability limits.
  • Empty agent override: fresh tool absent; retained tool returned disabled, zero dispatches—no fallback.
  • Missing local model artifacts: the tool remained available, and a real provider call returned unavailable/transport. This is not a credential-failure or hosted-Jev claim.

Secretless AWS lease cbx_a3e2fecb44d7, successful proof run. Trusted bootstrap checked source SHA, toolchain, and absence of an IAM role; no hydration or Tailscale. Final command, including strict service cleanup and clean-tree checks, exited 0. The first attempt correctly rejected the harness's invalid combination of explicit ownership and a legacy default-agent marker; only that synthetic setup was corrected before this successful run. No product source was modified for proof.

Command inside the admitted checkout:

OPENCLAW_STATE_DIR="$PWD/.openclaw/tmp/real-provider-state" \
OPENCLAW_CONFIG_PATH="$PWD/.openclaw/tmp/real-provider-state/openclaw.json" \
node --import ./scripts/tsx.mjs .openclaw/tmp/real-decision-proof.ts
Actual captured output

Tool output below is the returned details object; duplicate serialized text content is omitted. Other fields are direct observations. No expected response text was inserted.

[
  {
    "event": "artifacts",
    "model": "gliclass-edge-v3.0",
    "source": {
      "kind": "hub",
      "repository": "cnmoro/gliclass-edge-v3.0-onnx",
      "revision": "1167c26c90183f20165120292dc5c7684af406ae",
      "files": [
        {
          "name": "model.onnx",
          "path": "model.onnx",
          "bytes": 131130181,
          "sha256": "5289497ae11bb612806e56eefa168c6338e3e5d9f548e8012f1e10560e19fa8f"
        },
        {
          "name": "tokenizer.json",
          "path": "tokenizer.json",
          "bytes": 3583864,
          "sha256": "b6e09abceac75851eae141e7d51224a9da835c0c03684282fe2d5c42c745754f"
        }
      ]
    },
    "downloadVerifyMs": 185
  },
  {
    "event": "environment",
    "head": "5bbb43b00508e85c768231ffb86dc4a3b67a3206",
    "tree": "0b19ce14797cb7e0ad5b01da052ed7d1ea089bde",
    "node": "v24.19.0",
    "provider": "onnx",
    "model": "gliclass-edge-v3.0",
    "backend": "onnxruntime-node 1.29.0 CPU, persistent local child process; no network inference endpoint",
    "warmupMs": 1150,
    "instrumentation": "forwarding wrapper counts calls to the registered real provider.evaluate; no response substitution"
  },
  {
    "event": "labs-transition",
    "enabled": false,
    "toolPresent": true,
    "dispatchDelta": 1,
    "elapsedMs": 49,
    "result": {
      "status": "ok",
      "result": {
        "model": "gliclass-edge-v3.0",
        "answers": {
          "topic": {
            "type": "choice",
            "choice": "travel",
            "probabilities": {
              "travel": 0.9997163843562904,
              "finance": 0.0002579638862212876,
              "science": 0.00002565175748839849
            }
          },
          "sentiment": {
            "type": "score",
            "score": 1.9998024959862652,
            "probabilities": [
              5.9037527186859644e-8,
              0.00019738593868051524,
              0.9998025550237923
            ]
          },
          "holiday": {
            "type": "boolean",
            "probabilityTrue": 0.9999995527152532
          }
        },
        "usage": {
          "inputTokens": 78
        }
      },
      "provenance": {
        "providerId": "onnx",
        "rubricVersion": "decision-v1-eae3f044b9e1b37ef4b5bf09",
        "runtimeGeneration": "b9b32827-ec82-49d5-8d08-961b9c169cab"
      }
    }
  },
  {
    "event": "labs-transition",
    "enabled": true,
    "toolPresent": true,
    "dispatchDelta": 1,
    "elapsedMs": 25,
    "result": {
      "status": "ok",
      "result": {
        "model": "gliclass-edge-v3.0",
        "answers": {
          "topic": {
            "type": "choice",
            "choice": "travel",
            "probabilities": {
              "travel": 0.9997163843562904,
              "finance": 0.0002579638862212876,
              "science": 0.00002565175748839849
            }
          },
          "sentiment": {
            "type": "score",
            "score": 1.9998024959862652,
            "probabilities": [
              5.9037527186859644e-8,
              0.00019738593868051524,
              0.9998025550237923
            ]
          },
          "holiday": {
            "type": "boolean",
            "probabilityTrue": 0.9999995527152532
          }
        },
        "usage": {
          "inputTokens": 78
        }
      },
      "provenance": {
        "providerId": "onnx",
        "rubricVersion": "decision-v1-eae3f044b9e1b37ef4b5bf09",
        "runtimeGeneration": "b9b32827-ec82-49d5-8d08-961b9c169cab"
      }
    }
  },
  {
    "event": "labs-transition",
    "enabled": false,
    "toolPresent": true,
    "dispatchDelta": 1,
    "elapsedMs": 20,
    "result": {
      "status": "ok",
      "result": {
        "model": "gliclass-edge-v3.0",
        "answers": {
          "topic": {
            "type": "choice",
            "choice": "travel",
            "probabilities": {
              "travel": 0.9997163843562904,
              "finance": 0.0002579638862212876,
              "science": 0.00002565175748839849
            }
          },
          "sentiment": {
            "type": "score",
            "score": 1.9998024959862652,
            "probabilities": [
              5.9037527186859644e-8,
              0.00019738593868051524,
              0.9998025550237923
            ]
          },
          "holiday": {
            "type": "boolean",
            "probabilityTrue": 0.9999995527152532
          }
        },
        "usage": {
          "inputTokens": 78
        }
      },
      "provenance": {
        "providerId": "onnx",
        "rubricVersion": "decision-v1-eae3f044b9e1b37ef4b5bf09",
        "runtimeGeneration": "b9b32827-ec82-49d5-8d08-961b9c169cab"
      }
    }
  },
  {
    "event": "oversized-host-bound",
    "stateUtf8Bytes": 1048577,
    "dispatchDelta": 0,
    "result": {
      "status": "unavailable",
      "reason": "unsupported-input",
      "guidance": "Shorten the state or rubric, reduce question counts, and check the selected model's declared limits. Host bounds are 256 questions, 1 MiB of JSON, 20000 JSON nodes, and depth 32. No evidence was truncated or sent on a host-bound rejection."
    }
  },
  {
    "event": "empty-agent-override",
    "freshToolPresent": false,
    "dispatchDelta": 0,
    "result": {
      "status": "unavailable",
      "reason": "disabled",
      "guidance": "Decision evaluation is disabled for this agent. Ask the operator to select a decisionModel or enable its provider."
    }
  },
  {
    "event": "unavailable-local-artifacts",
    "selectedModel": "onnx/gliclass-base-v3.0",
    "toolPresent": true,
    "dispatchDelta": 1,
    "result": {
      "status": "unavailable",
      "reason": "transport",
      "guidance": "The selected provider could not be reached. Check its service or endpoint before trying again."
    }
  },
  {
    "event": "summary",
    "passed": true,
    "totalProviderDispatches": 4
  }
]
Reproducible source-mode harness (synthetic input only)

Save at .openclaw/tmp/real-decision-proof.ts in the exact checkout above, with its pinned dependencies installed on an allowed secretless host.

import assert from 'node:assert/strict';
import fs from 'node:fs/promises';
import path from 'node:path';
import { execFileSync } from 'node:child_process';
const root=process.cwd();
const state=process.env.OPENCLAW_STATE_DIR!;
const modelDir=path.join(state,'models','onnx');
const record=(event:string,data:unknown)=>console.log('REAL_PROOF '+JSON.stringify({event,...data as object}));
await fs.mkdir(state,{recursive:true});
const configInput={agents:{ownership:'explicit',defaults:{decisionModel:'onnx/gliclass-edge-v3.0',experimental:{decisionAssistance:false}},entries:{main:{},disabled:{decisionModel:''}}},plugins:{allow:['onnx'],load:{paths:[path.join(root,'extensions/onnx')]},entries:{onnx:{enabled:true,config:{modelDir,threads:2,maxLoadedModels:1}}}}};
await fs.writeFile(process.env.OPENCLAW_CONFIG_PATH!,JSON.stringify(configInput));
const {findModel}=await import('../../extensions/onnx/src/catalog.ts');
const {downloadModel,verifyModel}=await import('../../extensions/onnx/src/artifacts.ts');
const model=findModel('gliclass-edge-v3.0')!;
const dlStart=performance.now();
await downloadModel(modelDir,model,AbortSignal.timeout(180_000));
await verifyModel(modelDir,model);
record('artifacts',{model:model.id,source:model.source,downloadVerifyMs:Math.round(performance.now()-dlStart)});
const {readConfigFileSnapshot,setRuntimeConfigSnapshot,writeConfigFile,getRuntimeConfig}=await import('../../src/config/config.ts');
const {loadAndActivateRootPluginRegistry}=await import('../../src/plugins/loader.ts');
const {startPluginServices}=await import('../../src/plugins/services.ts');
const {disposePluginRegistryInstances}=await import('../../src/plugins/runtime.ts');
const {createOpenClawTools}=await import('../../src/agents/openclaw-tools.ts');
const {isDecisionAssistanceEligible}=await import('../../src/agents/decision-assistance.ts');
const snapshot=await readConfigFileSnapshot();
assert.equal(snapshot.valid,true,JSON.stringify(snapshot.issues));
setRuntimeConfigSnapshot(snapshot.config,snapshot.sourceConfig);
const registry=loadAndActivateRootPluginRegistry({config:snapshot.config,onlyPluginIds:['onnx'],preferBuiltPluginArtifacts:false,cache:false,throwOnLoadError:true});
assert.equal(registry.decisionProviders.length,1,JSON.stringify(registry.diagnostics));
const provider=registry.decisionProviders[0]!.host.provider;
assert.equal(provider.id,'onnx');
// Transparent observation only: all requests delegate unchanged to the real provider.
const evaluate=provider.evaluate.bind(provider);
let dispatches=0;
provider.evaluate=async (...args)=>{dispatches++;return evaluate(...args);};
const started=performance.now();
const services=await startPluginServices({registry,config:snapshot.config,throwOnStartError:true,onHandle:()=>{}});
const toolFor=(id='main')=>createOpenClawTools({config:getRuntimeConfig(),agentSessionKey:'agent:'+id+':main',disablePluginTools:true,disableMessageTool:true}).find(t=>t.name==='decision_evaluate');
const batch={state:'I loved the quiet beach holiday and would happily go back.',questions:{topic:{type:'choice',criteria:{travel:'travel and holidays',finance:'finance and banking',science:'scientific research'}},sentiment:{type:'score',criteria:['negative sentiment','neutral sentiment','positive sentiment']},holiday:{type:'boolean',criteria:{true:'The text describes a holiday',false:'The text is unrelated to holidays'}}}};
record('environment',{head:execFileSync('git',['rev-parse','HEAD'],{encoding:'utf8'}).trim(),tree:execFileSync('git',['rev-parse','HEAD^{tree}'],{encoding:'utf8'}).trim(),node:process.version,provider:'onnx',model:model.id,backend:'onnxruntime-node 1.29.0 CPU, persistent local child process; no network inference endpoint',warmupMs:Math.round(performance.now()-started),instrumentation:'forwarding wrapper counts calls to the registered real provider.evaluate; no response substitution'});
try {
 const retained=toolFor();assert.ok(retained);
 for(const enabled of [false,true,false]){
  const cfg=getRuntimeConfig();
  await writeConfigFile({...cfg,agents:{...cfg.agents,defaults:{...cfg.agents?.defaults,experimental:{...cfg.agents?.defaults?.experimental,decisionAssistance:enabled}}}});
  const before=dispatches;
  const tool=toolFor();assert.ok(tool);
  assert.equal(isDecisionAssistanceEligible(getRuntimeConfig(),'main'),enabled);
  assert.equal(toolFor('disabled'),undefined);
  assert.equal(dispatches,before);
  const start=performance.now();const result=await retained.execute('live-'+enabled,batch);
  record('labs-transition',{enabled,toolPresent:!!tool,dispatchDelta:dispatches-before,elapsedMs:Math.round(performance.now()-start),result});
  assert.equal((result.details as any).status,'ok');assert.equal(dispatches-before,1);
 }
 const before=dispatches;
 const result=await retained.execute('host-bound',{...batch,state:'x'.repeat(1024*1024+1)});
 record('oversized-host-bound',{stateUtf8Bytes:1024*1024+1,dispatchDelta:dispatches-before,result});
 assert.equal((result.details as any).reason,'unsupported-input');assert.equal(dispatches,before);
 const cfg=getRuntimeConfig();await writeConfigFile({...cfg,agents:{...cfg.agents,entries:{...cfg.agents?.entries,main:{...cfg.agents?.entries?.main,decisionModel:''}}}});
 assert.equal(toolFor(),undefined);
 const disabled=await retained.execute('disabled',batch);
 record('empty-agent-override',{freshToolPresent:false,dispatchDelta:dispatches-before,result:disabled});
 assert.equal((disabled.details as any).reason,'disabled');assert.equal(dispatches,before);
 await writeConfigFile(cfg);
 const missing={...cfg,agents:{...cfg.agents,defaults:{...cfg.agents?.defaults,decisionModel:'onnx/gliclass-base-v3.0'}}};
 await writeConfigFile(missing);
 const unavailableTool=toolFor();assert.ok(unavailableTool);
 const missBefore=dispatches;const unavailable=await unavailableTool.execute('missing-artifacts',batch);
 record('unavailable-local-artifacts',{selectedModel:'onnx/gliclass-base-v3.0',toolPresent:true,dispatchDelta:dispatches-missBefore,result:unavailable});
 assert.equal((unavailable.details as any).status,'unavailable');
 record('summary',{passed:true,totalProviderDispatches:dispatches});
}finally{await services.stop({strict:true});await disposePluginRegistryInstances(registry);}

Compatibility disposition: the Labs Boolean is optional and injects no default or automatic work; existing saved-model/reset behavior is preserved. The TypeSafe adapter is absent from stable tag v2026.9.5; its README and install/API metadata require >=2026.9.6 and identify first publication as pending. The public npm package lookup returned 404 on this check. No stable-release Doctor migration is justified or claimed; this does not promise automatic migration for private/nightly legacy configurations.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review — current head 5bbb43b resolves the generated-baseline conflict. Exact-head real ONNX registered-tool proof, actual host-bound output with zero dispatch, and the compatibility disposition are now linked in the PR body: #155134 (comment). The visible Revision 16 still reviews the previous head.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 22, 2026
@roboclaw-bot
roboclaw-bot merged commit f9e969c into openclaw:main Sep 22, 2026
247 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 22, 2026
* commit '7d7f977ccfc1ac177526232e4f4960febd010015': (91 commits)
  test: avoid unused target setup in package profile fixtures (#155972)
  fix(worktrees): batch snapshot metadata reads
  test(plugin-state): distinguish borrowed and foreign lifecycle owners
  refactor(agents): share external harness session and attempt machinery (#152181)
  chore(i18n): refresh native locales (#156006)
  chore(test): retain Doctor fixture settlement diagnostics (#155944)
  perf(codex): reuse unchanged inference request bytes (#155987)
  perf(test): prepare snapshot ownership subprocess imports (#155973)
  perf(test): consolidate channel registry coverage (#155014)
  fix(runtime): preserve Node worker dependencies and cleanup diagnostics (#155292)
  perf(test): prepare worktree GC child runtime (#155928)
  fix(ui): open browser cards after delayed panel renders (#153253)
  fix(update): retain the running updater by hard link instead of copying the package (#155977)
  feat(decisions): add explicit evaluation and Labs opt-in foundation (#155134)
  fix(state): preserve lifecycle custody across worker dispatch
  improve: reuse shared tooling fixtures and defer legacy updater proof (#155731)
  improve(ui): reduce real-Gateway test preparation (#155979)
  perf(state): move session RPC SQL off the Gateway main thread (#155740)
  docs(freebsd): explain native Codex runtime limits (#155980)
  fix(qa): count Code Mode nested tool activity as transcript tool evidence (#155976)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…penclaw#155134)

Add provider-neutral explicit Decision evaluation through the existing runtime, declared provider capabilities, and a default-off Labs consent foundation. Keep explicit evaluation independent of Labs and retire the unreleased TypeSafe-specific tool. No automatic consumer or public selection/local-availability inspection API is added.

Verified the registered core tool with real ONNX CPU inference, host-bound rejection before dispatch, and agent disablement. Preserve the contributor implementation and the reviewed Labs UI/config behavior.

Related: openclaw#155115, openclaw#155314, openclaw#155317

Co-authored-by: Jacqueline Henriksen <[email protected]>
Co-authored-by: jalehman <[email protected]>
Co-authored-by: Josh Lehman <[email protected]>
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
@jjjhenriksen
jjjhenriksen deleted the feat/decision-evaluate branch September 27, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. plugin: onnx plugin: typesafe proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants