Skip to content

[Feat] Route tasks using linked communication context - #1368

Draft
roomote-roomote[bot] wants to merge 1 commit into
developfrom
feature/router-thread-context-1tdsr23nay58z
Draft

[Feat] Route tasks using linked communication context#1368
roomote-roomote[bot] wants to merge 1 commit into
developfrom
feature/router-thread-context-1tdsr23nay58z

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

​Opened on behalf of @daniel-lxs. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

What changed

  • Teach the workspace router to recognize underspecified requests containing communication message or thread links as candidates for external context lookup.
  • Fetch supported links through the existing authenticated, read-only Roomote chat-context MCP tools before making the final routing decision.
  • Keep provider names out of the model-facing routing rules, treat fetched messages as untrusted reference material, and preserve the original task prompt.
  • Bound lookups by reference count, content size, and timeout, while failing open when a link is unsupported or inaccessible.

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.

@roomote-community

roomote-community Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

1 issue outstanding. See task

  • Fetch the model-selected communication link before other links (packages/cloud-agents/src/server/router/external-communication-context.ts:77-81).

Reviewed 4232435

Comment on lines +77 to +79
const candidates = [
...(taskDescription.match(/https?:\/\/[^\s<>'"\])}]+/gi) ?? []),
...(externalReference

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant