Skip to content

[Bug]: _turn_exit_reason = "budget_exhausted" is redundant in run_conversation of conversation_loop.py #38162

@GFBinFace

Description

@GFBinFace

Bug Description

When I follow the the business path of budget exhausted, found that:
L818 set:
_turn_exit_reason = "budget_exhausted"
and then break the while loop.

but after the while loop, the "_turn_exit_reason" is covered:
_turn_exit_reason = f"max_iterations_reached({api_call_count}/{agent.max_iterations})"

so L818 is redundant.

Steps to Reproduce

  1. run out of iterations.
  2. "budget_exhausted" will never show in the fail message.

Expected Behavior

Remove the redundant line:
_turn_exit_reason = "budget_exhausted".

Actual Behavior

"budget_exhausted" will never show in the fail message.

Affected Component

Agent Core (conversation loop, context compression, memory)

Messaging Platform (if gateway-related)

No response

Debug Report

.

Operating System

Win10 + WSL2

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt buildertype/refactorCode restructuring, no behavior change

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions