Repository navigation
feat: return ordered Astra response parts - #727
Merged
Merged
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed ordered Astra response assembly, prompt selection, serialization, and compatibility with the existing mobile and web consumers.
- Ordered parts: Preserves text and directive positions, deduplicates repeated directives, limits responses to three built blocks, and retains existing card eligibility checks.
- Append-only contract: Adds opt-in capabilities and the
text/blockresponse union without changing existing card payloads; clients without parts support retain legacy responses. - Prompts and fallback: Selects reading-order instructions for declared kinds and restores legacy prompts and responses through
astra_parts_disabled. - Response handling: Preserves follow-up and truncation behavior, prevents block responses from entering the shared FAQ cache, and adds ordered-part analytics.
- Verification: Solution build completed with zero errors, all 9,470 unit tests passed, and the sibling repository's current client context does not opt into parts. Live model output and client rendering were not exercised.
gpt-6.1-sol | 𝕏
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the changes since 3add73c5, focusing on prompt-assembly equivalence, shared block-kind identifiers, and expanded ordered-parts coverage.
- Extracted prompt groups: Separated period and status instructions while preserving capability checks, feature flags, declared-kind filtering, and instruction order.
- Consolidated block kinds: Reused private constants across prompt selection, directive mapping, block assembly, and analytics without changing wire values.
- Expanded behavioral tests: Added coverage for undeclared and unknown kinds, status-block payloads and kill flags, insight/account ordering and analytics, and missing record-list payloads.
- Verified compatibility and tests: Confirmed current sibling clients remain on the legacy path; the solution built with zero errors, all 208 focused chat tests passed, and all 9,490 unit tests passed. Live model output and client rendering were not exercised.
gpt-6.1-sol | 𝕏
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.




Closes thomasluizon/orbit-tickets#1475.
Clients advertising
SupportsPartsreceive text and block parts in the model's reading order, with at most three blocks. Repeated directives emit one block at their first position.AiMessagejoins the text parts with a blank line. Parts clients get null legacy card fields; other clients keep the existing serialized response and prompt strings. Cached FAQ answers and early replies omit parts.FollowUpDirective.cspreserves the ordered text and directives without changing stream deltas.ProcessUserChatCommand.csbuilds each directive through the existing card builders, so client capabilities, tool-success checks, and feature flags still apply. It also keeps card events and addspart_countand orderedblock_kinds. The append-only capabilities live inAgentContracts.cs; the response union and regeneratedopenapi.jsonexpose onlytextandblockas outer types. The AI command and card builders select separate parts prompt instructions, limited to declared kinds.FeatureFlagKeys.csaddsastra_parts_disabled, which restores the legacy response and prompt without a deploy.Deploy this API contract before thomasluizon/orbit-tickets#1479. No client rendering or card payload fields change here.
Assumptions
partsproperty when its C# value is null, rather than serializing an extra null field, to satisfy byte-identical legacy responses.Test evidence
dotnet build Orbit.slnx: passed with zero errors.dotnet test: 9,470 passed, zero failed or skipped (Domain 661, Application 5,478, Infrastructure 3,299, Analyzers 32).dotnet test tests/Orbit.Application.Tests --no-restore --filter 'FullyQualifiedName~ProcessUserChatCommandHandlerTests|FullyQualifiedName~ChatStreamEventTests|FullyQualifiedName~FollowUpDirectiveTests' --nologo: 196 passed. Covers ordering, unsupported kinds, missing or failed tools, capability and feature flag gates, duplicate and fourth directives, two record-list parts, truncation, follow-up tails, early replies, stream serialization, and complete prompts for both client shapes.git diff --exit-code -- src/Orbit.Api/openapi.json: passed after the full build and suite; the generated schema matches the committed file.node tools/check-timeless.mjs --base 0a32fab3, whitespace checks, dash checks, and all commit hooks passed.This is a new feature, so the work order exempts red regression reproduction. Before changing response assembly,
dotnet test tests/Orbit.Application.Tests --no-restore --filter FullyQualifiedName~Handle_LegacyMixedDirectives_MatchesSerializedGolden --nologopassed against the original handler (one case). The same golden passed after the implementation for absent, false, and server-disabled parts support (three cases), also included in the full suite.dotnet build Orbit.slnx: exit 0, zero errors.dotnet test --no-build: exit 0, all 9,490 passed.Eval scenarios for #26
Manual steps
parts.