Skip to content

[Improve] Route tasks using linked issue context - #693

Merged
daniel-lxs merged 3 commits into
developfrom
fix/router-link-context-3hdhr3y1vegmd
Jul 23, 2026
Merged

[Improve] Route tasks using linked issue context#693
daniel-lxs merged 3 commits into
developfrom
fix/router-link-context-3hdhr3y1vegmd

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Opened on behalf of Daniel Riccio. Follow up by mentioning @roomote-roomote, in the web UI, or in Discord.

What changed

Pasted GitHub and configured Linear issue URLs are now resolved before workspace routing. Their issue details are supplied as bounded, untrusted routing context, with one shared 8-second fail-open lookup deadline. Trailing URL punctuation, including ellipses, is removed before lookup. GitHub routing now exposes the read-only issue tools required for this lookup.

Why this change was made

The router previously classified a task from the message and environment descriptions alone, even when a linked issue contained the information needed to choose the correct workspace.

Impact

Tasks started with a supported issue link can route using the linked issue's title and description. Punctuation from ordinary prose no longer prevents supported issue links from being recognized, while unavailable integrations and slow MCP responses continue routing without external context or extending the shared lookup budget.

@roomote-roomote

roomote-roomote Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

No code issues found. See task

  • packages/cloud-agents/src/server/router/external-issue-context.ts:149: The GitHub fallback shares the 8-second deadline, so it cannot extend routing latency beyond the advertised fail-open budget.
  • packages/cloud-agents/src/server/router/external-issue-context.ts:33: Full trailing punctuation suffixes, including ellipses, are now removed without a regex performance risk.

Reviewed 838a2af

Comment thread packages/cloud-agents/src/server/router/external-issue-context.ts Fixed
@daniel-lxs
daniel-lxs marked this pull request as ready for review July 23, 2026 13:58
@daniel-lxs
daniel-lxs merged commit 7c64f01 into develop Jul 23, 2026
17 checks passed
@daniel-lxs
daniel-lxs deleted the fix/router-link-context-3hdhr3y1vegmd branch July 23, 2026 13:58
daniel-lxs added a commit that referenced this pull request Jul 23, 2026
…t routing to Gemini 3.6 Flash (#716)

* [Improve] Gate the linked-issue fetch on the routing precheck and default routing to Gemini 3.6 Flash

The external issue fetch added in #693 ran before every routing call
with a pasted GitHub/Linear issue link, paying up to the 8s lookup
deadline even when the message alone already routed. Routing now runs a
tool-free precheck first and only fetches when it returns
needsExternalLookup=true, then re-routes with the issue as untrusted
context. Fail-open behavior is unchanged: an unavailable integration or
empty fetch keeps the precheck decision.

Routing inference now resolves context.routingModel, then the new
R_ROUTER_MODEL deployment override, then defaults to
google/gemini-3.6-flash instead of falling through to the deployment
small model. In the router external-lookup gate eval (4 repetitions,
5 candidates), Gemini 3.6 Flash was the only stable gate: it asked for
the issue exactly when the message alone couldn't route (0% false
lookups, 100% recall) at ~4.5s per call.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Keep DEFAULT_ROUTING_MODEL module-private to satisfy Knip

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
daniel-lxs added a commit that referenced this pull request Jul 23, 2026
…xpires

A new fake-timer test for the shared 8s deadline exposed that
withExternalLookupTimeout received an already-invoked promise, so an
exhausted deadline still fired the next MCP call and merely ignored its
result (pre-existing since #693). The helper now takes a thunk and
checks the remaining budget before dispatching.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
daniel-lxs added a commit that referenced this pull request Jul 24, 2026
…xpires

A new fake-timer test for the shared 8s deadline exposed that
withExternalLookupTimeout received an already-invoked promise, so an
exhausted deadline still fired the next MCP call and merely ignored its
result (pre-existing since #693). The helper now takes a thunk and
checks the remaining budget before dispatching.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
daniel-lxs added a commit that referenced this pull request Jul 24, 2026
…ed repositories (#722)

* [Feat] Resolve bare issue references against configured repositories

The routing precheck already extracts references like #234, acme/web#42,
or ENG-512 into externalReference, but nothing acted on it when the
message carried no pasted URL. When the precheck asks for a lookup and
URL parsing finds nothing, the reference now resolves deterministically
against the deployment's own configuration: repo-qualified numbers must
match a configured repository, bare numbers fan out across configured
repositories only when there are at most three (labeled per repo so the
informed re-route can disambiguate), and Linear-style identifiers fetch
directly. Bare references normalize to canonical URLs and reuse the
provider registry, so fetch-attempt construction stays single-source.

The model still never picks fetch targets: it proposes reference text,
code validates against a closed candidate set and executes under the
existing shared 8s fail-open deadline. Pasted URLs take precedence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* [Fix] Stop dispatching MCP fetch attempts after the lookup deadline expires

A new fake-timer test for the shared 8s deadline exposed that
withExternalLookupTimeout received an already-invoked promise, so an
exhausted deadline still fired the next MCP call and merely ignored its
result (pre-existing since #693). The helper now takes a thunk and
checks the remaining budget before dispatching.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Cap the bare-number fan-out at five repositories instead of skipping it

Per review: on deployments with many configured repositories, a bare
issue number now fans out across the first five (environment order)
rather than resolving to nothing. Non-existent issue numbers drop out
at fetch time, so only real matches reach the informed re-route.
Smarter candidate selection (routing memory) is a future follow-up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants