feat(taskspawner): add contextSources to TaskTemplate for cross-syste…#1024
Open
knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
Open
feat(taskspawner): add contextSources to TaskTemplate for cross-syste…#1024knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
Conversation
There was a problem hiding this comment.
1 issue found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/contextfetch/fetcher.go">
<violation number="1" location="internal/contextfetch/fetcher.go:232">
P2: Template rendering is non-strict, so missing variables may silently render as `<no value>` and still trigger outbound HTTP requests.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
d8a9c75 to
2a109c7
Compare
…m context enrichment (#109) * feat(taskspawner): add contextSources to TaskTemplate for cross-system context enrichment Add a contextSources field to TaskTemplate that declaratively fetches data from external HTTP endpoints during the spawner's discovery cycle and makes responses available as {{.Context.<name>}} template variables. This gives agents rich, pre-fetched cross-system context from the first token, improving first-attempt success rates and reducing cost. - New ContextSource and HeaderFromSecret API types with kubebuilder validation markers - New internal/contextfetch package with parallel fetching via errgroup, Secret-based header resolution, JSONPath filtering (reusing existing PaesslerAG/jsonpath dependency), URL template rendering, HTTPS-by-default scheme validation, and configurable response size limits - Integration in both the polling spawner loop and webhook handler - RBAC: grant secrets get to kelos-spawner-role and kelos-webhook-role - Required flag (default false) controls whether fetch failures block task creation or degrade gracefully to empty strings Fixes kelos-dev#881 * fix: cel validation
2a109c7 to
cb6289d
Compare
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.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add a contextSources field to TaskTemplate that declaratively fetches data from external HTTP endpoints during the spawner's discovery cycle and makes responses available as {{.Context.}} template variables. This gives agents rich, pre-fetched cross-system context from the first token, improving first-attempt success rates and reducing cost.
Which issue(s) this PR is related to:
Fixes #881
Special notes for your reviewer:
Example:
Does this PR introduce a user-facing change?
Summary by cubic
Adds
contextSourcestoTaskTemplateto fetch external HTTP data before task creation and expose results as.Context.*in templates. This gives agents pre-fetched cross-system context from the first token.New Features
TaskTemplate.contextSourceswith unique names (max 8) and.Context.NAMEtemplate access.ContextSource,HeaderFromSecretwith validation (timeouts, size limits, HTTPS-by-default).internal/contextfetchwith parallel fetch, URL/body templating, Secret-based headers, JSONPath filtering viaPaesslerAG/jsonpath, and arequiredflag to block or degrade.secrets.get.Migration
secrets.get).allowInsecure: trueonly when needed.Written for commit cb6289d. Summary will update on new commits. Review in cubic