Skip to content

fix(core): preserve spawned-agent task payload and profile - #510

Draft
andrei-hasna wants to merge 2 commits into
mainfrom
fix/e7ce510d-spawn-agent-payload
Draft

fix(core): preserve spawned-agent task payload and profile#510
andrei-hasna wants to merge 2 commits into
mainfrom
fix/e7ce510d-spawn-agent-payload

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Why

spawn_agent could omit a large encrypted initial task before the child’s first model sample, and a forked child could inherit a stale turn/profile default instead of the parent session’s live selected auth profile.

What

  • Deliver the spawned child’s initial task through a stable spawn-call message ID.
  • Preserve the initial task as the provider-native model input item, bypassing only the ordinary mailbox size clamp for this one spawn delivery.
  • Retain delivered IDs so retries before or after the first drain cannot duplicate the task.
  • Refresh the child config from the parent session’s live auth-profile selection before applying supported overrides.
  • Keep ordinary mailbox traffic bounded and leave runtime-native send_message behavior unchanged.

Test plan and current evidence

  • Failing-first Blacksmith run 31276010499 on tests-only SHA de9d7494b36dd66ed43b083f82791b2bcf3bd493: failed twice at assertion failed: child_request.body_contains_text("agent_message").
  • Remediation run 31276361125 on 60c766664eae68c6c79af21cf83d15f977c46576: reproduced the same behavioral failure, showing the first fix lost the native item shape.
  • Remediation run 31276892457 on a66da29f0624b1c0f4e8a33cc5026ae23183b4e0: compile failure from one stale unit-test reference; the obsolete test was removed.
  • Final focused run 31277205960 is in progress on exact head a723e537f68a546d7e02134f5150646c68093940, covering:
    • verbatim exact-once initial task for fork_turns=none, a small positive count, and fork_turns=all;
    • live selected healthy-profile inheritance;
    • no stale project-default substitution;
    • explicit all-profiles-exhausted failure behavior.
  • cargo fmt -- --check: exit 0.
  • git diff --check: exit 0.
  • Staged security scans: zero findings on the 11-file implementation, 3-file first remediation, and 1-file final remediation.
  • Pre-push hook: [pre-push] scanning 1 commit(s) for HEAD.

This PR remains draft pending the terminal focused result, exact-head required checks, and one independent adversarial review. It must not merge or publish before those gates.

Todos: e7ce510d-bbf8-4fc1-8252-6af983d529e0

Agent: Theophrastus

@andrei-hasna
andrei-hasna force-pushed the fix/e7ce510d-spawn-agent-payload branch from 60c7666 to a66da29 Compare August 8, 2026 20:25
@andrei-hasna
andrei-hasna force-pushed the fix/e7ce510d-spawn-agent-payload branch from a66da29 to a723e53 Compare August 8, 2026 20:33
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