Repository navigation
fix: repair headless resume before model dispatch - #378
Merged
Merged
Conversation
Generated with Amplifier Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.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.
Summary
execute_singledispatches to the model.An ordinary user message inserted between an assistant tool call and its genuine result previously reached the provider unchanged through
amplifier run --resume. Interactive chat already had a repair step, but headless execution skipped it.Behavior and scope
The CLI still uses Foundation's existing diagnosis and repair algorithm. Observed tool results retain their original payloads and correlation IDs; only genuinely missing results receive unknown-outcome placeholders. Ambiguous associations remain unresolved.
Repair uses each host path's existing save callback, including its held root writer and metadata-preservation policy. Checkpoint failures now propagate before model dispatch in both paths. This is an intentional tightening of the interactive path, which previously swallowed save errors alongside diagnostic errors. Diagnosis and context-operation failures retain their existing best-effort behavior.
After a successful repair checkpoint, headless execution resets its save-attempt flag so a later failed or cancelled turn still saves new messages. It also rechecks handoff before dispatch.
No Core, Foundation, provider, SDK, dependency, lockfile, configuration-default, or repair-algorithm changes.
Verification
execute_singleregression fails against unchanged main because history is still broken when dispatch starts.uv sync --locked --all-extras --devenvironments: full suite 2,773 passed, 1 skipped, 13 integration deselected, 1 xfailed, each on Python 3.11.14, 3.12.13, and 3.13.11, using locked Core 1.6.1 and installed Foundation/context dependencies.a5f91fc, and Anthropic SDK 1.15.0. All 103 production Python files matched the candidate before and after execution.anthropic/claude-sonnet-5-5: one genuine tool call; one injected saved-history ordering violation repaired by actual headless--resume; another fresh-process resume. All three commands succeeded. Primary history and backups retained the genuine receipt, original user-message order, and original payloads, allowing only context-owned sequence restamping.The live check injects saved ordering damage around a genuine tool result; it does not claim to reproduce a spontaneous interactive interruption race. CLI model labels are not vendor-side usage/cost or HTTP-retry telemetry. The separate preinstalled-provider wheel/cache startup corner case is not changed by this PR.
The disposable DTU was destroyed after evidence export, and its absence was independently confirmed. No normal user installation or settings were changed.