Skip to content

cactus_complete response truncated at first null byte by strlen-based trim #29

@agentordinary

Description

@agentordinary

In cpp/HybridCactus.cpp:77:

// Remove null terminator
responseBuffer.resize(strlen(responseBuffer.c_str()));

strlen stops at the first null byte. If the model output contains a null byte mid-response (possible with certain tokenizers or tool-call JSON payloads), the response is silently cut off at that point and everything after is dropped.

Safer to use the actual written length reported by cactus_complete if available, or at least trim only trailing nulls rather than using strlen on the whole buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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