Unified · Split
| @@ -622,6 +622,7 @@ describe("OpenCodeAdapterV2", () => { · 621 unmodified lines | ||
| 622 | 622 | }, |
| 623 | 623 | }), |
| 624 | 624 | ); |
| 625 | + assert.equal(statusCalls, 0, "an unrelated user message must not release prompt admission"); | |
| 625 | 626 | yield* Effect.promise(() => |
| 626 | 627 | nativeEvents.push({ |
| 627 | 628 | type: "session.status", |
| @@ -5,9 +5,137 @@ import { OPENCODE_PROVIDER } from "./OpenCodeAdapterV2.ts"; · 4 unmodified lines | ||
| 5 | 5 | import { |
| 6 | 6 | OPENCODE_SDK_REPLAY_PROTOCOL, |
| 7 | 7 | OpenCodeReplayController, |
| 8 | + OpenCodeReplayMismatchError, | |
| 8 | 9 | } from "./OpenCodeAdapterV2.testkit.ts"; |
| 9 | 10 | |
| 10 | 11 | describe("OpenCodeAdapterV2 replay testkit", () => { |
| 12 | + const metadata = { | |
| 13 | + provider: OPENCODE_PROVIDER, | |
| 14 | + protocol: OPENCODE_SDK_REPLAY_PROTOCOL, | |
| 15 | + version: "test", | |
| 16 | + }; | |
| 17 | + const promptFrame = (messageID: string, text = "recorded-user") => ({ | |
| 18 | + type: "session.promptAsync", | |
| 19 | + input: { sessionID: "native-session", messageID, parts: [{ type: "text", text }] }, | |
| 20 | + }); | |
| 21 | + | |
| 22 | + it.effect("correlates a prompt ID without adopting unrelated messages or rewriting text", () => | |
| 23 | + Effect.gen(function* () { | |
| 24 | + const userEvent = (id: string) => ({ | |
| 25 | + type: "message.updated", | |
| 26 | + properties: { sessionID: "native-session", info: { id, role: "user" } }, | |
| 27 | + }); | |
| 28 | + const controller = new OpenCodeReplayController({ | |
| 29 | + ...metadata, | |
| 30 | + scenario: "prompt-message-identity", | |
| 31 | + entries: [ | |
| 32 | + { type: "expect_outbound", frame: promptFrame("recorded-user") }, | |
| 33 | + { | |
| 34 | + type: "emit_inbound", | |
| 35 | + frame: { type: "sdk.event", event: userEvent("unrelated-user") }, | |
| 36 | + }, | |
| 37 | + { | |
| 38 | + type: "emit_inbound", | |
| 39 | + frame: { type: "sdk.event", event: userEvent("recorded-user") }, | |
| 40 | + }, | |
| 41 | + { | |
| 42 | + type: "emit_inbound", | |
| 43 | + frame: { | |
| 44 | + type: "sdk.event", | |
| 45 | + event: { | |
| 46 | + type: "message.updated", | |
| 47 | + properties: { | |
| 48 | + sessionID: "native-session", | |
| 49 | + info: { id: "assistant-message", role: "assistant", parentID: "recorded-user" }, | |
| 50 | + }, | |
| 51 | + }, | |
| 52 | + }, | |
| 53 | + }, | |
| 54 | + { | |
| 55 | + type: "expect_outbound", | |
| 56 | + frame: { type: "session.revert", input: { messageID: "recorded-user" } }, | |
| 57 | + }, | |
| 58 | + { | |
| 59 | + type: "emit_inbound", | |
| 60 | + frame: { | |
| 61 | + type: "sdk.response", | |
| 62 | + operation: "session.revert", | |
| 63 | + data: { id: "native-session", revert: { messageID: "recorded-user" } }, | |
| 64 | + }, | |
| 65 | + }, | |
| 66 | + { type: "runtime_exit", status: "success" }, | |
| 67 | + ], | |
| 68 | + }); | |
| 69 | + yield* Effect.promise(() => controller.expectOutbound(promptFrame("generated-user"))); | |
| 70 | + const iterator = controller.events()[Symbol.asyncIterator](); | |
| 71 | + const unrelated = yield* Effect.promise(() => iterator.next()); | |
| 72 | + const admitted = yield* Effect.promise(() => iterator.next()); | |
| 73 | + const assistant = yield* Effect.promise(() => iterator.next()); | |
| 74 | + assert.deepEqual(unrelated.value, userEvent("unrelated-user")); | |
| 75 | + assert.deepEqual(admitted.value, userEvent("generated-user")); | |
| 76 | + assert.deepEqual(assistant.value, { | |
| 77 | + type: "message.updated", | |
| 78 | + properties: { | |
| 79 | + sessionID: "native-session", | |
| 80 | + info: { id: "assistant-message", role: "assistant", parentID: "generated-user" }, | |
| 81 | + }, | |
| 82 | + }); | |
| 83 | + yield* Effect.promise(() => | |
| 84 | + controller.expectOutbound({ | |
| 85 | + type: "session.revert", | |
| 86 | + input: { messageID: "generated-user" }, | |
| 87 | + }), | |
| 88 | + ); | |
| 89 | + assert.deepEqual(yield* Effect.promise(() => controller.response("session.revert")), { | |
| 90 | + id: "native-session", | |
| 91 | + revert: { messageID: "generated-user" }, | |
| 92 | + }); | |
| 93 | + assert.isTrue((yield* Effect.promise(() => iterator.next())).done); | |
| 94 | + controller.assertComplete(); | |
| 95 | + }), | |
| 96 | + ); | |
| 97 | + | |
| 98 | + it.effect("still rejects changed prompt text when binding a generated message ID", () => | |
| 99 | + Effect.gen(function* () { | |
| 100 | + const controller = new OpenCodeReplayController({ | |
| 101 | + ...metadata, | |
| 102 | + scenario: "prompt-text-mismatch", | |
| 103 | + entries: [{ type: "expect_outbound", frame: promptFrame("recorded-user") }], | |
| 104 | + }); | |
| 105 | + const error = yield* Effect.tryPromise(() => | |
| 106 | + controller.expectOutbound(promptFrame("generated-user", "different prompt")), | |
| 107 | + ).pipe(Effect.flip); | |
| 108 | + assert.instanceOf(error.cause, OpenCodeReplayMismatchError); | |
| 109 | + }), | |
| 110 | + ); | |
| 111 | + | |
| 112 | + for (const [name, recordedId, actualId] of [ | |
| 113 | + ["rebinding an existing recorded ID", "recorded-user", "another-generated-user"], | |
| 114 | + [ | |
| 115 | + "reusing one generated ID for distinct recorded users", | |
| 116 | + "another-recorded-user", | |
| 117 | + "generated-user", | |
| 118 | + ], | |
| 119 | + ] as const) { | |
| 120 | + it.effect(`rejects ${name}`, () => | |
| 121 | + Effect.gen(function* () { | |
| 122 | + const controller = new OpenCodeReplayController({ | |
| 123 | + ...metadata, | |
| 124 | + scenario: "conflicting-message-identity", | |
| 125 | + entries: [ | |
| 126 | + { type: "expect_outbound", frame: promptFrame("recorded-user") }, | |
| 127 | + { type: "expect_outbound", frame: promptFrame(recordedId) }, | |
| 128 | + ], | |
| 129 | + }); | |
| 130 | + yield* Effect.promise(() => controller.expectOutbound(promptFrame("generated-user"))); | |
| 131 | + const error = yield* Effect.tryPromise(() => | |
| 132 | + controller.expectOutbound(promptFrame(actualId)), | |
| 133 | + ).pipe(Effect.flip); | |
| 134 | + assert.instanceOf(error.cause, OpenCodeReplayMismatchError); | |
| 135 | + }), | |
| 136 | + ); | |
| 137 | + } | |
| 138 | + | |
| 11 | 139 | it.effect("stops an event stream when abort races with listener registration", () => |
| 12 | 140 | Effect.gen(function* () { |
| 13 | 141 | let aborted = false; |
| @@ -120,11 +120,26 @@ function frameRecord(frame: unknown): Record<string, unknown> | null { · 119 unmodified lines | ||
| 120 | 120 | return typeof frame === "object" && frame !== null ? (frame as Record<string, unknown>) : null; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | +function materializeMessageIds(value: unknown, messageIds: ReadonlyMap<string, string>): unknown { | |
| 124 | + if (Array.isArray(value)) return value.map((entry) => materializeMessageIds(entry, messageIds)); | |
| 125 | + const record = frameRecord(value); | |
| 126 | + if (record === null) return value; | |
| 127 | + return Object.fromEntries( | |
| 128 | + Object.entries(record).map(([key, entry]) => [ | |
| 129 | + key, | |
| 130 | + typeof entry === "string" && (key === "id" || key === "messageID" || key === "parentID") | |
| 131 | + ? (messageIds.get(entry) ?? entry) | |
| 132 | + : materializeMessageIds(entry, messageIds), | |
| 133 | + ]), | |
| 134 | + ); | |
| 135 | +} | |
| 136 | + | |
| 123 | 137 | export class OpenCodeReplayController { |
| 124 | 138 | private cursor = 0; |
| 125 | 139 | private readonly waiters = new Set<() => void>(); |
| 126 | 140 | private failure: unknown = null; |
| 127 | 141 | private readonly transcript: OpenCodeSdkReplayTranscript; |
| 142 | + private messageIds = new Map<string, string>(); | |
| 128 | 143 | |
| 129 | 144 | constructor(transcript: OpenCodeSdkReplayTranscript) { |
| 130 | 145 | this.transcript = transcript; |
| @@ -133,14 +148,44 @@ export class OpenCodeReplayController { · 2 unmodified lines | ||
| 133 | 148 | async expectOutbound(actual: unknown): Promise<void> { |
| 134 | 149 | try { |
| 135 | 150 | const entry = this.transcript.entries[this.cursor]; |
| 136 | − if (entry?.type !== "expect_outbound" || !replayValueMatches(entry.frame, actual)) { | |
| 151 | + const expectedFrame = entry?.type === "expect_outbound" ? frameRecord(entry.frame) : null; | |
| 152 | + const actualFrame = frameRecord(actual); | |
| 153 | + const messageIds = new Map(this.messageIds); | |
| 154 | + let conflictingMessageId = false; | |
| 155 | + if ( | |
| 156 | + expectedFrame?.type === "session.promptAsync" && | |
| 157 | + actualFrame?.type === expectedFrame.type | |
| 158 | + ) { | |
| 159 | + const recordedId = frameRecord(expectedFrame.input)?.messageID; | |
| 160 | + const actualId = frameRecord(actualFrame.input)?.messageID; | |
| 161 | + if ( | |
| 162 | + typeof recordedId === "string" && | |
| 163 | + typeof actualId === "string" && | |
| 164 | + recordedId !== "<any>" && | |
| 165 | + recordedId !== "<workspace>" && | |
| 166 | + !messageIds.has(recordedId) | |
| 167 | + ) { | |
| 168 | + conflictingMessageId = [...messageIds.values()].includes(actualId); | |
| 169 | + if (!conflictingMessageId) messageIds.set(recordedId, actualId); | |
| 170 | + } | |
| 171 | + } | |
| 172 | + const expected = | |
| 173 | + entry?.type === "expect_outbound" | |
| 174 | + ? materializeMessageIds(entry.frame, messageIds) | |
| 175 | + : (entry ?? null); | |
| 176 | + if ( | |
| 177 | + conflictingMessageId || | |
| 178 | + entry?.type !== "expect_outbound" || | |
| 179 | + !replayValueMatches(expected, actual) | |
| 180 | + ) { | |
| 137 | 181 | throw new OpenCodeReplayMismatchError({ |
| 138 | 182 | scenario: this.transcript.scenario, |
| 139 | 183 | cursor: this.cursor, |
| 140 | − expected: entry?.type === "expect_outbound" ? entry.frame : (entry ?? null), | |
| 184 | + expected, | |
| 141 | 185 | actual, |
| 142 | 186 | }); |
| 143 | 187 | } |
| 188 | + this.messageIds = messageIds; | |
| 144 | 189 | this.advance(); |
| 145 | 190 | } catch (cause) { |
| 146 | 191 | this.fail(cause); |
| @@ -158,7 +203,7 @@ export class OpenCodeReplayController { · 11 unmodified lines | ||
| 158 | 203 | if (entry.afterMs !== undefined && entry.afterMs > 0) { |
| 159 | 204 | await Effect.runPromise(Effect.sleep(Duration.millis(entry.afterMs))); |
| 160 | 205 | } |
| 161 | − const data = frame.data; | |
| 206 | + const data = materializeMessageIds(frame.data, this.messageIds); | |
| 162 | 207 | this.advance(); |
| 163 | 208 | return data; |
| 164 | 209 | } |
| @@ -188,7 +233,7 @@ export class OpenCodeReplayController { · 23 unmodified lines | ||
| 188 | 233 | if (entry.afterMs !== undefined && entry.afterMs > 0) { |
| 189 | 234 | await Effect.runPromise(Effect.sleep(Duration.millis(entry.afterMs))); |
| 190 | 235 | } |
| 191 | − const event = frame.event as OpenCodeEvent; | |
| 236 | + const event = materializeMessageIds(frame.event, this.messageIds) as OpenCodeEvent; | |
| 192 | 237 | this.advance(); |
| 193 | 238 | yield event; |
| 194 | 239 | continue; |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | {"type": "expect_outbound", "label": "event.subscribe", "frame": {"type": "event.subscribe"}} |
| 3 | 3 | {"type": "expect_outbound", "label": "session.create", "frame": {"type": "session.create", "input": {"title": "<any>", "permission": "<any>"}}} |
| 4 | 4 | {"type": "emit_inbound", "label": "session.created", "frame": {"type": "sdk.response", "operation": "session.create", "data": {"id": "ses_1235df8f8ffekByXP7gVnnXA3P", "slug": "kind-tiger", "version": "1.14.39", "projectID": "global", "directory": "/private/tmp/t3-opencode-probe", "path": "private/tmp/t3-opencode-probe", "title": "T3 OpenCode v2 probe", "time": {"created": 1781818066695, "updated": 1781818066695}}}} |
| 5 | −{"type": "expect_outbound", "label": "session.promptAsync", "frame": {"type": "session.promptAsync", "input": {"sessionID": "ses_1235df8f8ffekByXP7gVnnXA3P", "model": {"providerID": "openai", "modelID": "gpt-5.4-mini"}, "agent": "build", "parts": [{"type": "text", "text": "Use the task tool exactly once. Delegate to the general subagent with this prompt: Respond exactly CHILD_OK. After the task completes, respond exactly PARENT_OK."}]}}} | |
| 5 | +{"type":"expect_outbound","label":"session.promptAsync","frame":{"type":"session.promptAsync","input":{"sessionID":"ses_1235df8f8ffekByXP7gVnnXA3P","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"agent":"build","parts":[{"type":"text","text":"Use the task tool exactly once. Delegate to the general subagent with this prompt: Respond exactly CHILD_OK. After the task completes, respond exactly PARENT_OK."}],"messageID":"msg_edca20735001Esh39V762TEx7f"}}} | |
| 6 | 6 | {"type": "emit_inbound", "label": "session.promptAsync.response", "frame": {"type": "sdk.response", "operation": "session.promptAsync", "data": null}} |
| 7 | 7 | {"type": "emit_inbound", "label": "root.user", "frame": {"type": "sdk.event", "event": {"id": "evt_edca20735003a32yj1UtyUpHkU", "type": "message.updated", "properties": {"sessionID": "ses_1235df8f8ffekByXP7gVnnXA3P", "info": {"id": "msg_edca20735001Esh39V762TEx7f", "role": "user", "sessionID": "ses_1235df8f8ffekByXP7gVnnXA3P", "time": {"created": 1781818066741}, "agent": "build", "model": {"providerID": "openai", "modelID": "gpt-5.4-mini"}}}}}} |
| 8 | 8 | {"type": "emit_inbound", "label": "root.user.text", "frame": {"type": "sdk.event", "event": {"id": "evt_edca207360015UIWeYXmKllHo3", "type": "message.part.updated", "properties": {"sessionID": "ses_1235df8f8ffekByXP7gVnnXA3P", "part": {"type": "text", "text": "Use the task tool exactly once. Delegate to the general subagent with this prompt: Respond exactly CHILD_OK. After the task completes, respond exactly PARENT_OK.", "messageID": "msg_edca20735001Esh39V762TEx7f", "sessionID": "ses_1235df8f8ffekByXP7gVnnXA3P", "id": "prt_edca20735002U603TIFRMOYd9M"}, "time": 1781818066742}}}} |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | {"type":"expect_outbound","label":"event.subscribe","frame":{"type":"event.subscribe"}} |
| 3 | 3 | {"type":"expect_outbound","label":"session.create","frame":{"type":"session.create","input":{"title":"<any>","permission":"<any>"}}} |
| 4 | 4 | {"type":"emit_inbound","label":"session.created","frame":{"type":"sdk.response","operation":"session.create","data":{"id":"ses_1235df8f8ffekByXP7gVnnXA3P","slug":"kind-tiger","version":"1.14.39","projectID":"global","directory":"/private/tmp/t3-opencode-probe","path":"private/tmp/t3-opencode-probe","title":"T3 OpenCode v2 probe","time":{"created":1781818066695,"updated":1781818066695}}}} |
| 5 | −{"type":"expect_outbound","label":"session.promptAsync","frame":{"type":"session.promptAsync","input":{"sessionID":"ses_1235df8f8ffekByXP7gVnnXA3P","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"agent":"build","parts":[{"type":"text","text":"Use the task tool exactly once. Delegate to the general subagent with this prompt: Respond exactly CHILD_OK. After the task completes, respond exactly PARENT_OK."}]}}} | |
| 5 | +{"type":"expect_outbound","label":"session.promptAsync","frame":{"type":"session.promptAsync","input":{"sessionID":"ses_1235df8f8ffekByXP7gVnnXA3P","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"agent":"build","parts":[{"type":"text","text":"Use the task tool exactly once. Delegate to the general subagent with this prompt: Respond exactly CHILD_OK. After the task completes, respond exactly PARENT_OK."}],"messageID":"msg_edca20735001Esh39V762TEx7f"}}} | |
| 6 | 6 | {"type":"emit_inbound","label":"session.promptAsync.response","frame":{"type":"sdk.response","operation":"session.promptAsync","data":null}} |
| 7 | 7 | {"type":"emit_inbound","label":"root.user","frame":{"type":"sdk.event","event":{"id":"evt_edca20735003a32yj1UtyUpHkU","type":"message.updated","properties":{"sessionID":"ses_1235df8f8ffekByXP7gVnnXA3P","info":{"id":"msg_edca20735001Esh39V762TEx7f","role":"user","sessionID":"ses_1235df8f8ffekByXP7gVnnXA3P","time":{"created":1781818066741},"agent":"build","model":{"providerID":"openai","modelID":"gpt-5.4-mini"}}}}}} |
| 8 | 8 | {"type":"emit_inbound","label":"root.user.text","frame":{"type":"sdk.event","event":{"id":"evt_edca207360015UIWeYXmKllHo3","type":"message.part.updated","properties":{"sessionID":"ses_1235df8f8ffekByXP7gVnnXA3P","part":{"type":"text","text":"Use the task tool exactly once. Delegate to the general subagent with this prompt: Respond exactly CHILD_OK. After the task completes, respond exactly PARENT_OK.","messageID":"msg_edca20735001Esh39V762TEx7f","sessionID":"ses_1235df8f8ffekByXP7gVnnXA3P","id":"prt_edca20735002U603TIFRMOYd9M"},"time":1781818066742}}}} |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | {"type":"expect_outbound","label":"event.subscribe","frame":{"type":"event.subscribe"}} |
| 3 | 3 | {"type":"expect_outbound","label":"session.create","frame":{"type":"session.create","input":{"title":"<any>","permission":"<any>"}}} |
| 4 | 4 | {"type":"emit_inbound","label":"session.created","frame":{"type":"sdk.response","operation":"session.create","data":{"id":"ses_12369ea4cffePl0BsyVg3hGlmZ","slug":"mighty-harbor","version":"1.14.39","projectID":"global","directory":"/private/tmp/t3-opencode-probe","path":"private/tmp/t3-opencode-probe","title":"T3 OpenCode v2 probe","time":{"created":1781817284019,"updated":1781817284019}}}} |
| 5 | −{"type":"expect_outbound","label":"session.promptAsync","frame":{"type":"session.promptAsync","input":{"sessionID":"ses_12369ea4cffePl0BsyVg3hGlmZ","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"agent":"build","parts":[{"type":"text","text":"Use request_user_input to ask one multiple-choice clarifying question about whether this fixture should prefer strict schemas or UI flexibility. After receiving the answer, respond exactly: plan questions fixture complete"}]}}} | |
| 5 | +{"type":"expect_outbound","label":"session.promptAsync","frame":{"type":"session.promptAsync","input":{"sessionID":"ses_12369ea4cffePl0BsyVg3hGlmZ","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"agent":"build","parts":[{"type":"text","text":"Use request_user_input to ask one multiple-choice clarifying question about whether this fixture should prefer strict schemas or UI flexibility. After receiving the answer, respond exactly: plan questions fixture complete"}],"messageID":"msg_edc9615bb001iCnWab1qzSeRA3"}}} | |
| 6 | 6 | {"type":"emit_inbound","label":"message.updated.user","frame":{"type":"sdk.event","event":{"id":"evt_edc9615bb003WEUXUNfpZxMZDD","type":"message.updated","properties":{"sessionID":"ses_12369ea4cffePl0BsyVg3hGlmZ","info":{"id":"msg_edc9615bb001iCnWab1qzSeRA3","role":"user","sessionID":"ses_12369ea4cffePl0BsyVg3hGlmZ","time":{"created":1781817284027},"agent":"build","model":{"providerID":"openai","modelID":"gpt-5.4-mini"}}}}}} |
| 7 | 7 | {"type":"emit_inbound","label":"message.part.updated.user","frame":{"type":"sdk.event","event":{"id":"evt_edc9615bc001l8KO7edlPViXO0","type":"message.part.updated","properties":{"sessionID":"ses_12369ea4cffePl0BsyVg3hGlmZ","part":{"type":"text","text":"Use request_user_input to ask one multiple-choice clarifying question about whether this fixture should prefer strict schemas or UI flexibility. After receiving the answer, respond exactly: plan questions fixture complete","messageID":"msg_edc9615bb001iCnWab1qzSeRA3","sessionID":"ses_12369ea4cffePl0BsyVg3hGlmZ","id":"prt_edc9615bb002fjGpO5oeQE22B9"},"time":1781817284028}}}} |
| 8 | 8 | {"type":"emit_inbound","label":"session.promptAsync.response","frame":{"type":"sdk.response","operation":"session.promptAsync","data":null}} |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | {"type":"expect_outbound","label":"event.subscribe","frame":{"type":"event.subscribe"}} |
| 3 | 3 | {"type":"expect_outbound","label":"session.create","frame":{"type":"session.create","input":{"title":"<any>","permission":"<any>"}}} |
| 4 | 4 | {"type":"emit_inbound","label":"session.created","frame":{"type":"sdk.response","operation":"session.create","data":{"id":"ses_1236c522dffeunHBidt20OIzWc","slug":"shiny-tiger","version":"1.14.39","projectID":"global","directory":"/private/tmp/t3-opencode-probe","path":"private/tmp/t3-opencode-probe","title":"T3 OpenCode v2 probe","time":{"created":1781817126354,"updated":1781817126354}}}} |
| 5 | −{"type":"expect_outbound","label":"session.promptAsync","frame":{"type":"session.promptAsync","input":{"sessionID":"ses_1236c522dffeunHBidt20OIzWc","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"agent":"build","parts":[{"type":"text","text":"Respond with the following text: fixture simple ok"}]}}} | |
| 5 | +{"type":"expect_outbound","label":"session.promptAsync","frame":{"type":"session.promptAsync","input":{"sessionID":"ses_1236c522dffeunHBidt20OIzWc","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"agent":"build","parts":[{"type":"text","text":"Respond with the following text: fixture simple ok"}],"messageID":"msg_edc93addd001jzzrE6lotn7BJj"}}} | |
| 6 | 6 | {"type":"emit_inbound","label":"session.promptAsync.response","frame":{"type":"sdk.response","operation":"session.promptAsync","data":null}} |
| 7 | 7 | {"type":"emit_inbound","label":"message.updated.user","frame":{"type":"sdk.event","event":{"id":"evt_edc93ade5002giWB7gMKgKTh1N","type":"message.updated","properties":{"sessionID":"ses_1236c522dffeunHBidt20OIzWc","info":{"role":"user","time":{"created":1781817126365},"agent":"build","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"id":"msg_edc93addd001jzzrE6lotn7BJj","sessionID":"ses_1236c522dffeunHBidt20OIzWc","summary":{"diffs":[]}}}}}} |
| 8 | 8 | {"type":"emit_inbound","label":"session.status.busy","frame":{"type":"sdk.event","event":{"id":"evt_edc93ade80015pjdCBdTty67tQ","type":"session.status","properties":{"sessionID":"ses_1236c522dffeunHBidt20OIzWc","status":{"type":"busy"}}}}} |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | {"type":"expect_outbound","label":"event.subscribe","frame":{"type":"event.subscribe"}} |
| 3 | 3 | {"type":"expect_outbound","label":"session.create","frame":{"type":"session.create","input":{"title":"<any>","permission":"<any>"}}} |
| 4 | 4 | {"type":"emit_inbound","label":"session.created","frame":{"type":"sdk.response","operation":"session.create","data":{"id":"ses_123570840ffenLEumkPQfegGCd","slug":"shiny-wolf","version":"1.14.39","projectID":"global","directory":"/private/tmp/t3-opencode-probe","path":"private/tmp/t3-opencode-probe","title":"T3 OpenCode interrupt probe","permission":[{"permission":"bash","pattern":"*","action":"deny"},{"permission":"edit","pattern":"*","action":"deny"},{"permission":"webfetch","pattern":"*","action":"deny"},{"permission":"websearch","pattern":"*","action":"deny"},{"permission":"codesearch","pattern":"*","action":"deny"},{"permission":"external_directory","pattern":"*","action":"deny"},{"permission":"question","pattern":"*","action":"allow"},{"permission":"read","pattern":"*","action":"allow"},{"permission":"glob","pattern":"*","action":"allow"},{"permission":"grep","pattern":"*","action":"allow"},{"permission":"lsp","pattern":"*","action":"allow"},{"permission":"todowrite","pattern":"*","action":"allow"},{"permission":"task","pattern":"*","action":"allow"},{"permission":"skill","pattern":"*","action":"allow"},{"permission":"doom_loop","pattern":"*","action":"allow"},{"permission":"edit","pattern":"*","action":"allow"}],"time":{"created":1781818521535,"updated":1781818521535}}}} |
| 5 | −{"type":"expect_outbound","label":"session.promptAsync","frame":{"type":"session.promptAsync","input":{"sessionID":"ses_123570840ffenLEumkPQfegGCd","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"agent":"build","parts":[{"type":"text","text":"Do not answer immediately. First run the local shell command `sleep 30`, then respond with exactly: interrupt fixture should not finish naturally."}]}}} | |
| 5 | +{"type":"expect_outbound","label":"session.promptAsync","frame":{"type":"session.promptAsync","input":{"sessionID":"ses_123570840ffenLEumkPQfegGCd","model":{"providerID":"openai","modelID":"gpt-5.4-mini"},"agent":"build","parts":[{"type":"text","text":"Do not answer immediately. First run the local shell command `sleep 30`, then respond with exactly: interrupt fixture should not finish naturally."}],"messageID":"msg_edca8f7c9001w8R30p1SpzPuUJ"}}} | |
| 6 | 6 | {"type":"emit_inbound","label":"session.promptAsync.response","frame":{"type":"sdk.response","operation":"session.promptAsync","data":null}} |
| 7 | 7 | {"type":"expect_outbound","label":"session.abort","frame":{"type":"session.abort","input":{"sessionID":"ses_123570840ffenLEumkPQfegGCd"}}} |
| 8 | 8 | {"type":"emit_inbound","label":"message.updated.user","frame":{"type":"sdk.event","event":{"id":"evt_edca8f7ca002yIVK4oYgGErvdA","type":"message.updated","properties":{"sessionID":"ses_123570840ffenLEumkPQfegGCd","info":{"id":"msg_edca8f7c9001w8R30p1SpzPuUJ","role":"user","sessionID":"ses_123570840ffenLEumkPQfegGCd","time":{"created":1781818521545},"agent":"build","model":{"providerID":"openai","modelID":"gpt-5.4-mini"}}}}}} |