Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

OpenCode2TextGeneration.fixture.ts

368 lines11.2 KB

1/**
2 * (A deny-all session is refused on the free tier: the spike's
3 * `text_generation` recording.)
4 */
5import type { ProviderReplayEntry } from "@t3tools/contracts";
6​
7export const OPENCODE2_TITLE_GENERATION: ReadonlyArray<ProviderReplayEntry> = [
8 { type: "expect_outbound", label: "event.subscribe", frame: { type: "event.subscribe" } },
9 {
10 type: "emit_inbound",
11 label: "server.connected",
12 frame: {
13 type: "sdk.event",
14 event: { id: "evt_0f137a1d2001lU10ZRa5EiLHAw", type: "server.connected", data: {} },
15 },
16 },
17 {
18 type: "expect_outbound",
19 label: "session.create",
20 frame: {
21 type: "session.create",
22 input: {
23 title: "T3 Code generateThreadTitle",
24 location: { directory: "<any>" },
25 model: { providerID: "opencode", id: "big-pickle" },
26 permissions: [{ action: "*", resource: "*", effect: "ask" }],
27 },
28 },
29 },
30 {
31 type: "emit_inbound",
32 label: "session.create.response",
33 frame: {
34 type: "sdk.response",
35 operation: "session.create",
36 data: {
37 data: {
38 id: "ses_f0ec85cf6ffebfalpvV2E9nocu",
39 projectID: "global",
40 model: { id: "big-pickle", providerID: "opencode", variant: "default" },
41 cost: 0,
42 tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } },
43 time: { created: 1790753350431, updated: 1790753350431 },
44 title: "T3 Code generateThreadTitle",
45 permissions: [{ action: "*", resource: "*", effect: "ask" }],
46 location: { directory: "<work>" },
47 },
48 },
49 },
50 },
51 {
52 type: "emit_inbound",
53 label: "session.created",
54 frame: {
55 type: "sdk.event",
56 event: {
57 id: "evt_0f137a31f001y6hIo9JFrLXhBa",
58 created: 1790753350431,
59 type: "session.created",
60 location: { directory: "<work>" },
61 data: {
62 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
63 slug: "quiet-lagoon",
64 version: "2.0.18",
65 projectID: "global",
66 location: { directory: "<work>" },
67 subpath: "",
68 title: "T3 Code generateThreadTitle",
69 permissions: [{ action: "*", resource: "*", effect: "ask" }],
70 model: { id: "big-pickle", providerID: "opencode" },
71 },
72 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 0, version: 1 },
73 },
74 },
75 },
76 {
77 type: "emit_inbound",
78 label: "project.updated",
79 frame: {
80 type: "sdk.event",
81 event: {
82 id: "evt_0f137a32a001SNTdr1fGy7x8KA",
83 created: 1790753350442,
84 type: "project.updated",
85 data: {
86 id: "global",
87 canonical: "<work>",
88 vcs: "git",
89 time: { created: 1790744321645, updated: 1790744321645, active: 1790753350441 },
90 sandboxes: [],
91 },
92 },
93 },
94 },
95 {
96 type: "expect_outbound",
97 label: "session.prompt",
98 frame: {
99 type: "session.prompt",
100 input: { sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu", text: "<any>" },
101 },
102 },
103 {
104 type: "emit_inbound",
105 label: "session.prompt.response",
106 frame: {
107 type: "sdk.response",
108 operation: "session.prompt",
109 data: {
110 data: {
111 id: "msg_0f137a333001NQCSi7im6QbeRu",
112 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
113 time: { created: 1790753350454 },
114 type: "user",
115 payload: {
116 text: 'You write concise thread titles for coding conversations. Return only a JSON object with key "title". Title: at most 5 words, no quotes. User message: "fix the login redirect loop after oauth"',
117 },
118 delivery: "steer",
119 },
120 },
121 },
122 },
123 {
124 type: "emit_inbound",
125 label: "session.inbox.enqueued",
126 frame: {
127 type: "sdk.event",
128 event: {
129 id: "evt_0f137a336001aSMpzX88Wc2ggd",
130 created: 1790753350454,
131 type: "session.inbox.enqueued",
132 location: { directory: "<work>" },
133 data: {
134 inboxID: "msg_0f137a333001NQCSi7im6QbeRu",
135 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
136 item: {
137 type: "user",
138 payload: {
139 text: 'You write concise thread titles for coding conversations. Return only a JSON object with key "title". Title: at most 5 words, no quotes. User message: "fix the login redirect loop after oauth"',
140 },
141 delivery: "steer",
142 },
143 },
144 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 1, version: 1 },
145 },
146 },
147 },
148 {
149 type: "emit_inbound",
150 label: "session.execution.started",
151 frame: {
152 type: "sdk.event",
153 event: {
154 id: "evt_0f137a33b001LaQlIPhw6OXE4K",
155 created: 1790753350459,
156 type: "session.execution.started",
157 data: { sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu" },
158 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 2, version: 1 },
159 },
160 },
161 },
162 {
163 type: "emit_inbound",
164 label: "session.instructions.updated",
165 frame: {
166 type: "sdk.event",
167 event: {
168 id: "evt_0f137a355001zRM26oGzBOQK1I",
169 created: 1790753350485,
170 metadata: { instructions: { initial: true } },
171 type: "session.instructions.updated",
172 location: { directory: "<work>" },
173 data: {
174 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
175 delta: {
176 "core/environment": "00e638e6e54c2bb7786ab0bade9b0f8fcb6401b64ef49fc25025dc97dc2d61ac",
177 "core/date": "5a13dc24ad554b3e0bf9583fa4a5c52e130b32720d0a9562fd0e9b0ab14210a9",
178 "core/codemode": "616a7ad8b8e40e8a71eab238dfbbe9eaf0f4a9e6fdad853226d075bfe602e1e6",
179 "core/skill-guidance":
180 "b2aff856e4c0afa54b6d56ecdc438d66a6333b36a3b62677bb1a96da62079118",
181 },
182 },
183 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 3, version: 2 },
184 },
185 },
186 },
187 {
188 type: "emit_inbound",
189 label: "session.inbox.delivered",
190 frame: {
191 type: "sdk.event",
192 event: {
193 id: "evt_0f137a358001Nb4SR6NyY00Zo5",
194 created: 1790753350489,
195 type: "session.inbox.delivered",
196 location: { directory: "<work>" },
197 data: {
198 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
199 inboxID: "msg_0f137a333001NQCSi7im6QbeRu",
200 },
201 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 4, version: 1 },
202 },
203 },
204 },
205 {
206 type: "emit_inbound",
207 label: "session.step.started",
208 frame: {
209 type: "sdk.event",
210 event: {
211 id: "evt_0f137a9a1001mdhCnni47bUQ1S",
212 created: 1790753352097,
213 type: "session.step.started",
214 location: { directory: "<work>" },
215 data: {
216 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
217 agent: "build",
218 model: { id: "big-pickle", providerID: "opencode", variant: "default" },
219 assistantMessageID: "msg_0f137a376001CNO3tIF0OHqFsx",
220 snapshot: "5ecf8511987b833d27b391b832f802775c5ca199",
221 started: 1790753350567,
222 },
223 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 5, version: 1 },
224 },
225 },
226 },
227 {
228 type: "emit_inbound",
229 label: "session.text.started",
230 frame: {
231 type: "sdk.event",
232 event: {
233 id: "evt_0f137a9a5001wyccz82SmtjxpF",
234 created: 1790753352101,
235 type: "session.text.started",
236 location: { directory: "<work>" },
237 data: {
238 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
239 assistantMessageID: "msg_0f137a376001CNO3tIF0OHqFsx",
240 ordinal: 0,
241 },
242 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 6, version: 1 },
243 },
244 },
245 },
246 {
247 type: "emit_inbound",
248 label: "session.text.delta",
249 frame: {
250 type: "sdk.event",
251 event: {
252 id: "evt_0f137a9b5001pgNezPn61VhcVj",
253 created: 1790753352117,
254 type: "session.text.delta",
255 location: { directory: "<work>" },
256 data: {
257 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
258 assistantMessageID: "msg_0f137a376001CNO3tIF0OHqFsx",
259 ordinal: 0,
260 delta: '{"title": "Fix OAuth Login Redirect Loop"}',
261 },
262 },
263 },
264 },
265 {
266 type: "emit_inbound",
267 label: "session.text.ended",
268 frame: {
269 type: "sdk.event",
270 event: {
271 id: "evt_0f137a9b6001W0DZEOeIf3qavZ",
272 created: 1790753352118,
273 type: "session.text.ended",
274 location: { directory: "<work>" },
275 data: {
276 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
277 assistantMessageID: "msg_0f137a376001CNO3tIF0OHqFsx",
278 ordinal: 0,
279 text: '{"title": "Fix OAuth Login Redirect Loop"}',
280 },
281 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 7, version: 1 },
282 },
283 },
284 },
285 {
286 type: "emit_inbound",
287 label: "session.step.streamed",
288 frame: {
289 type: "sdk.event",
290 event: {
291 id: "evt_0f137a9ba0012p1Dt72Qx5gAbw",
292 created: 1790753352122,
293 type: "session.step.streamed",
294 location: { directory: "<work>" },
295 data: {
296 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
297 assistantMessageID: "msg_0f137a376001CNO3tIF0OHqFsx",
298 },
299 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 8, version: 1 },
300 },
301 },
302 },
303 {
304 type: "emit_inbound",
305 label: "session.step.ended",
306 frame: {
307 type: "sdk.event",
308 event: {
309 id: "evt_0f137a9c8001CVVUaPgaXOAnJ3",
310 created: 1790753352136,
311 type: "session.step.ended",
312 location: { directory: "<work>" },
313 data: {
314 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
315 assistantMessageID: "msg_0f137a376001CNO3tIF0OHqFsx",
316 finish: "stop",
317 rawFinish: "stop",
318 cost: 0,
319 tokens: { input: 8927, output: 11, reasoning: 0, cache: { read: 487, write: 0 } },
320 snapshot: "5ecf8511987b833d27b391b832f802775c5ca199",
321 files: [],
322 },
323 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 9, version: 1 },
324 },
325 },
326 },
327 {
328 type: "emit_inbound",
329 label: "session.usage.updated",
330 frame: {
331 type: "sdk.event",
332 event: {
333 id: "evt_0f137a9cd001vwSgA3M8W9SR9P",
334 created: 1790753352141,
335 type: "session.usage.updated",
336 data: {
337 sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu",
338 cost: 0,
339 tokens: { input: 8927, output: 11, reasoning: 0, cache: { read: 487, write: 0 } },
340 },
341 },
342 },
343 },
344 {
345 type: "emit_inbound",
346 label: "session.execution.succeeded",
347 frame: {
348 type: "sdk.event",
349 event: {
350 id: "evt_0f137a9ce001qLIAQz6psEXDM3",
351 created: 1790753352142,
352 type: "session.execution.succeeded",
353 data: { sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu" },
354 durable: { aggregateID: "ses_f0ec85cf6ffebfalpvV2E9nocu", seq: 10, version: 1 },
355 },
356 },
357 },
358 {
359 type: "expect_outbound",
360 label: "session.remove",
361 frame: { type: "session.remove", input: { sessionID: "ses_f0ec85cf6ffebfalpvV2E9nocu" } },
362 },
363 {
364 type: "emit_inbound",
365 label: "session.remove.response",
366 frame: { type: "sdk.response", operation: "session.remove", data: null },
367 },
368];