Skip to content

Prime daemon turns finish before async child continuations #80

Description

@rynfar

Problem

A daemon-backed Prime Agent turn completes too early when the root agent spawns an asynchronous RLM child and intentionally ends its immediate model run without public text. Pylon emits the missing-final-response warning and completes the canonical turn before the child result resumes the parent. The resumed parent answer remains in Prime's transcript but is not rendered in the Pylon conversation.

Reproduction observed on 2026-08-25

  1. Start a Full access Prime daemon session with child depth 1.
  2. Ask the root to spawn one child with await rlm(...).
  3. Have the child send PYLON-ASYNC-CHILD-7F3A to its parent with agent_message.
  4. Instruct the parent to send its final user response only after receiving that child message.

Observed sequence:

root ToolCompleted (rlm child admitted)
root immediate native RunCompleted with empty final text
Pylon runtime.warning: "Prime Agent finished without sending a final response."
Pylon turn.completed state=completed
child task.completed
Prime starts the parent continuation
Prime transcript final: "Received: PYLON-ASYNC-CHILD-7F3A ... asynchronous child completion resumed the parent successfully."

The Pylon client retained the missing-final-response warning, did not render the resumed parent's final answer, and remained stuck in Working after Prime had finished the continuation.

Expected behavior

An admitted descendant or queued parent continuation must keep ownership of the same Pylon turn until Prime reaches authoritative descendant quiescence. The parent continuation should append its final assistant segment to that turn. The missing-final-response warning should appear only after quiescence confirms that no public final response will follow.

Acceptance coverage

  • one depth-1 child that replies asynchronously to its parent
  • several children completing in different orders
  • child completion that causes another parent tool/model cycle
  • child failure and cancellation
  • child admitted just before the immediate root run completes
  • no duplicate turn.started or turn.completed
  • one canonical turn containing the resumed parent assistant segment
  • no missing-final-response warning when the continuation sends text
  • a real daemon-backed Pylon client pass

Reconnect overlap belongs to #79 and should be tested there rather than folded into this fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions