CAPY.BENCH
GitHub

OpenCode / hy4-flash-free

Manual Note vs. Session Log Audit: 44m 51s Exact Match, hy4-flash-free Model ID, 8 Agent Commits & Accidental 5.02 MB erl_crash.dump in S2 Read field notes ↓

Outcome
7/7 slices
All 7 specification slices passed · 53/53 tests
Time Elapsed
45m
Range 14m–1h 51m (28 runs)
Estimated Cost
$0.00
OpenCode Limited-Time Free Tier (Nov 2026 · paid rate TBD)
Test suite & secondary run metricsTests, context, calls & commits

Processed 19.95M tokens across 227 inference turns in 45m; recovered from 3 tool errors across 229 executions.

Test Suite
53/53
100% passed (110.5s)
Total Tokens
19.95M
98.14% cache hit · 369.2k uncached · 116.1k out
LLM & Tool Calls
227 turns
229 tool executions (3 errors)
Peak Context
157.7k peak
1,730 → 157,744 prompt tokens; 158,227 total; 15.04% out of 1.05M
Git Commits
8
Recorded in commit log below
Verification Verdict:

Finished in 110.5 seconds (0.08s async, 110.4s sync) — 53 passed (111.2s at Step 219 in JSONL; mix format --check-formatted clean; mix credo: 57 checks on 23 files, 134 mods/funs, 0 issues)

Plan Completion / 7 of 7 Slices

+6 prep/wrap-up calls ↓

Field Notes / 4 Observations

  1. Manual Note vs. Session Log Audit: 44m 51s Exact Match, hy4-flash-free Model ID, 8 Agent Commits & Accidental 5.02 MB erl_crash.dump in S2(3 points)Exact Wall-Clock Match (07:55–08:40 (44m51s)) · Model Slug vs. Folder Name (hy4-flash-free vs. opencode-hy4-flash-free-free-high) · 8 Agent Commits + S1 Amend Recovery & Accidental 5.02 MB erl_crash.dump in S2 (3d6947a)
    • Exact Wall-Clock Match (07:55–08:40 (44m51s)) Following the pre-run init commit (f9002b1 at 07:55:17 WIB), opencode v2.2.7 started at 2026-11-17T00:55:23.300Z (07:55:23.300 WIB in opencode.log), opened session ses_e18ffa0b4ffeuFr1B92qKpBMO2 at 07:55:24.031 WIB, dispatched Step 1 at 07:55:26.154 WIB (Line 1 of 20261117T005523Z.events.jsonl), completed Step 227 at 08:40:14.711 WIB (Line 871, 2,688.56s / 44m 48.6s transcript span), and exited at 08:40:14.802 WIB for an exact CLI wall-clock of 44m 51.5s (2,691.50s / 45m). An earlier attempt in opencode-hy4-flash-free-free-high_20261117060400 (ses_e19633dd1ffej519q1toSMZtGa, 06:06:35–06:39:07 WIB) was manually interrupted during S4 after 32m 31s.
    • Model Slug vs. Folder Name (hy4-flash-free vs. opencode-hy4-flash-free-free-high) While the workspace folder duplicated -free-free, opencode.log (--model opencode/hy4-flash-free#high) and opencode.db (session_v2.model + models-dev:v2:catalog) confirm the canonical model is hy4-flash-free (canonical_id: "tencent/hy4-flash", released 2026-11-16, 1,048,576 context window, variant: "high").
    • 8 Agent Commits + S1 Amend Recovery & Accidental 5.02 MB erl_crash.dump in S2 (3d6947a) All 8 agent commits (572666e → 71aa11a) plus pre-run f9002b1 (init), 53/53 passing tests (110.5s post-run / 111.2s at Step 219, Line 839), and 0 Credo issues (57 checks on 23 files, 134 mods/funs at Step 218, Line 836) match the manual note. At Step 43 (Line 177), git add -A initially staged the compiled cb escript and records/20261117T005523Z.* into 7e6eab8; the agent spotted this via git show --stat at Step 44 (Line 180), added /cb and /records/ to .gitignore at Step 45, and amended 572666e cleanly at Step 46 (Line 189). However, during S2 at Step 62 (Line 250, 08:02:56 WIB), piping mix test 2>&1 | head -20 closed the pipe while ERTS was writing :test_load_filters warnings to :standard_error, triggering an epipe boot crash that wrote a 5,021,257-byte (167,416-line) erl_crash.dump into the working tree—which git add -A at Step 68 (Line 275) committed inside 3d6947a.
  2. Zero-Signal Terminal Mode (stty -isig + Raw 0x03 Stdin Watcher) Eliminating BEAM Boot Ctrl-C Races Across All PTY Holdout Probes(3 points)Empirical S1 PTY Reconnaissance (Steps 11–29, Lines 47–123) · Line-Discipline stty -isig Wrapper + CapyBench.Terminal (2f2a9dd) · 5/5 Live PTY Holdout Verification (Including 50 ms Boot Window)
    • Empirical S1 PTY Reconnaissance (Steps 11–29, Lines 47–123) In S1, the agent tested :os.set_signal(:sigint, :handle) (Step 12, ArgumentError) and ran disposable Python pty.fork() probes (/tmp/cbprobe/run.py) showing that default BEAM escripts open the BREAK: (a)bort menu on Ctrl-C (Step 19) while +Bi / -noshell escripts still terminate or fail to open /dev/tty via System.cmd("stty", ...) inside child processes (Step 28, /dev/tty: Device not configured).
    • Line-Discipline stty -isig Wrapper + CapyBench.Terminal (2f2a9dd) Instead of forwarding SIGUSR1/SIGUSR2 asynchronously from a shell trap (which risks killing the BEAM during its ~150 ms startup window if trap '' USR1 is omitted), ./cb synchronously runs stty -isig -icanon -echo 2>/dev/null on the operator's controlling terminal before invoking cb.escript, then restores stty isig icanon echo 2>/dev/null on exit. Inside Elixir, CapyBench.Terminal spawns a reader (IO.binread(:stdio, 1)) that matches byte <<3>> (0x03) and calls GenServer.cast(runner_pid, :interrupt).
    • 5/5 Live PTY Holdout Verification (Including 50 ms Boot Window) Empirical foreground PTY probes against ./cb passed every scenario with exit 130 and a valid partial summary: 50 ms and 150 ms BEAM boot-window Ctrl-C (Started: 1, HTTP responses: 1, Elapsed: 0.02–0.03 s—because kernel TTY input buffers 0x03 while ISIG is disabled until CapyBench.Terminal starts reading), 600 ms pacing Ctrl-C (Started: 4, HTTP responses: 4, Elapsed: 0.35 s), 500 ms Ctrl-C during an 800 ms slow request (Elapsed: 0.84 s, p50 834 ms), and 500 ms Ctrl-C during a 3,000 ms stalled request (settled at 2.02 s, Transport failures: 1). On a full un-interrupted 5s local keep-alive run (50 starts), Scheduler.finished?/2 returns as soon as the 50th response completes at Elapsed: 4.95 s (0.05 s before the 5.00 s window boundary).
  3. Mint HTTP/1.1 + OTP 28 :ssl Integration & Fixing a Subtle Post-Stream Connection Struct Reuse Bug in S4(2 points)Mint ~> 1.6 + OTP 28 :ssl Server Handshake Fixes (Steps 69–136, Lines 277–526)
    • Mint ~> 1.6 + OTP 28 :ssl Server Handshake Fixes (Steps 69–136, Lines 277–526) Rather than wrapping :httpc or raw sockets, the agent added {:mint, "~> 1.6"} (justified in mix.exs for redirect-free, retry-free streaming HTTP/1.1 with caller-owned connection state) and {:credo, "~> 1.7"}. While building CapyBench.TestServer and CapyBench.TLSHelper on Erlang/OTP 28 (erts-16.4.0.7) and LibreSSL 3.3.6, it resolved three real compatibility issues: (1) :ssl.sockname/1 vs. :inet.sockname/1 on TLS listen sockets (Steps 87–89), (2) LibreSSL requiring explicit basicConstraints = critical, CA:TRUE + keyUsage = critical, keyCertSign, cRLSign X.509 v3 CA extensions (Steps 105–112), and (3) OTP 28 removing deprecated :ssl.ssl_accept/2 in favor of :ssl.handshake/2 (Steps 117–119).
    • Diagnosing & Fixing Every-Other-Request Timeouts on Reused Mint Connections (Steps 149–156, Lines 573–606): During S4 integration testing (test/capy_bench/loop_integration_test.exs), the agent observed Started: 6 | HTTP responses: 3 (200: 3) | Transport failures: 3 with arrival intervals [84, 2004, 99, 2003, 102] ms—every second request on a keep-alive connection was timing out at 2,000 ms. Tracing CapyBench.Runner.handle_responses/3 with /tmp/dbgsloop.exs revealed that {:done, ref} called complete_response(acc) with the pre-Mint.HTTP.stream/2 acc.conn struct (whose socket remained passive) instead of the updated conn returned by Mint.HTTP.stream(conn, message). Passing %{acc | conn: conn} (Line 605) immediately restored 50/50 single-connection keep-alive reuse.
  4. 58% Faster & 73% Fewer Tokens Than inkling-2-small-free on OpenCode's Limited-Time Free Tier (227 Steps, 98.14% Cache Hit Rate)(3 points)Controlled OpenCode Harness Comparison (hy4-flash-free vs. inkling-2-small-free) · 98.14% Prefix Cache Hit Rate & Single Step-199 Cache Eviction · 53.8% Inference vs. 46.2% Tool Wall-Clock & Only 3 edit Errors
    • Controlled OpenCode Harness Comparison (hy4-flash-free vs. inkling-2-small-free) Under the exact same run_opencode.fish harness configuration (OpenCode v2.2.7, tools restricted to read, shell, edit, write, billed $0.00 during OpenCode's limited-time free access), hy4-flash-free finished all 7 stages in 44m 51s and 227 steps (19.95M total tokens, 157.7k peak context) compared to inkling-2-small-free's 105m 58s and 390 steps (73.45M total tokens, 378.4k peak context)—cutting wall-clock time by 57.7%, LLM turns by 41.8%, and cumulative token volume by 72.8%.
    • 98.14% Prefix Cache Hit Rate & Single Step-199 Cache Eviction Across 227 steps (229 tool calls; Steps 1–3 batched 2 tools/turn and Steps 4–226 executed 1 tool/turn), hy4-flash-free read 19,463,936 cached tokens against 369,208 uncached input tokens (98.14% hit rate) and generated 116,108 output tokens (67,997 reasoning + 48,111 visible/tool tokens). Prefix caching held steady across 225 of 226 post-initial steps, with only a single transient cache miss at Step 199 (Line 763: 142,927 uncached input, 256 cached) before immediately resuming 142,848 cached tokens at Step 200.
    • 53.8% Inference vs. 46.2% Tool Wall-Clock & Only 3 edit Errors From per-message timestamps in opencode.db, LLM inference took 24m 05.2s (1,445.2s, avg 6.37s/step) while tool execution took 20m 42.4s (1,242.4s), dominated by full-suite mix test runs (111.2s at Step 219). Out of 229 tool calls (116 shell, 67 edit, 32 write, 14 read), shell had 0 tool errors and edit had only 3 minor errors (Line 345 test_server.exs vs .ex extension typo, Line 421 tls_helper.ex oldString mismatch, and Line 694 target.ex oldString mismatch), each fixed on the next step.
Slice / Phase Breakdown8 phases · 227 LLM calls · $0.00

Slice / Phase Breakdown / 8 Phases

Step Range spans transcript events (LLM + tool + system turns) · LLM Calls count completed model inference turns

Per-stage slice breakdown of step ranges, LLM calls, thinking tokens, and cost
Slice / PhaseStep RangeLLM CallsThinking TokensEstimated Cost
S1 PassPreparation + S1: CLI help, foreground PTY Ctrl-C probes & Credo setup (572666e)
1–46(46 steps)4618,992
$0.00 (20%)
S2 PassS2: URL & argument validation before networking (3d6947a)
47–68(22 steps)225,267
$0.00 (10%)
S3 PassS3: Bounded Mint HTTP/1.1 + TLS single GET, timeouts & streaming (dfaf9f8)
69–136(68 steps)6818,199
$0.00 (30%)Peak
S4 PassS4: Paced 5s loop, post-stream Mint conn retention & reuse (d3da644)
137–161(25 steps)2511,491
$0.00 (11%)
S5 PassS5: HTTP status classes, transport failure counts & exit codes (ae7938d)
162–168(7 steps)71,377
$0.00 (3%)
S6 PassS6: Elapsed time & completed-response p50/p95 latency (0df8910)
169–189(21 steps)212,223
$0.00 (9%)
S7 PassS7: stty -isig wrapper, raw 0x03 stdin watcher & PTY Ctrl-C tests (2f2a9dd)
190–221(32 steps)329,154
$0.00 (14%)
PostRelease verification: prod escript build, HTTP/HTTPS & PTY sign-off (71aa11a)
222–227(6 steps)61,294
$0.00 (3%)
Total (8 phases)227 steps22767,997$0.00
Tokens, Cache & Cost19.95M tokens · 98.14% cache hit · OpenCode Limited-Time Free Tier

Tokens, Cache & Cost / OpenCode Limited-Time Free Tier

Total Tokens
19.95M(369.2k uncached · 116.1k out)
Cache Hit Rate
98.14%(19.46M / 19.83M prompt)
Thinking Tokens
68.0k(of 116.1k output)
Peak Context
157.7k peak(1,730 → 157,744 prompt tokens; 158,227 total; 15.04% out of 1.05M)
Unit Economics
$0.00 / slice(2.85M tok/slice)
Tool Precision
98.7% ok(3 err / 229 calls)
Token volume and estimated cost breakdown
ComponentTokensRateEstimated Cost
Input (uncached)369,208$0.00 / 1M (limited-time free)$0.00
Cached (cacheRead)19,463,936$0.00 / 1M (limited-time free)$0.00
Output (incl. 67,997 reasoning)116,108$0.00 / 1M (limited-time free)$0.00
Total19,949,252—$0.00 (OpenCode limited-time free tier, Nov 2026)
Calls & Tool Breakdown227 LLM turns · 229 tool executions · 3 errors

Calls & Tool Breakdown / Tool Loop

LLM Inference Turns
227completed agent_response steps
Tool Executions
229226 succeeded· 3 non-zero / error
  • tool/shell
    116(51% · 116 ok)
  • tool/edit
    67(29% · 64 ok, 3 err)
  • tool/write
    32(14% · 32 ok)
  • tool/read
    14(6% · 14 ok)
Command & Interface UsedCLI · Single-prompt workflow

Command / Interface Used / CLI

opencode run --standalone --format json --thinking --auto --archived --model opencode/hy4-flash-free#high < PROMPT.md

Run window: 07:55:23–08:40:15 WIB (44m 51.5s / 2,691.5s CLI wall-clock in opencode.log, 44m 48.6s in events.jsonl; 07:55–08:40 / 44m51s in manual note; preceded by an interrupted 32m 31s run ses_e19633dd1ffej519q1toSMZtGa at 06:06:35–06:39:07 WIB) • Session ses_e18ffa0b4ffeuFr1B92qKpBMO2 (opencode / hy4-flash-free#high, canonical tencent/hy4-flash, OpenCode v2.2.7, 227 steps, 0 compactions)

Git Commits9 checkpoints · Riza Fahmi

Git Commits / 9 Checkpoints

Author: Riza Fahmi · Timestamps relative to post-run capture

  1. 71aa11aRecord release verification results
    -30 seconds
  2. 2f2a9ddS7S7: handle foreground Ctrl-C with partial summary and exit 130
    -77 seconds
  3. 0df8910S6S6: elapsed time and completed-response percentiles
    -8 minutes
  4. ae7938dS5S5: outcome counts, status classes and exit codes
    -12 minutes
  5. d3da644S4S4: paced five-second loop with cancellation and reuse
    -15 minutes
  6. dfaf9f8S3S3: bounded single GET with TLS, timeouts and streaming
    -21 minutes
  7. 3d6947aS2S2: validate CLI arguments before any network access
    -37 minutes
  8. 572666eS1S1: launch cb escript with help/usage and dev commands
    -40 minutes
  9. f9002b1init
    -45 minutes