MCPcopy Index your code
hub / github.com/anomalyco/opencode / assistantInfo

Function assistantInfo

packages/opencode/test/session/message-v2.test.ts:77–104  ·  view source on GitHub ↗
(
  id: string,
  parentID: string,
  error?: SessionV1.Assistant["error"],
  meta?: { providerID: string; modelID: string },
)

Source from the content-addressed store, hash-verified

75}
76
77function assistantInfo(
78 id: string,
79 parentID: string,
80 error?: SessionV1.Assistant["error"],
81 meta?: { providerID: string; modelID: string },
82): SessionV1.Assistant {
83 const infoModel = meta ?? { providerID: model.providerID, modelID: model.api.id }
84 return {
85 id,
86 sessionID,
87 role: "assistant",
88 time: { created: 0 },
89 error,
90 parentID,
91 modelID: infoModel.modelID,
92 providerID: infoModel.providerID,
93 mode: "",
94 agent: "agent",
95 path: { cwd: "/", root: "/" },
96 cost: 0,
97 tokens: {
98 input: 0,
99 output: 0,
100 reasoning: 0,
101 cache: { read: 0, write: 0 },
102 },
103 } as unknown as SessionV1.Assistant
104}
105
106function basePart(messageID: string, id: string) {
107 return {

Callers 1

message-v2.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected