Repository navigation
feat(opencode): per-phase prep timings on turn.done - #25
Closed
PierrotAWB wants to merge 1 commit into
Closed
PierrotAWB wants to merge 1 commit into
PierrotAWB wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The following comment was made by an LLM, it may be inaccurate: |
This was referenced Aug 24, 2026
Collaborator
Author
|
Consolidated into #29 (one commit per concern there; review history for the prep_ms retry semantics is on this PR's threads). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Issues are disabled on this fork; motivation below. Stacked on #23 (extends the same
turn.doneline); re-target todevafter #23 merges.Type of change
What does this PR do?
prep_ms(#23) says how much time the harness spends before the provider request; this says where it goes. Four additive fields onturn.done, accumulated across the turn's steps with plainDate.now()pairs:history_ms— loading session history from SQLite (filterCompactedEffect, runs every step)tools_ms—SessionTools.resolvecontext_ms— the system-prompt/instructions/model-messageEffect.allsnapshot_ms— the pre-stream gitsnapshot.track()in the processor (exposed via asnapshotMshandle getter, mirroringfirstTokenAt)These four are the optimization targets of the per-step-prep workstream; this instrumentation lands first so each later change has a fleet-wide before/after, and so the p90 tail can be attributed before anyone chases it.
How did you verify your code works?
Extended the #23
turn.donetest: all four fields present and ≥ 0 on a scripted two-step turn.bun run typecheckclean,bun run lint0 errors,prompt.test.ts+compaction.test.ts112/112.Checklist
🤖 Generated with Claude Code
Summary by cubic
Breaks down turn preparation time into four phases and logs them on
turn.done. Previously we only emittedprep_ms; now we also emithistory_ms,tools_ms,context_ms, andsnapshot_msto attribute pre-request latency.historyloading,toolsresolution,contextconstruction, and pre-streamsnapshotcapture; accumulates per step and emits onturn.done.snapshotMstoHandle/ProcessorContextand measures pre-streamsnapshot.track()in the processor; exposes viahandle.snapshotMs.snapshotMs.Migration
snapshotMsto any customHandleimplementations or test fakes.Written for commit 6cb104c. Summary will update on new commits.