M-L1-T3-wiring: inject httpClient into fetch-ai adapter (RED spec)#124
Merged
Conversation
…iring PR #120 merged real fetch-ai REST adapter but didn't update wiring. fetch-ai falls into else: {} branch in apps/back/server/wiring/01-registry.cjs, gets empty deps, deps.httpClient is undefined. Adapter's try { deps.httpClient.fetch(...) } catch { return; } silently yields zero agents. Crawler reports processed:0, sourceErrors:0, stoppedReason:'completed'. RED test loads the actual CJS wiring module via createRequire, calls wireRegistryDomain with mock raw domain capturing the createFetchAiAdapter deps argument, and asserts: - deps.httpClient defined - typeof deps.httpClient.fetch === 'function' - calling httpClient.fetch returns HttpResponse {status, headers Map, body} - regression guards: mcp still gets httpClient.get(url), paxio-curated still gets curatedAgentsPath + fs Vitest output (RED): 2/4 tests fail for right reason (TypeError on undefined.fetch). Fix is a single ternary branch in wiring/01-registry.cjs; slim spec for backend-dev included in milestone doc.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
Contributor
Author
Phase 0 SPEC APPROVED (architect self-call)Reviewer ran Phase 0 spec-review per Summary:
Non-blocking note: → 🤖 Phase 0 reviewer (sub-agent self-call by architect) |
Wiring fix complementary to PR #120 (real fetch-ai adapter). Adapter expects httpClient.fetch({url,method}) injected; previously fell into else: {} branch, deps.httpClient was undefined, silent return-zero in production. 4/4 wiring tests GREEN: 2 fetch-ai + 2 regression guards (mcp, paxio-curated).
a3ka
pushed a commit
that referenced
this pull request
May 2, 2026
Phase N: scope clean, tests unchanged, 4/4 GREEN, standards walk PASS. No new tech debt. Ready for architect gate-1 merge. (architect-applied via patch from reviewer's worktree e05b44c — reviewer session has no GitHub credentials per scope-guard.md; chore content authored by reviewer agent, applied verbatim.)
a3ka
pushed a commit
that referenced
this pull request
May 3, 2026
Real Agentverse API requires POST /v1/search/agents with JSON body
{search_text, filters, sort, direction, offset, limit}; previous GET
with query params returned 405. Adapter's defensive catch swallowed
the 405 → silent processed:0 in production despite wiring fix (PR #124).
fetchAgents: bare URL + POST with JSON body (offset/limit moved to body).
SAFETY_MAX_PAGES, 429 Retry-After, 5xx single retry — preserved.
Capability inference, toCanonical, DID derivation — unchanged.
Tests: 9/9 GREEN (factory + 8 behaviour, 2 toCanonical skipped per TD-34).
Full baseline: 70 files, 1437 passed.
NOTE: validAgent fixture (registeredAt: ISO string → ms number) and
'paginates offset += limit' pageSize=1 fix needed in test file — see
scope-violation-request in session log.
This was referenced May 3, 2026
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
PR #120 merged real fetch-ai Agentverse REST adapter into
products/01-registry/app/domain/sources/fetch-ai.ts. Adapter expectshttpClient.fetch({url, method, body?, headers?})injected. Wiring (apps/back/server/wiring/01-registry.cjs) was NOT updated alongside — fetch-ai falls intoelse: {}branch:Adapter's defensive try/catch swallows the resulting
TypeErrorand returns from the async generator without yielding → crawler reportsprocessed:0, sourceErrors:0, stoppedReason:'completed'. Silent failure mode.Production manifest 2026-05-02 20:56 UTC:
gh workflow run "Scheduled · Crawl MCP" -f source=fetch-aireturned{processed:0, upserted:0, durationMs:0}. Agent count remained 3266 (paxio-curated baseline).What this PR adds
tests/wiring-rest-adapter-httpclient.test.ts— 4 tests:get(url), paxio-curatedcuratedAgentsPath + fs) — pass on devdocs/sprints/M-L1-T3-wiring-httpclient.md— milestone + slim spec for backend-devГотово когда
tests/wiring-rest-adapter-httpclient.test.tsGREENpnpm typecheckcleanpnpm exec vitest runbaseline GREENprocessed > 0for fetch-ai crawlNext step
Merge → backend-dev session implements wiring fix per slim spec → reviewer Phase N → architect autonomous merge → re-trigger fetch-ai crawl, verify ~2M agents.
🤖 Generated with Claude Code