-
Notifications
You must be signed in to change notification settings - Fork 24
feat(providers): streaming-native chat-client stack with composable routing #1313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Aaronontheweb
merged 7 commits into
netclaw-dev:dev
from
Aaronontheweb:feat/chat-client-streaming-stack
Jun 4, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0028967
feat(providers): streaming-native chat-client stack with composable r…
Aaronontheweb 3c65ac1
fix(providers): review fixes — SessionId on retry logs, drop AttemptI…
Aaronontheweb 7f66ece
refactor(providers): single retry layer — transport owns LLM transien…
Aaronontheweb 2c18963
Merge remote-tracking branch 'origin/dev' into feat/chat-client-strea…
Aaronontheweb e836e23
refactor(openai): drop StreamingOnlyChatClient shim — Netclaw is stre…
Aaronontheweb 1806907
Merge branch 'dev' into feat/chat-client-streaming-stack
Aaronontheweb 7f6583b
Merge branch 'dev' into feat/chat-client-streaming-stack
Aaronontheweb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all LLM retry logic for connectivity issues lives in the |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,6 +56,23 @@ internal readonly record struct StreamReadResult( | |
| /// </summary> | ||
| internal static class StreamingResponseReader | ||
| { | ||
| private static readonly Action<ChatResponseUpdate, StreamUpdateClassification, StreamDiagnostics> NoOp = | ||
| static (_, _, _) => { }; | ||
|
|
||
| /// <summary> | ||
| /// Convenience overload for callers that only want the aggregated response with | ||
| /// no per-update dispatch — title generation, memory distillation, compaction | ||
| /// observation, memory curation. Streams under the hood (the only transport | ||
| /// Netclaw issues) and aggregates with the same empty-response fallback, so the | ||
| /// caller can read <c>result.Response.Text</c> without an empty-Messages guard. | ||
| /// </summary> | ||
| public static Task<StreamReadResult> ReadAsync( | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM |
||
| IChatClient client, | ||
| IEnumerable<AiChatMessage> messages, | ||
| ChatOptions? options, | ||
| CancellationToken ct) | ||
| => ReadAsync(client, messages, options, NoOp, ct); | ||
|
|
||
| public static async Task<StreamReadResult> ReadAsync( | ||
| IChatClient client, | ||
| IEnumerable<AiChatMessage> messages, | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // ----------------------------------------------------------------------- | ||
| // <copyright file="ChatRoutingContext.cs" company="Petabridge, LLC"> | ||
| // Copyright (C) 2026 - 2026 Petabridge, LLC <https://petabridge.com> | ||
| // </copyright> | ||
| // ----------------------------------------------------------------------- | ||
| namespace Netclaw.Configuration; | ||
|
|
||
| /// <summary> | ||
| /// The inputs a chat-client router uses to select which composed pipeline to invoke | ||
| /// for a call. Minimal today — only <see cref="Role"/> is consulted — but shaped so | ||
| /// per-session / per-provider routing slots in later as a new router policy without | ||
| /// changing this type's shape or any caller. | ||
| /// </summary> | ||
| public sealed record ChatRoutingContext | ||
| { | ||
| /// <summary>The model role being requested (today's only routing signal).</summary> | ||
| public required ModelRole Role { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Owning session id. Unused today; the explicit seam for a future per-session | ||
| /// router policy that routes a session's chats to a specific model/provider. | ||
| /// </summary> | ||
| public string? SessionId { get; init; } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has been moved to the
IChatClientlayer