Skip to content

fix(actions): rename generate_next_step to generate_next_steps for task-specific LLM support#1603

Open
Pouyanpi wants to merge 1 commit intodevelopfrom
fix/generate-next-steps-action-rename
Open

fix(actions): rename generate_next_step to generate_next_steps for task-specific LLM support#1603
Pouyanpi wants to merge 1 commit intodevelopfrom
fix/generate-next-steps-action-rename

Conversation

@Pouyanpi
Copy link
Collaborator

Description

Fixes a naming mismatch bug where the action generate_next_step (singular) didn't match the Task enum value generate_next_steps (plural). This mismatch prevented task-specific LLM configuration from working correctly.

When users configured a task-specific LLM with type: generate_next_steps in their config, the runtime would look for generate_next_step_llm (based on the action name) but the config registered generate_next_steps_llm, causing the task to fall back to the main LLM instead.

…sk-specific LLM support

Fixes a naming mismatch bug where the action `generate_next_step`
(singular) didn't match the Task enum value `generate_next_steps`
(plural). This mismatch prevented task-specific LLM configuration from
working correctly.

When users configured a task-specific LLM with `type:
generate_next_steps` in their config, the runtime would look for
`generate_next_step_llm` (based on the action name) but the config
registered `generate_next_steps_llm`, causing the task to fall back to
the main LLM instead.
@Pouyanpi Pouyanpi added this to the v0.21 milestone Jan 27, 2026
@Pouyanpi Pouyanpi self-assigned this Jan 27, 2026
@Pouyanpi Pouyanpi added the bug Something isn't working label Jan 27, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

Fixed critical naming mismatch bug where the action generate_next_step (singular) didn't match the Task enum value generate_next_steps (plural), preventing task-specific LLM configuration from working.

Key Changes:

  • Renamed action method from generate_next_step to generate_next_steps in nemoguardrails/actions/llm/generation.py:600
  • Updated all references across Colang flows, filters, tests, and configuration files
  • Added comprehensive test test_task_specific_model.py that validates task-specific LLM selection works correctly

Impact:
When users configure task-specific LLMs with type: generate_next_steps, the system now correctly looks up generate_next_steps_llm (based on the action name) and finds the registered task-specific LLM instead of falling back to the main LLM.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it's a straightforward naming consistency fix with comprehensive test coverage
  • The change is a simple, consistent rename across the codebase that fixes a clear bug. The new test validates the fix works correctly, and all references have been updated systematically. The only minor issue is some outdated comments in unchanged test files.
  • No files require special attention - all changes are consistent and well-tested

Important Files Changed

Filename Overview
nemoguardrails/actions/llm/generation.py Renamed action method from generate_next_step to generate_next_steps to match Task enum value
nemoguardrails/rails/llm/llm_flows.co Updated Colang flow to execute generate_next_steps action instead of generate_next_step
tests/test_task_specific_model.py New comprehensive test validating task-specific LLM configuration for generate_next_steps action

Sequence Diagram

sequenceDiagram
    participant User
    participant Config
    participant LLMRails
    participant Runtime
    participant Action as generate_next_steps

    Note over User,Config: Before Fix (Bug)
    User->>Config: Configure type: generate_next_steps
    Config->>LLMRails: Register generate_next_steps_llm
    LLMRails->>Runtime: Store as "generate_next_steps_llm"
    Note over Runtime,Action: Action named "generate_next_step"
    Runtime->>Runtime: Look for "generate_next_step_llm"
    Runtime->>Action: Not found! Use main LLM instead ❌
    
    Note over User,Config: After Fix (Working)
    User->>Config: Configure type: generate_next_steps
    Config->>LLMRails: Register generate_next_steps_llm
    LLMRails->>Runtime: Store as "generate_next_steps_llm"
    Note over Runtime,Action: Action renamed to "generate_next_steps"
    Runtime->>Runtime: Look for "generate_next_steps_llm"
    Runtime->>Action: Found! Use task-specific LLM ✓
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, 11 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Additional Comments (11)

tests/test_llama_guard.py
comment still references the old action name generate_next_step

            "Mock generated next step",  # mock response for the generate_next_steps action
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 64:64

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            "Mock generated next step",  # mock response for the generate_next_steps action
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_llama_guard.py
comment still references the old action name generate_next_step

            # generate_user_intent, generate_next_steps, or generate_bot_message
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 90:90

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            # generate_user_intent, generate_next_steps, or generate_bot_message
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_llama_guard.py
comment still references the old action name generate_next_step

            # generate_user_intent, generate_next_steps, or generate_bot_message
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 115:115

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            # generate_user_intent, generate_next_steps, or generate_bot_message
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_llama_guard.py
comment still references the old action name generate_next_step

            "Mock generated next step",  # mock response for the generate_next_steps action
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 140:140

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            "Mock generated next step",  # mock response for the generate_next_steps action
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_llama_guard.py
comment still references the old action name generate_next_step

            "Mock generated next step",  # mock response for the generate_next_steps action
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 166:166

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            "Mock generated next step",  # mock response for the generate_next_steps action
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_patronus_lynx.py
comment still references the old action name generate_next_step

            "Mock generated next step",  # mock response for the generate_next_steps action
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 94:94

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            "Mock generated next step",  # mock response for the generate_next_steps action
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_patronus_lynx.py
comment still references the old action name generate_next_step

            "Mock generated next step",  # mock response for the generate_next_steps action
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 123:123

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            "Mock generated next step",  # mock response for the generate_next_steps action
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_patronus_lynx.py
comment still references the old action name generate_next_step

            "Mock generated next step",  # mock response for the generate_next_steps action
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 152:152

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            "Mock generated next step",  # mock response for the generate_next_steps action
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_patronus_lynx.py
comment still references the old action name generate_next_step

            "Mock generated next step",  # mock response for the generate_next_steps action
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 181:181

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            "Mock generated next step",  # mock response for the generate_next_steps action
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_patronus_lynx.py
comment still references the old action name generate_next_step

            "Mock generated next step",  # mock response for the generate_next_steps action
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 208:208

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            "Mock generated next step",  # mock response for the generate_next_steps action
```

How can I resolve this? If you propose a fix, please make it concise.

tests/test_patronus_lynx.py
comment still references the old action name generate_next_step

            "Mock generated next step",  # mock response for the generate_next_steps action
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 237:237

Comment:
comment still references the old action name `generate_next_step`

```suggestion
            "Mock generated next step",  # mock response for the generate_next_steps action
```

How can I resolve this? If you propose a fix, please make it concise.

@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Member

@trebedea trebedea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants