Skip to content

fix(llmrails): track deferred startup and streaming followups (9/9)#2131

Draft
Pouyanpi wants to merge 2 commits into
restack/llmrails-08-boundary-ownershipfrom
restack/llmrails-09-followups
Draft

fix(llmrails): track deferred startup and streaming followups (9/9)#2131
Pouyanpi wants to merge 2 commits into
restack/llmrails-08-boundary-ownershipfrom
restack/llmrails-09-followups

Conversation

@Pouyanpi

@Pouyanpi Pouyanpi commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Description

Applies the intentional semantic follow-ups separately from the extraction and ownership refactors.

Why

Reviewers can validate code movement first, then evaluate policy and startup behavior changes explicitly.

What Changed

  • Isolates streaming rail-failure handling, task cancellation, and explicit stream_first semantics.
  • Avoids duplicate default and library Colang-flow loading when a prepared config is reused.
  • Adds focused tests for each behavior change.

Review Guidance

This PR follows the behavior-preserving gate and intentionally permits semantic changes. For every affected row in the LLMRails decomposition review matrix, explicitly identify whether the #2122 behavior remains pinned or changes deliberately, with focused test evidence.

This PR is intentionally not a pure refactor. Review the two commits as explicit behavior changes: streaming policy follow-ups and idempotent Colang-flow preparation.

This nine-part stack turns LLMRails into a public compatibility shell while moving owned behavior into focused modules. Review each PR only against its parent. Parts 2-6 intentionally stage behavior-preserving extraction; part 7 consolidates shared type contracts and logger naming; part 8 establishes the final package ownership; part 9 contains the explicit semantic follow-ups.

For parts 2-6, please distinguish stack-local correctness or compatibility problems from naming and placement concerns already resolved in parts 7-8. If an intermediate name or location is correct and mergeable at that point, prefer reviewing its final form in the resolving PR instead of requesting duplicate churn. Public API changes, behavior changes, import cycles, or an independently broken intermediate branch remain in scope wherever they appear. Much of the apparent added LOC is moved code plus focused tests; the corresponding implementation is removed or delegated from llmrails.py in the same PR.

Stack Position

Part 9 of 9.

  • Previous: #2130
  • Next: none, final stack PR
Order PR Branch Base
1 #2123 restack/llmrails-01-public-contract-tests develop
2 #2124 restack/llmrails-02-startup restack/llmrails-01-public-contract-tests
3 #2125 restack/llmrails-03-runtime-conversation restack/llmrails-02-startup
4 #2126 restack/llmrails-04-generation restack/llmrails-03-runtime-conversation
5 #2127 restack/llmrails-05-streaming restack/llmrails-04-generation
6 #2128 restack/llmrails-06-checks-final restack/llmrails-05-streaming
7 #2129 restack/llmrails-07-consistency restack/llmrails-06-checks-final
8 #2130 restack/llmrails-08-boundary-ownership restack/llmrails-07-consistency
9 #2131 restack/llmrails-09-followups restack/llmrails-08-boundary-ownership

Verification

make test
poetry run pre-commit run --all-files

Rebase checkpoints: stack 2: 5202 passed, 178 skipped; stack 4: 5263 passed, 178 skipped; stack 5: 5284 passed, 178 skipped; final stack: 5320 passed, 178 skipped. Final pre-commit: all hooks passed. Base: develop at 3fc828b7f.

AI Assistance

  • No AI tools were used.
  • AI tools were used; a human reviewed and can explain every change (tool: Codex).

Checklist

  • I've read the CONTRIBUTING guidelines.
  • This PR links to a triaged issue assigned to me.
  • My PR title follows the project commit convention.
  • I've updated the documentation if applicable.
  • I've added tests if applicable.
  • I've noted any verification beyond CI and any checks I couldn't run.
  • I did not update generated changelog files manually.
  • I addressed all CodeRabbit, Greptile, and other review comments, or replied with why no change is needed.
  • @mentions of the person or team responsible for reviewing proposed changes.

Pouyanpi added 2 commits July 2, 2026 12:53
Keep streaming behavior changes separate from the LLMRails decomposition stack.
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ails/rails/llm/streaming/streaming_output_rails.py 80.95% 4 Missing ⚠️
...uardrails/rails/llm/streaming/generation_stream.py 91.66% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Pouyanpi Pouyanpi removed the status: needs triage New issues that have not yet been reviewed or categorized. label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant