Skip to content

feat: dynamic agents x402 cross-agent + SaucerSwap/Bonzo data + btoa fix#2

Merged
andreagnzz merged 1 commit intomainfrom
feature/dynamic-x402-cross-agent
Feb 21, 2026
Merged

feat: dynamic agents x402 cross-agent + SaucerSwap/Bonzo data + btoa fix#2
andreagnzz merged 1 commit intomainfrom
feature/dynamic-x402-cross-agent

Conversation

@frytegg
Copy link
Collaborator

@frytegg frytegg commented Feb 21, 2026

Summary

  • Dynamic agents now participate in x402 cross-agent collaboration. Previously only the 3 static agents (token IDs 0-2) were visible to the cross-agent system. Now any agent created via the create page with the x402 toggle ON can be discovered, hired, and paid by other agents.
  • Dynamic agents get live SaucerSwap + Bonzo Finance data injected into their context (via urllib, safe on Windows/MINGW).
  • Fixed btoa crash on non-Latin1 characters in system prompts (uses TextEncoder now).
  • Fixed on-chain registry returning false for dynamic agents — dynamic registry is checked first for token IDs > 2.

Changed files

File What changed
agents/dynamic_registry.py x402 fields stored/loaded/queried
agents/x402/config.py Dynamic-aware lookups + check dynamic registry before on-chain for token > 2
agents/x402/cross_agent_service.py Uses dynamic lookups instead of hardcoded dicts
agents/api.py RegisterAgentRequest accepts x402_enabled + allow_cross_agent
agents/agents/dynamic_agent.py Fetches SaucerSwap pools + Bonzo Finance markets via urllib
frontend/src/lib/api.ts RegisterAgentBody gains x402 fields
frontend/src/app/dashboard/create/page.tsx x402 toggle UI + btoa fix
frontend/src/hooks/useMintAgent.ts btoa UTF-8 fix
docs/FUTURLLAMA-pitch.md New: FUTURLLAMA track pitch script

Merge notes

  • No contract changes — safe to merge without redeploy
  • dynamic_registry.py has new params on register_agent() with defaults, so existing calls still work
  • cross_agent_service.py imports changed from static dicts to functions — if Person A modified this file, resolve by keeping the function imports

Test plan

  • Start backend: cd agents && SKIP_WEB3=1 python -m uvicorn api:app --host 0.0.0.0 --port 8000
  • Start frontend: cd frontend && pnpm dev
  • Create agent with x402 toggle ON → check dynamic_agents.json has x402_enabled: true
  • Use a static agent with cross-agent enabled → dynamic agent should appear in x402 report
  • Verify no btoa crash when system prompt has special characters

Dynamic agents created via the create page were invisible to the
cross-agent system. This wires them in end-to-end:

Backend:
- dynamic_registry: store x402_enabled, price_afc, allow_cross_agent,
  max_budget_afc on registration + persist to JSON + load from disk
- x402/config: add dynamic-aware lookups (get_full_agent_name_to_token_id,
  get_full_hedera_accounts, get_full_cross_agent_recommendations)
- x402/config: check dynamic registry BEFORE on-chain call for token IDs > 2
  (contract returns all-false defaults for unknown IDs)
- cross_agent_service: replace hardcoded dicts with dynamic lookups
- api: accept x402_enabled + allow_cross_agent on RegisterAgentRequest
- dynamic_agent: inject live SaucerSwap pools + Bonzo Finance markets
  into every dynamic agent execution context (via urllib, no httpx)

Frontend:
- api.ts: add x402_enabled + allow_cross_agent to RegisterAgentBody
- create page: add x402 cross-agent toggle (purple accent)
- useMintAgent + create page: fix btoa crash on UTF-8 characters by
  encoding through TextEncoder first

Docs:
- Add FUTURLLAMA track pitch script with demo flow + Q&A
@andreagnzz andreagnzz merged commit 47a6df0 into main Feb 21, 2026
3 checks passed
@frytegg frytegg deleted the feature/dynamic-x402-cross-agent branch February 24, 2026 12:53
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