Skip to content

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

Merged
Pouyanpi merged 1 commit into
developfrom
fix/generate-next-steps-action-rename
Feb 10, 2026
Merged

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

Conversation

@Pouyanpi

Copy link
Copy Markdown
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

greptile-apps Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

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

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

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

greptile-apps Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor
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

codecov Bot commented Jan 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@trebedea trebedea left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@tgasser-nv tgasser-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! Can you run a local integration test to make sure this works with prod OpenAI and NVCF-hosted models?

Comment thread nemoguardrails/actions/llm/generation.py
Comment thread tests/test_task_specific_model.py
if not events:
return history

system_actions = [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Doesn't need to be fixed but why do we have 3 different naming conventions? There are names with spaces (call activefence api), snake case (self_check_input), and CamelCase (AddFlowsAction)

@Pouyanpi
Pouyanpi merged commit 04d03ae into develop Feb 10, 2026
7 checks passed
@Pouyanpi
Pouyanpi deleted the fix/generate-next-steps-action-rename branch February 10, 2026 15:06
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.

3 participants