fix(subagents): trust successful terminal results - #4635
Open
letta-integration[bot] wants to merge 2 commits into
Open
letta-integration[bot] wants to merge 2 commits into
letta-integration[bot] wants to merge 2 commits into
Conversation
intent(subagent-results): recovered workers that deliver a successful terminal result must not fail because of an earlier stream error constraint(subagent-results): terminal failures and streams without a terminal result keep their existing failure semantics 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
decision(subagent-results): classify subtype error as terminal failure because stream-json ResultMessage does not carry is_error 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
This branch has not been deployed
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
A subagent can recover after an intermediate stream error and still emit a successful terminal
result. The parent currently keeps the earlier error, marks the task failed, and hides the completed report even though the child finished successfully.This change makes the terminal result authoritative: a successful result clears an earlier stream error, while a failed terminal result replaces it with the terminal error. Nonzero exits, missing results, failed results, and queued receipts retain their existing behavior.
Verification
The red-first regression starts with the same parser sequence as the incident: a stream
errorfollowed by a successful terminalresultwhoseis_errorfield is omitted. Before the fix, the parser retainedfinalError; after the fix it retains the recovered report and clears the superseded error.The same real parser path verifies the failure boundaries without mocks: a failed terminal result replaces an earlier error, while an error with no terminal result remains a failure. Existing queued-receipt coverage remains unchanged. The full repository check also passed locally.
Breadcrumbs
LET-13078conv-f0a05e43-0c4f-4186-bda9-fa06cd812c5dsubagent-stream.tswithout changing itAI Disclosure
AI-assisted implementation at Sarah Wooders' request; maintainer review is pending. No human-review attestation is made by the agent.
AI Tool(s) Used
Letta Code for incident investigation, repository history research, implementation, regression tests, validation, and pull-request preparation.
Human Verification
Pending maintainer review.