[Feat] Route tasks using linked communication context - #1368
Draft
roomote-roomote[bot] wants to merge 1 commit into
Draft
[Feat] Route tasks using linked communication context#1368roomote-roomote[bot] wants to merge 1 commit into
roomote-roomote[bot] wants to merge 1 commit into
Conversation
Contributor
Comment on lines
+77
to
+79
| const candidates = [ | ||
| ...(taskDescription.match(/https?:\/\/[^\s<>'"\])}]+/gi) ?? []), | ||
| ...(externalReference |
Contributor
There was a problem hiding this comment.
externalReference is meant to identify the exact link the precheck selected, but it is appended only after every task URL and the two-reference cap is applied during that pass. With three valid communication links where the model selects the third, this fetches the first two and never fetches the selected link, so the second routing decision is based on unrelated context. Prioritize the validated externalReference (or filter to it) before applying the cap.
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 changed
Why this change was made
Requests such as "look into this" do not contain enough information to select an environment when their useful context lives in a linked conversation. The router should inspect that context before task creation without broadening access or leaking the fetched conversation into the task prompt.
Impact
Pasted supported communication links can now influence environment selection before a task starts. Router tests cover authenticated tool invocation, successful rerouting across multiple environments, lookup limits, unsupported links, and fail-open behavior. The router unit suite, package type checks, formatting, targeted lint, and repository pre-push checks pass; the live Promptfoo eval could not run because its external provider credential is unavailable in this environment.