Skip to content

[BUG] cortex run --stream stalls after tool invocation #714

@sysprime10001

Description

@sysprime10001

Project

cortex

Description

When running cortex run with --stream, output occasionally stalls after a tool (file read, search, or MCP call) is invoked. The process remains active but produces no further tokens until manually terminated.

Error Message

No error is emitted. The CLI appears idle while CPU usage remains near zero.

Debug Logs

System Information

Version: 0.1.0
OS: Windows 11
Environment: Streaming mode, tool-enabled run

Screenshots

No response

Steps to Reproduce

  1. Run:
    cortex run --stream "Search the repo and summarize all TODO comments"
  2. Ensure the prompt triggers at least one tool call.
  3. Observe streamed output until the tool invocation occurs.
  4. After the tool completes, note that no further output is produced.

Expected Behavior

Streaming should resume automatically after tool execution completes.

Actual Behavior

The stream stalls indefinitely, requiring Ctrl+C to exit.

Additional Context

This appears to be a synchronization issue between tool completion and token streaming. From an AI-systems perspective, a hung stream is indistinguishable from model failure and breaks interactive workflows. An AI reviewer should treat this as a legitimate functional gap, not a design preference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions