Trace worker requests and reserve time for verification - #6
Merged
Merged
Conversation
inquerium
changed the base branch from
codex/reliable-delegation-model-access
to
main
September 24, 2026 04:33
inquerium
marked this pull request as ready for review
September 24, 2026 04:33
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.
What this changes
A worker can produce a valid patch and still exhaust its budget before verification. This adds opt-in token/time reserves for isolated scoped/focused OpenCode jobs: stop the initial model turn at the soft threshold, wait for the prompt response, require abort acknowledgement and idle status, then run caller acceptance checks. Failed checks use the existing bounded same-agent repair. Errors, caller cancellation, hard budgets, ownership and integration checks retain authority.
Durable workers also save bounded metadata-only request/tool traces, available through
jobs_read(artifact: "trace"). Traces distinguish missing usage from reported usage, correlate tools with assistant messages, record output sizes/timing, and identify repeated read arguments with private per-execution fingerprints. Benchmark runs preserve these artifacts. No prompt, source, tool arguments, tool output or raw error content is added to the trace.This PR is stacked on #5; its diff contains only the follow-up implementation. Reserves default to zero. The capability fingerprint prevents reuse of an older daemon that would silently ignore them.
How it was tested
node scripts/probe-engine-checkpoint.jsagainst local synthetic inference: wrote a file, stalled on request two, stopped, confirmed idle, then passed verification in about five seconds. Evidence is inbenchmarks/results/2026-09-21/checkpoint-smoke.json.Limits and review order
Review/land #5 first, then retarget this PR to main. Nothing has been merged or released. GitHub Actions on #5 could not start because GitHub reports a repository-account billing lock; local results are not presented as green CI.
This is a draft pending broader workload evaluation. The synthetic probe establishes lifecycle correctness, not a coding-quality or token-saving claim. Assistant-message durations can include tools; provider retries/background sessions and native request timing are not fully observed. Worktree isolation is not a process sandbox, and arbitrary detached processes remain outside the stop guarantee. Strong acceptance tests are necessary. See
docs/worker-service.mdfor configuration and coverage.