feat: cursor-based pagination DSL, bounded result shape enforcement, and provider concurrency #45
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
This PR introduces three related improvements to goa-ai:
1. Cursor-Based Pagination DSL
New DSL functions allow tools to declare cursor-based pagination fields:
Contract:
2. Bounded Result Shape Enforcement
BoundedResult()now enforces canonical bounds fields on tool results:returnedtruncatedtotalrefinement_hintAuthoring rule: Either declare none of these fields (let
BoundedResult()add them) or declare all of them. Hybrid declarations are rejected at DSL eval time.3. Provider Concurrency & Health Responsiveness
The
toolregistry/provider.Servefunction now uses a worker pool architecture:MaxConcurrentToolCallsandMaxQueuedToolCallsoptionsSinkAckGracePeriodfor deployments with long-running toolsAdditional Changes
tool_usemust be immediately followed bytool_result(no injecting system reminders between them)Await + IsReadyto process child completions as they arrive rather than blocking sequentiallyTesting
Documentation
docs/dsl.mdwith pagination DSL and bounds field contractsdocs/overview.mdanddocs/runtime.mdwith bounded result details