Skip to content

fix(response-stream): finish root replies when a node uses defaults - #421

Open
WH-2099 wants to merge 3 commits into
mainfrom
fix/llm-default-answer-stream
Open

WH-2099 wants to merge 3 commits into
mainfrom
fix/llm-default-answer-stream

Conversation

@WH-2099

@WH-2099 WH-2099 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Important

The related fail-branch case is tracked in #255.

Related Issue

Closes #413

Summary

When a root node uses its defaults, the reply keeps any text the node sent and moves on.
Fields that sent no text show their saved value, or stay empty if there’s no value.

Checklist

  • This pull request links the issue it resolves or advances
  • This pull request title follows Conventional Commits, and any breaking change is marked with !
  • If CLA Assistant prompted me, I signed CLA.md in the pull request conversation

@WH-2099 WH-2099 self-assigned this Nov 20, 2026
Copilot AI balanced review requested due to automatic review settings November 20, 2026 08:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@WH-2099
WH-2099 force-pushed the fix/llm-default-answer-stream branch from 562f327 to c6309d1 Compare November 20, 2026 08:53
Copilot AI balanced review requested due to automatic review settings November 20, 2026 08:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@WH-2099
WH-2099 force-pushed the fix/llm-default-answer-stream branch from c6309d1 to 92ae3b2 Compare November 24, 2026 09:17
Copilot AI balanced review requested due to automatic review settings November 24, 2026 09:17
@WH-2099 WH-2099 changed the title fix(response-stream): finish answers after an LLM uses a default fix(response-stream)!: finish replies when a node uses a default Nov 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@WH-2099
WH-2099 force-pushed the fix/llm-default-answer-stream branch from 92ae3b2 to dfe7681 Compare November 24, 2026 10:56
Copilot AI balanced review requested due to automatic review settings November 24, 2026 10:56
@WH-2099 WH-2099 changed the title fix(response-stream)!: finish replies when a node uses a default fix(response-stream): finish root replies when a node uses defaults Nov 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@WH-2099
WH-2099 force-pushed the fix/llm-default-answer-stream branch from 9d8e454 to fb40848 Compare November 25, 2026 15:52
Copilot AI balanced review requested due to automatic review settings November 25, 2026 15:52
Copilot stopped reviewing on behalf of WH-2099 due to an error November 25, 2026 15:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

llm_usage=usage,
),
)
yield from self._emit_final_stream_events(state)

@QuantumGhost QuantumGhost Nov 26, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delaying is_final here lets an Answer render the configured default when a Tool emits no text and get_usage() fails. Two other workflows can now lose the rest of the reply. In both, Answer 2 emits the literal |NEXT.

  1. Failure branch — Start → Tool → [fail-branch] → Answer 1 → Answer 2. Answer 1 renders [{{#tool.text#}}]END. The Tool streams partial, then get_usage() raises and the engine takes the failure branch. The client used to receive [partial]END|NEXT. It now receives only [partial.
  2. Successful retry — Start → Tool (one retry) → Answer 1 → Answer 2. Answer 1 renders [{{#tool.excerpt#}}]END. The first attempt streams excerpt="part", then get_usage() raises. The retry succeeds with excerpt="saved" and stream=False, so it sends no final chunk for excerpt. The final graph output is [saved]END|NEXT, but the client receives only [part.

Both Answer nodes finish in each workflow. The root filter is still waiting on the Tool field, so it never emits Answer 1’s ]END or Answer 2’s |NEXT. Could it close the open field when the Tool takes the failure branch or its retry succeeds? Root filter’s terminal-event handling

I reviewed these cases with Codex (gpt-6.2-astra).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One detail on the successful retry in the comment above: the retry commits excerpt="saved" with stream=False, but the root template has already streamed part, so it skips the variable-pool lookup and keeps waiting for excerpt to close. A regression test could assert that the client receives [part]END|NEXT while the final Answer is [saved]END|NEXT. Closing excerpt when the retry succeeds would preserve both outcomes and still let a retry stream more chunks while it is running. Root template lookup and completion

Drafted with Codex (gpt-6.2-astra).

Comment thread ARCHITECTURE.md Resolved
@QuantumGhost
QuantumGhost force-pushed the fix/llm-default-answer-stream branch from fb40848 to 6bdd9d6 Compare November 26, 2026 03:33
Copilot AI balanced review requested due to automatic review settings November 26, 2026 03:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Close referenced streams when a node finishes through a failure branch
or a successful retry leaves an earlier stream open. Preserve streamed
text and read committed outputs for closed fields without buffered text.

Assisted-by: Codex:gpt-6.2-sol
Copilot AI balanced review requested due to automatic review settings November 26, 2026 04:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

This branch has not been deployed

No deployments
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.

Answer streaming stops after an LLM runs out of retries and uses a default value

3 participants