test(opencode): add run json fixture

This commit is contained in:
banteg
2026-01-04 03:47:07 +04:00
parent a0c16c325e
commit 4532fad760
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -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"}}}}
+1
View File
@@ -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: