Skip to content
This repository was archived by the owner on Jul 23, 2026. It is now read-only.
This repository was archived by the owner on Jul 23, 2026. It is now read-only.

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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