openclaw - ✅(Solved) Fix Feature: Auto-revert to primary model after image analysis [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77090Fetched 2026-05-05 05:52:22
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
3
Author
Timeline (top)
commented ×1cross-referenced ×1subscribed ×1

After using the vision/image model for analyzing images, the session stays on the vision model instead of automatically reverting to the primary/default model. Users have to manually run /model default to switch back.

Root Cause

After using the vision/image model for analyzing images, the session stays on the vision model instead of automatically reverting to the primary/default model. Users have to manually run /model default to switch back.

Fix Action

Fixed

PR fix notes

PR #77209: feat(sessions): auto-revert to primary model after image analysis

Description (problem / solution / changelog)

Summary

After using a vision/image model for analyzing images (via fallback mechanism), the session stays on the vision/fallback model instead of automatically reverting to the primary/default model. Users have to manually run /model default to switch back.

Changes

  • New config option: agents.defaults.revertAfterImageModel (boolean, default: false)

    • When enabled, automatically reverts the session model override back to the primary model after image or PDF analysis completes
    • Only reverts when the model override was set automatically (modelOverrideSource === "auto"), preserving user-initiated model switches
    • Backward compatible (opt-in via config)
  • Files modified:

    • src/config/zod-schema.agent-defaults.ts - Zod schema for new option
    • src/config/types.agent-defaults.ts - TypeScript type for new option
    • src/config/schema.base.generated.ts - JSON schema entries
    • src/config/schema.labels.ts - Label for config UI
    • src/config/schema.help.ts - Help text for config
    • src/auto-reply/reply/agent-runner.ts - Revert logic after agent run completes

How it works

When agents.defaults.revertAfterImageModel is true:

  1. After an agent turn completes, if the session has an auto model override (modelOverrideSource: "auto")
  2. The override is reverted back to the default/primary model (followupRun.run.provider/model)
  3. The session store is updated and persisted
  4. A verbose log entry is emitted for debugging

User-initiated model overrides (modelOverrideSource: "user") are never reverted.

Closes #77090

Changed files

  • src/auto-reply/reply/agent-runner.ts (modified, +45/-0)
  • src/config/schema.base.generated.ts (modified, +3/-0)
  • src/config/schema.help.ts (modified, +2/-0)
  • src/config/schema.labels.ts (modified, +1/-0)
  • src/config/types.agent-defaults.ts (modified, +2/-0)
  • src/config/zod-schema.agent-defaults.ts (modified, +2/-0)

Code Example

{
  agents: {
    defaults: {
      model: {
        primary: "lmstudio/minimax/minimax-m2.5",
        revertAfterImageModel: true
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Description

After using the vision/image model for analyzing images, the session stays on the vision model instead of automatically reverting to the primary/default model. Users have to manually run /model default to switch back.

Expected behavior

Once image analysis completes, the model should automatically revert to the configured primary model (e.g., lmstudio/minimax/minimax-m2.5).

Proposed solution

Add a configuration option like:

{
  agents: {
    defaults: {
      model: {
        primary: "lmstudio/minimax/minimax-m2.5",
        revertAfterImageModel: true
      }
    }
  }
}

Or alternatively, detect when the image tool has finished its turn and automatically switch back to the primary model.

Use case

Any user who switches between text-only conversations and image analysis would benefit from this - currently the model stays on the vision model until explicitly changed, which is inconvenient for mixed conversations.

extent analysis

TL;DR

Implementing a configuration option to revert to the primary model after image analysis or detecting when the image tool finishes its turn can resolve the issue.

Guidance

  • Consider adding a revertAfterImageModel configuration option as proposed to automatically switch back to the primary model.
  • Alternatively, explore detecting the completion of the image tool's turn to trigger a model switch, potentially through event listeners or callbacks.
  • Verify the effectiveness of either approach by testing mixed conversations that involve both text-only interactions and image analysis.
  • Evaluate the impact of this change on user experience, especially for those frequently switching between text and image-based conversations.

Example

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "lmstudio/minimax/minimax-m2.5",
        "revertAfterImageModel": true
      }
    }
  }
}

Notes

The proposed solution assumes that adding a configuration option or detecting the image tool's completion is technically feasible and does not introduce unintended side effects.

Recommendation

Apply the workaround by implementing the revertAfterImageModel configuration option, as it seems to directly address the issue with minimal disruption to the existing functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Once image analysis completes, the model should automatically revert to the configured primary model (e.g., lmstudio/minimax/minimax-m2.5).

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Feature: Auto-revert to primary model after image analysis [1 pull requests, 1 comments, 2 participants]