You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ac6b3b2
Browse filesBrowse the repository at this point in the historyBrowse files
fun`an error the CLI reports mid-turn is a warning rather than the end of the node`() {
255
+
val event =CodexEvents.parse("""{"type":"item.completed","item":{"id":"i","type":"error","message":"Model metadata not found."}}""")
256
+
val notice = assertIs<AgentEvent.Notice>(event)
257
+
258
+
assertEquals("error", notice.kind)
259
+
assertEquals("Model metadata not found.", notice.detail)
260
+
}
261
+
262
+
@Test
263
+
fun`an error message that is itself JSON is unwrapped to the sentence inside it`() {
264
+
val line ="""{"type":"turn.failed","error":{"message":"{\"type\":\"error\",\"status\":400,\"error\":{\"message\":\"That model is not supported on this account.\"}}"}}"""
265
+
266
+
assertEquals("That model is not supported on this account.", assertIs<AgentEvent.Result>(CodexEvents.parse(line)).text)
267
+
}
268
+
247
269
@Test
248
270
fun`an item type this version has never seen survives rather than throwing`() {
249
271
val event =CodexEvents.parse("""{"type":"item.completed","item":{"id":"i","item_type":"invented_later"}}""")
@@ -330,13 +352,80 @@ class NodeRunTest {
330
352
331
353
assertEquals(RunStatus.RUNNING, run.status)
332
354
assertFalse(run.canFollowUp)
333
-
assertFalse(run.canTakeOver, "an exec session cannot be resumed, so there is nothing to hand over")
355
+
assertTrue(run.canTakeOver, "the thread id codex reported is enough to reopen it in a terminal")
0 commit comments