Skip to content

Prime engine baselines when a turn starts - #2

Merged
charlesnutter merged 2 commits into
mainfrom
baseline-priming
Sep 25, 2026
Merged

charlesnutter merged 2 commits into
mainfrom
baseline-priming

Conversation

@charlesnutter

Copy link
Copy Markdown
Owner

Prime a counter-difference engine's baseline when a turn starts on it, so the first turn after OpenCode starts can show engine figures instead of engine telemetry from the next turn. Ships as 0.3.1.

What changes

  • Lazy priming. At session.execution.started, the turn's engine is taken from the session's last assistant message or model switch (or a session.model.selected event). If it is vllm, sglang, vllmmlx, aphrodite, lmdeploy, llamacpp, llamafile, splash or omlx and has no baseline yet, that one engine is read once. Nothing is read at startup, and no other engine is read.
  • Fallback heading uses the engine's display name (vllm-mlx, not vllmmlx).

Verified live (vllm-mlx, OpenCode 2.0.12)

  • First turn after two separate restarts: baseline read in 4ms, first step ~7s later; windows matched exactly (909 = 909, 459 = 459 tok).
  • New session on the default model: no model known, so unprimed — from the next turn, as before.

Not covered

  • A brand-new session's first turn: OpenCode exposes no selected model to plugins before the first reply.

@charlesnutter
charlesnutter merged commit 6fe8557 into main Sep 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant