Skip to content

Route ALL OpenClaw LLM calls through AgentWeave proxy, not just delegated subagent ones #180

@arniesaha

Description

@arniesaha

Problem

In Nexus's lakehouse, AgentWeave traces only capture ~6% of OpenClaw (Nix) sessions. The other 94% are visible via OpenClaw's own JSONL shipper (lakehouse.agent_events) but never reach Tempo.

Numbers (from nexus-context-engine-26.lakehouse, time window Apr 14-26)

Source Distinct Nix sessions Total rows
OpenClaw native shipper → agent_events 63 1,945
AgentWeave proxy → spans 4 1,732

Same time window. The AgentWeave side has comparable row counts (each Nix LLM call → one span) but only 4 distinct session.id values, vs 63 distinct session UUIDs the native OpenClaw JSONL shipper recorded.

Furthermore, OpenClaw native data goes back to March 3, 2026 (54 days). AgentWeave traces for any agent only start April 14, 2026 — that's roughly when AgentWeave was introduced, but even so the bridge plugin appears to only intercept LLM calls when Nix is delegated to as a subagent from another agent (Claude Code's session). Direct user-driven Nix sessions (e.g., openclaw invoked from the CLI) bypass the proxy.

Hypothesis

Looking at openclaw-agentweave-bridge plugin: it likely hooks into the subagent-spawn / delegated-invocation code path but not the top-level LLM-call path. So:

  • claude-code → invokes Nix as subagent → bridge active → AgentWeave records → ✅
  • User runs openclaw "do something" directly → bridge inactive → straight to LLM → ❌

Asks

  1. Audit the bridge plugin's hook points and ensure ALL outbound LLM calls from OpenClaw flow through the AgentWeave proxy, not just the delegated-subagent path.
  2. Set prov.session.id to OpenClaw's local session UUID (the same value that ends up in the JSONL) so AgentWeave spans can be joined back to the native shipper's sessions table by id.
  3. Bonus: emit prov.repository / prov.cwd so we can answer "which repo was this session on" from AgentWeave alone (today this only exists in OpenClaw's raw_data.cwd).

Verification

Once fixed, this query against Tempo should approach parity with the native shipper for any 24h window:

# count distinct Nix sessions in last 24h via Tempo
curl ".../api/search?q=%7B%20prov.agent.id%20%3D%20%22nix-v1%22%20%7D&limit=1000&start=$START&end=$END" \
  | jq '[.traces[] | .traceID] | length'

Linked

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions