Repository navigation
Keep usage from submitting Claude/CLI turns and delete CLI prompt files - #59
Merged
Merged
Conversation
The Claude Code and configured CLI adapters stopped the writer as soon as a valid completion file appeared, before the native result carrying the turn's usage arrived. Every submitting turn was recorded as usage incomplete, which blocks later dispatches under a finite budget. - After a valid handoff the writer now gets up to 10 s (Codex's cleanup deadline) to finish. Claude stops on its result frame; the CLI's final JSON is parsed after submission. - A validated handoff always resolves 'submitted'; an interrupt or provider error during the grace no longer reads as a failure. - The CLI's per-turn prompt file under .scratch/cli-prompts is removed once the writer has exited instead of accumulating one copy per turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The Claude Code and configured CLI adapters stopped the writer as soon as a valid completion file appeared. The native result that carries the turn's usage had not arrived yet, so every submitting turn was recorded as usage incomplete. Under a finite budget, incomplete usage blocks later dispatches.
resultframe arrives. The CLI's final JSON is now parsed after submission.submitted. An interrupt or provider error during the grace period no longer turns it intofailed, which matches Codex..scratch/cli-promptsis now deleted once the writer exits. Before, one copy per turn accumulated.Tests: new fixture cases cover a result arriving after the completion file (Claude success and error; CLI jsonl and json) and prompt file removal. These tests fail on the old code.
claudeCodeSession,cliSession,sealedHarnessandworkflowHarness: 109 passed, 2 skipped.tsc --noEmitandbun run buildare clean. The two existing wait-for-completion-file tests now take about 10 s longer, so their timeouts are raised to 30 s.🤖 Generated with Claude Code