Skip to content

prepareNextTurn hook is ignored - model never swaps #577

Description

@Fletu94

Summary

The prepareNextTurn hook in Mods returns successfully but the model swap is never applied. The session model stays the same for all turns, even when passing full official provider model IDs (e.g. minimaxai/minimax-m2.5).

Expected Behavior

When prepareNextTurn returns { model: "minimaxai/minimax-m2.5" }, the next turn should swap and execute with minimaxai/minimax-m2.5.

Actual Behavior

The model never changes. My usage dashboard shows deepseek/deepseek-v4-flash (the session model) used for all turns, even though the hook returns a different model ID.

Steps to reproduce the issue

cmd.hooks({
  onStop: async () => {
    return {
      continue: true,
      reason: "next prompt",
      prepareNextTurn: {
        model: "minimaxai/minimax-m2.5", // full official provider model ID
      },
    };
  },
});

Command Code Version

1.3.0

Operating System

macOS

Terminal/IDE

ghostty

Shell

command

Additional context

ec68a19a-4eaf-4ee8-a987-17e7ee7aabda session

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions