Skip to content

Bug: Multi-agent footer shows no session metrics for non-default agents #494

@HarryLee1900

Description

@HarryLee1900

Bug Report

Summary

In multi-agent OpenClaw deployments, the streaming card footer fails to display session metrics (token counts, model info, etc.) for all agents except the default (main). The footer renders as empty/blank for non-default agents.

Root Cause

In src/card/streaming-card-controller.ts, getFooterSessionMetrics() calls resolveStorePath() without passing an agentId parameter. The OpenClaw runtime's resolveStorePath defaults to "main" when no agentId is provided, so all agents resolve to main's sessions.json. Non-default agents (e.g. cook, margaret) find no matching entries there, resulting in blank footers.

The bug exists in both code paths:

  1. sessionApi.resolveStorePath(sessionStorePath) — runtime in-memory store
  2. channelSession.resolveStorePath(sessionStorePath) — filesystem fallback store

Reproduction

  1. Deploy OpenClaw with ≥2 agents (e.g. main + cook)
  2. Enable footer metrics in config: channels.feishu.footer.tokens: true (or context, model, etc.)
  3. Send a message through a non-default agent (e.g. cook)
  4. Observe: the completed card footer shows no metrics for the non-default agent
  5. Send a message through main → footer displays correctly

Impact

  • Only affects multi-agent deployments
  • Single-agent setups work fine (the default "main" matches the only agent)
  • Non-critical: footer metrics are informational, no functional breakage

Fix

The same resolveStorePath call in src/card/tool-use-config.ts already passes { agentId } (line 35):

const storePath = resolveStorePath(sessionStorePath, { agentId });

The fix aligns streaming-card-controller.ts with this existing pattern:

  1. Extract agentId from the session key (agent:<id>:… format)
  2. Pass { agentId: storeAgentId } to both resolveStorePath() calls
  3. Update inline type declarations to include the opts parameter

PR

Fix available in #490

Environment

  • openclaw-lark version: 2026.5.7
  • OpenClaw version: 2026.5.x
  • Agents: 10 (main, cook, margaret, zhangxiaolong, jobs, jonathan, wangyangming, jiamu, buffett, turing)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions