fix(beta/network): resolve namespaced and enumerate unknown delegate targets#3005
Open
genisis0x wants to merge 1 commit into
Open
fix(beta/network): resolve namespaced and enumerate unknown delegate targets#3005genisis0x wants to merge 1 commit into
genisis0x wants to merge 1 commit into
Conversation
LLMs sometimes echo OpenAI's "functions." tool namespace into a delegate target (e.g. "functions.evaluator"), so the literal name misses the registry, the consult fails, and the model re-guesses into a stalled run. Try the literal name first, then the name with the "functions." prefix stripped. When a target still does not resolve, return the live peer names in the not-found error (excluding the caller, which cannot be a delegate target) so the next turn can pick a real one instead of inventing another name. The directory lookup is best-effort and never masks the original error. Adds regression tests for both paths.
genisis0x
force-pushed
the
fix/delegate-functions-prefix
branch
from
June 29, 2026 06:55
26eaed7 to
5ad911f
Compare
Codecov Report❌ Patch coverage is
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Contributor
Author
|
@Lancetnik whenever the network-area queue allows, no rush — this one's green and folds the durable half of #3022: the enumerate-unknown-delegate-targets change, so a not-found delegate now returns an error listing the live registered peers instead of letting the model keep hallucinating a target until it times out. Happy to rebase if it's drifted. |
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.
Why are these changes needed?
A
delegatetarget that doesn't resolve sends the run into a retry loop: the model gets a bareError: target ... not found, re-guesses, and in multi-agent pipelines stalls out (reported in #3022, an extension of #2991 / #2998). The delegate call itself fails fast (~0.6ms in the telemetry on #3022) — the timeout is the model never converging on a real target.This addresses both flavours of that loop:
1. Namespaced-but-valid targets. LLMs occasionally echo OpenAI's
functions.tool namespace into the target string — e.g.functions.evaluatorinstead ofevaluator. The literal name misses the hub registry, so the consult would fail even though the peer is real. Resolution now tries candidate names most-literal first: the name as given, then — only when it carries thefunctions.prefix — the unprefixed name. A valid peer behind a namespaced target resolves and the consult proceeds. The channel is opened with the resolved name.2. Fully invented targets. When no strip recovers the name (e.g.
PPTDialogScript), the model has no signal about which peers are real, so it keeps re-guessing. The not-found error now enumerates the live directory —Error: target 'PPTDialogScript' not found. Available targets: [evaluator, translator]— so the next turn can pick a real one. The lookup is best-effort: a directory failure falls back to the bare not-found error, and the caller is excluded since self-delegation is rejected anyway.Genuinely unknown targets still fail fast (now with the available-targets hint), and self-delegation still short-circuits as added in #2998.
Related issue number
Closes #3022
Checks
AI assistance