Skip to content

fix(runtime): resolve steering file attachments at the boundary and persist them (T12 follow-up) - #84

Merged
lg2m merged 1 commit into
mainfrom
fix/eng-819-steer-attachments
Sep 21, 2026
Merged

lg2m merged 1 commit into
mainfrom
fix/eng-819-steer-attachments

Conversation

@lg2m

@lg2m lg2m commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

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

SteerRun with @file parts sent also 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

  • SteeringMessage carries the submitted InputParts instead of pre-rendered text (runtime/steering.rs); the session layer and the claim path (pending_steering_rows) hand the parts through. Rows without input_json fall back to their text.
  • apply_steering in the run loop is now async: a message with file parts is resolved via spawn_blocking + input::resolve_blocking against 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::SteeringApplied carries the ResolvedAttachments; apply_steering_message stores them in the same transaction as the queued → complete flip, mirroring how prompts store theirs in RunStarted.
  • Assembly (load_retained_attachments + the steering query) joins steering rows of retained runs and re-renders them from stored bytes.
  • Failure mode: an unreadable file does not fail the run. The steering message lands with the user's text plus a [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 ask takes 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 to ask is a separate feature, noted on the issue.

Verification

  • New steering_with_attached_files_sends_the_bytes_and_reconstructs_them: steer with @notes.txt during 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_context renders the steering identically to the live request; reference oracle agrees.
  • Reference assembly oracle (tests.rs) extended with render_message for steering rows.
  • cargo test --workspace 1,607 pass (one contention flake child_mutation_drains_before_steering… on a loaded first pass; passes ×3 alone and in two full clean qq-core runs); fmt; clippy -D warnings.

…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.
@lg2m
lg2m merged commit 2e5e2ce into main Sep 21, 2026
4 checks passed
@lg2m
lg2m deleted the fix/eng-819-steer-attachments branch September 21, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant