(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestBundlesRenderHumanAndToon(t *testing.T) { |
| 14 | t.Parallel() |
| 15 | |
| 16 | sessionInfo := SessionRecord{ |
| 17 | ID: "sess-1", |
| 18 | Name: "demo", |
| 19 | AgentName: "coder", |
| 20 | WorkspaceID: "ws-1", |
| 21 | WorkspacePath: "/workspace/project", |
| 22 | State: "active", |
| 23 | ACPSessionID: "acp-1", |
| 24 | ACPCaps: &ACPCapsRecord{ |
| 25 | SupportsLoadSession: true, |
| 26 | SupportedModes: []string{"chat"}, |
| 27 | }, |
| 28 | CreatedAt: fixedTestNow.Add(-10 * time.Minute), |
| 29 | UpdatedAt: fixedTestNow, |
| 30 | } |
| 31 | sessionEvents := []SessionEventRecord{{ |
| 32 | ID: "evt-1", |
| 33 | SessionID: "sess-1", |
| 34 | Sequence: 1, |
| 35 | TurnID: "turn-1", |
| 36 | Type: "agent_message", |
| 37 | AgentName: "coder", |
| 38 | Content: mustJSON(t, map[string]string{"text": "hello"}), |
| 39 | Timestamp: fixedTestNow, |
| 40 | }} |
| 41 | history := []TurnHistoryRecord{{TurnID: "turn-1", Events: sessionEvents}} |
| 42 | agentEvents := []AgentEventRecord{{ |
| 43 | Type: "agent_message", |
| 44 | Timestamp: fixedTestNow, |
| 45 | Text: "hello", |
| 46 | }} |
| 47 | listLogs := []LogEventRecord{{ |
| 48 | ID: "sum-1", |
| 49 | SessionID: "sess-1", |
| 50 | Type: "done", |
| 51 | AgentName: "coder", |
| 52 | Summary: "finished", |
| 53 | Timestamp: fixedTestNow, |
| 54 | }} |
| 55 | |
| 56 | bundles := []struct { |
| 57 | name string |
| 58 | bundle outputBundle |
| 59 | }{ |
| 60 | { |
| 61 | name: "agent", |
| 62 | bundle: agentBundle( |
| 63 | AgentRecord{Name: "coder", Provider: "fake", Prompt: "You are coder.", Tools: []string{"shell"}}, |
| 64 | ), |
| 65 | }, |
| 66 | {name: "session", bundle: sessionBundle(sessionInfo, func() time.Time { return fixedTestNow })}, |
| 67 | {name: "sessionEvents", bundle: sessionEventsBundle(sessionEvents)}, |
| 68 | {name: "sessionHistory", bundle: sessionHistoryBundle(history)}, |
| 69 | {name: "agentEvents", bundle: agentEventsBundle(agentEvents)}, |
| 70 | {name: "listLogs", bundle: logsBundle(listLogs)}, |
nothing calls this directly
no test coverage detected