Repository navigation
fix(runtime): resolve steering file attachments at the boundary and persist them (T12 follow-up) - #84
Merged
Merged
Conversation
…ersist them (T12 follow-up) SteerRun with @file parts rendered the placeholder text into the model request and every later request: the run never saw the bytes. Prompts have resolved and persisted their attachments since F05; steering did not. SteeringMessage now carries the submitted InputParts. When the run loop injects the message at a turn boundary it reads the files off the executor through the plan's workspace (the same resolve_blocking as prompts) and the SteeringApplied transaction stores them in attachment_blobs / message_attachments alongside the state change, so assembly re-renders the message from the stored bytes exactly as the model first saw it. A file that cannot be read becomes a runtime notice inside the steering message rather than a run failure: the user's text still lands and names what was missing. Rows written before input_json was recorded fall back to their text. The durable row keeps the placeholder text (titles, snapshots, history search), as prompts do. No schema or protocol change. Test: steer with @notes.txt while turn one waits on approval; the second request carries the bytes, the row keeps the placeholder, replay after the file changes equals the live text; reference assembly oracle extended to render steering attachments. Closes ENG-819.
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.
fix(runtime): resolve steering file attachments at the boundary and persist them (T12 follow-up)
Linear: ENG-819 · tool-layer T12 receipt / F05 note. No schema or protocol change.
Bug
SteerRunwith@fileparts sentalso read this\[email protected]to the model — the placeholder, not the file. Prompts have resolved and persisted attachments since F05 (#69); steering was the pre-existing gap F05's PR body called out.Fix
SteeringMessagecarries the submittedInputParts instead of pre-rendered text (runtime/steering.rs); the session layer and the claim path (pending_steering_rows) hand the parts through. Rows withoutinput_jsonfall back to their text.apply_steeringin the run loop is now async: a message with file parts is resolved viaspawn_blocking+input::resolve_blockingagainst the plan's workspace at the moment it's injected, so the model sees the file as it is at the boundary. Text-only steering is unchanged.RuntimeEvent::SteeringAppliedcarries theResolvedAttachments;apply_steering_messagestores them in the same transaction as thequeued → completeflip, mirroring how prompts store theirs inRunStarted.load_retained_attachments+ the steering query) joins steering rows of retained runs and re-renders them from stored bytes.[QQ runtime notice]naming the error — the user asked mid-run; killing the run for a typo'd path would be worse than telling the model the file wasn't there.Not in scope
Direct
qq asktakes a single prompt string with no@mention parsing today (main.rs::ask→RunCommand::new(prompt)), so there is no placeholder to resolve there; adding mention support toaskis a separate feature, noted on the issue.Verification
steering_with_attached_files_sends_the_bytes_and_reconstructs_them: steer with@notes.txtduring an approval hold; request 2 carries<attached-file path="notes.txt">…STEER_ORIGINAL…; the durable row keeps@notes.txt; after the file is rewritten,load_model_contextrenders the steering identically to the live request; reference oracle agrees.tests.rs) extended withrender_messagefor steering rows.cargo test --workspace1,607 pass (one contention flakechild_mutation_drains_before_steering…on a loaded first pass; passes ×3 alone and in two full cleanqq-coreruns); fmt; clippy-D warnings.