MCPcopy Index your code
hub / github.com/coder/coder / makeInProgressPart

Function makeInProgressPart

coderd/x/chatd/chatd_internal_test.go:5875–5885  ·  view source on GitHub ↗

makeInProgressPart is a small constructor for buffered message_part fixtures used by snapshotBufferLocked / subscribeToStream tests. It builds an in-progress part (committedMessageID == 0) with a recognizable text body so failing assertions can identify which part survived the filter.

(text string)

Source from the content-addressed store, hash-verified

5873// recognizable text body so failing assertions can identify which
5874// part survived the filter.
5875func makeInProgressPart(text string) bufferedStreamPart {
5876 return bufferedStreamPart{
5877 event: codersdk.ChatStreamEvent{
5878 Type: codersdk.ChatStreamEventTypeMessagePart,
5879 MessagePart: &codersdk.ChatStreamMessagePart{
5880 Role: codersdk.ChatMessageRoleAssistant,
5881 Part: codersdk.ChatMessageText(text),
5882 },
5883 },
5884 }
5885}
5886
5887// makeCommittedPart builds a part already claimed by the given
5888// durable assistant message ID.

Calls 1

ChatMessageTextFunction · 0.92

Tested by

no test coverage detected