Skip to content

LCM summarizer cannot resolve OAuth-based provider credentials after #163 fix (v0.5.1) #177

@sene1337

Description

@sene1337

Summary

After the fix in PR #163 (v0.5.1), configuring summaryProvider: "openai-codex" with summaryModel: "gpt-5.4" results in compaction auth failures and 60-second timeouts. The summarizer correctly avoids inheriting the runtime session auth profile (per #162 fix), but then has no auth path to resolve credentials for OAuth-based providers like openai-codex.

Environment

  • OpenClaw: 2026.3.23-2
  • lossless-claw: 0.5.1
  • Host: macOS arm64 (Apple Silicon)
  • Summary config:
    {
      "summaryProvider": "openai-codex",
      "summaryModel": "gpt-5.4"
    }
  • Auth profile for openai-codex: OAuth-based (access, refresh, expires, accountId) — no API key

Expected behavior

When an explicit summaryProvider is configured and that provider uses OAuth auth (stored in per-agent auth-profiles), the summarizer should be able to resolve credentials and complete summarization.

Actual behavior

Compaction fails repeatedly with:

[lcm] summarizer timed out; provider=openai-codex; model=gpt-5.4; timeout=60000ms
[lcm] compaction failed: provider auth error. Check that the configured summaryProvider has valid API credentials. Current: openai-codex/gpt-5.4

The main session uses openai-codex without issue — chat completions work fine because the core runtime resolves the OAuth token from auth-profiles.json. But LCM's summarizer, after #163's fix correctly strips the inherited auth profile, ends up with authProfileId = undefined and cannot resolve the OAuth credential on its own.

Root cause analysis

The fix in #163 was correct for its target problem (auth drift from wrong inherited profiles). However, it created a new gap:

  1. Pre-fix: avoid summarizer auth-profile leakage #163: summarizer inherited the runtime auth profile → worked for OAuth providers (but drifted when multiple agents had different profiles, as reported in LCM summarizer inherits runtime authProfileId and causes summary auth drift #162)
  2. Post-fix: avoid summarizer auth-profile leakage #163: summarizer strips inherited auth profile when explicit summaryProvider is set → authProfileId becomes undefinedgetApiKey() with no profile ID cannot find OAuth credentials → auth fails → 60s timeout → fallback to truncation

The openai-codex provider in OpenClaw uses OAuth by default (not API keys). The credentials live in per-agent auth-profiles.json files and require an authProfileId to resolve. With that stripped, there's no path to the token.

Workaround

Switch summaryProvider to a provider that uses a standard API key (e.g., openrouter with anthropic/claude-sonnet-4-6), which resolves via the provider config's apiKey field without needing an auth profile.

Suggested fix

When the summarizer has an explicit summaryProvider configured:

  1. Don't inherit the runtime session's auth profile (current behavior, correct)
  2. But do attempt to resolve the auth profile that matches the configured summaryProvider — e.g., look up the default auth profile for that provider, or accept an optional summaryAuthProfile config field
  3. Alternatively, document that OAuth-based providers are unsupported for LCM summarization and require API-key-based providers

Related

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