Skip to content

Bug: Invalid DecisionType Enum Member (AttributeError on TOOL_CALL) #1609

@Tahir-yamin

Description

@Tahir-yamin

During the "Advanced Validation" phase (Code Coverage Audit), I discovered a bug in the core framework that causes crashes when using the tool_call decision type.

🐛 Bug: Invalid DecisionType Enum Member

Severity: High (Runtime Crash)
Component: core/framework/schemas/decision.py vs core/framework/runtime/stream_runtime.py

Description

The DecisionType enum class defines valid decision types like TOOL_SELECTION, PATH_CHOICE, etc. It does not define TOOL_CALL.
However, codebase consumers (and likely future agent logic) may attempt to use DecisionType.TOOL_CALL, which results in an AttributeError.

I found this while writing test_stream_runtime.py. The fix involves either updating the Enum to include TOOL_CALL = "tool_call" or ensuring all code uses TOOL_SELECTION.

Impact

Any agent or test logic attempting to log a tool call decision using the intuitive name TOOL_CALL will crash the runtime.

Proposed Fix

Standardize on DecisionType.TOOL_SELECTION or alias it.


📉 Coverage Report: Stream Runtime

Component: core/framework/runtime/stream_runtime.py
Initial Coverage: 38%
Current Coverage: 77%

I have added tests/test_stream_runtime.py to significantly improve coverage of the concurrency management logic. This should be merged upstream to prevent regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions