From 4532fad760a1a4664b29caa3bc1c539f838b8ea0 Mon Sep 17 00:00:00 2001 From: banteg <4562643+banteg@users.noreply.github.com> Date: Sun, 4 Jan 2026 03:47:07 +0400 Subject: [PATCH] test(opencode): add run json fixture --- tests/fixtures/opencode-run-json.fixture.jsonl | 5 +++++ tests/test_opencode_schema.py | 1 + 2 files changed, 6 insertions(+) create mode 100644 tests/fixtures/opencode-run-json.fixture.jsonl diff --git a/tests/fixtures/opencode-run-json.fixture.jsonl b/tests/fixtures/opencode-run-json.fixture.jsonl new file mode 100644 index 0000000..7fbc8b2 --- /dev/null +++ b/tests/fixtures/opencode-run-json.fixture.jsonl @@ -0,0 +1,5 @@ +{"type":"step_start","timestamp":1767445000100,"sessionID":"ses_1f2e3d4c5b6aAbCdEfGhIjKlMn","part":{"id":"prt_1f2e3d4c5b6aAaBbCcDdEeFfGg","sessionID":"ses_1f2e3d4c5b6aAbCdEfGhIjKlMn","messageID":"msg_1f2e3d4c5b6aQrStUvWxYz0123","type":"step-start","snapshot":"f3b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9"}} +{"type":"tool_use","timestamp":1767445000450,"sessionID":"ses_1f2e3d4c5b6aAbCdEfGhIjKlMn","part":{"id":"prt_1f2e3d4c5b6aHhIiJjKkLlMmNn","sessionID":"ses_1f2e3d4c5b6aAbCdEfGhIjKlMn","messageID":"msg_1f2e3d4c5b6aQrStUvWxYz0123","type":"tool","callID":"01J3Z2K7S0XQ9Y8W7V6U5T4R3S","tool":"bash","state":{"status":"completed","input":{"command":"rg --version","timeout":120000,"workdir":"/Users/banteg/dev/sst/opencode","description":"Check ripgrep version"},"output":"ripgrep 13.0.0\\n","title":"Check ripgrep version","metadata":{"output":"ripgrep 13.0.0\\n","description":"Check ripgrep version","exitCode":0},"time":{"start":1767445000200,"end":1767445000350}}}} +{"type":"text","timestamp":1767445001100,"sessionID":"ses_1f2e3d4c5b6aAbCdEfGhIjKlMn","part":{"id":"prt_1f2e3d4c5b6aVvWwXxYyZz0011","sessionID":"ses_1f2e3d4c5b6aAbCdEfGhIjKlMn","messageID":"msg_1f2e3d4c5b6aQrStUvWxYz0123","type":"text","text":"Found ripgrep 13.0.0.","time":{"start":1767445000600,"end":1767445001000}}} +{"type":"step_finish","timestamp":1767445001250,"sessionID":"ses_1f2e3d4c5b6aAbCdEfGhIjKlMn","part":{"id":"prt_1f2e3d4c5b6aOoPpQqRrSsTtUu","sessionID":"ses_1f2e3d4c5b6aAbCdEfGhIjKlMn","messageID":"msg_1f2e3d4c5b6aQrStUvWxYz0123","type":"step-finish","reason":"stop","snapshot":"a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0","cost":0.0123,"tokens":{"input":534,"output":128,"reasoning":64,"cache":{"read":0,"write":0}}}} +{"type":"error","timestamp":1767445002000,"sessionID":"ses_1f2e3d4c5b6aAbCdEfGhIjKlMn","error":{"name":"APIError","data":{"message":"Upstream timeout while calling provider","statusCode":504,"isRetryable":true,"responseHeaders":{"x-request-id":"req_9f3b2c1d"},"responseBody":"{\"error\":\"gateway timeout\"}","metadata":{"provider":"openai","model":"gpt-4.1"}}}} diff --git a/tests/test_opencode_schema.py b/tests/test_opencode_schema.py index 7143404..4eaeaff 100644 --- a/tests/test_opencode_schema.py +++ b/tests/test_opencode_schema.py @@ -32,6 +32,7 @@ def _decode_fixture(name: str) -> list[str]: "opencode_stream_success.jsonl", "opencode_stream_success_no_reason.jsonl", "opencode_stream_error.jsonl", + "opencode-run-json.fixture.jsonl", ], ) def test_opencode_schema_parses_fixture(fixture: str) -> None: