Skip to content

[Bug]: Usage page ignores providerInstances — only the default Claude/Codex homes are scanned, second Claude-driver instances never appear #7514

Closed as not planned

Description

@krutftw

What happened

The Usage page only ever reflects the default Claude home and the default Codex home. With a second Claude-driver provider instance configured (providerInstances.kimi → driver claudeAgent, its own homePath/CLAUDE_CONFIG_DIR, Anthropic-compatible endpoint), threads run through that instance are invisible in Usage — no provider row, no model rows, nothing in the daily chart — even though its transcripts are written under its own <homePath>/projects exactly like the default instance's.

Diagnosis

UsageService.resolveTranscriptDirs (apps/server, //#region src/usage/UsageService.ts) reads only the legacy single-instance settings:

const claudeHome = yield* resolveClaudeHomePath(settings.providers.claudeAgent);
const claudeDir  = yield* resolveClaudeTranscriptDir(claudeHome);
const codexLayout = yield* resolveCodexHomeLayout(settings.providers.codex);
return [{ provider: "claude", dir: claudeDir }, { provider: "codex", dir: path.join(codexLayout.sharedHomePath, "sessions") }];

settings.providerInstances is never consulted, so any non-default instance (second Claude home, a Codex instance with a different homePath/shadowHomePath) is excluded from the scan. The rest of the pipeline (readFileRecords, dedupe, per-provider attribution) is keyed only by "claude" | "codex", so there is also no way to attribute usage to an instance even if its directory were added.

Suggested fix (small, contained): build the dir list from providerInstances — for every claudeAgent instance use resolveClaudeTranscriptDir(resolveClaudeHomePath(instance.config)), for every codex instance resolveCodexHomeLayout(instance.config).sharedHomePath + "/sessions" — dedupe by path, and tag records with instanceId so the UI can show an instance row (display name) instead of lumping everything under "Claude Code"/"Codex". Models the instance serves under non-Anthropic slugs (here k3-256k, k3[1m], kimi-for-coding) would then at least show token counts (they have no LiteLLM rate, so cost stays blank — same as gpt-5.3-codex-spark/codex-auto-review today).

Steps to reproduce

  1. Add a second Claude-driver instance in settings.json with a different config.homePath (e.g. C:\Users\<user>\.claude-kimi) and run a thread on it.
  2. Confirm a transcript appears under <homePath>\projects\…\*.jsonl.
  3. Open Usage: the instance and its models are absent; UsageService.resolveTranscriptDirs span shows only the two default dirs.

Version

0.0.34-nightly.20260819.1132 (commit 36f4314).

Environment

Windows 11 Pro 10.0.26100; providerInstances: claudeAgent (default), kimi (claudeAgent driver, homePath ~/.claude-kimi), codex, cursor, grok.

Evidence

# UsageService.resolveTranscriptDirs span: Success, 67 ms — returns exactly two entries (claude default projects dir, ~/.codex/sessions)
# Usage page (UI Automation dump): provider rows = "Codex", "Claude Code" only; model rows = gpt-5.6-sol, claude-opus-5, claude-fable-5, claude-opus-4-8, gpt-5.6-terra, claude-haiku-4-5-20251001, gpt-daybreak-blue-latest ($0.00 / 326M), gpt-5.3-codex-spark (no cost / 5.86M), codex-auto-review (no cost / 1.62M), <synthetic> (0)
# no k3-256k / k3[1m] rows although ~/.claude-kimi/projects contains today's transcripts

Related issues

#7088 (usage scan performance) is about scan cost, not coverage; no existing issue covers provider instances in Usage.

Fix applied or workaround

None (no setting to add transcript dirs).

Filed by

Claude (Fable 5) via Claude Code on the reporter's machine, at the reporter's request.

Activity

  1. t3-code-bot commented on Aug 20, 2026

    @t3-code-bot
    Contributor

    closing as a duplicate of #5805 so the issue stays tracked in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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