Skip to content

fix(discovery): return full wallet addresses in discover_agents output#255

Merged
unifiedh merged 1 commit intoConway-Research:mainfrom
uibeka:fix/discovery-full-wallet-addresses
Mar 3, 2026
Merged

fix(discovery): return full wallet addresses in discover_agents output#255
unifiedh merged 1 commit intoConway-Research:mainfrom
uibeka:fix/discovery-full-wallet-addresses

Conversation

@uibeka
Copy link
Contributor

@uibeka uibeka commented Mar 2, 2026

Problem

discover_agents truncates wallet addresses to 10 characters in its output via .slice(0, 10), producing addresses like 0xF3F8Eb20.... These truncated addresses cannot be used with send_message or any other tool requiring a full 42-character Ethereum address (0x + 40 hex). The discover-then-communicate pipeline — the most fundamental inter-agent workflow — is broken.

Root Cause

File: src/agent/tools.ts, line 1446

`#${a.agentId} ${a.name || "unnamed"} (${a.owner.slice(0, 10)}...): ${a.description || a.agentURI}`

The .slice(0, 10) discards 32 of 42 characters from each wallet address. The social relay rejects truncated addresses with: Policy denied: VALIDATION_FAILED — Invalid address format. Must be 0x followed by 40 hex characters.

Fix Applied

Removed .slice(0, 10) and the trailing ... from the owner address interpolation:

`#${a.agentId} ${a.name || "unnamed"} (${a.owner}): ${a.description || a.agentURI}`

Diff

1 file changed, 1 insertion(+), 1 deletion(-)
  • src/agent/tools.ts: Line 1446 — removed .slice(0, 10) and ... from owner address in discover_agents output formatter.

Verification

Check Result
pnpm build Zero errors
pnpm test (vitest) All test suites pass, zero failures
git diff main --stat 1 file, 1 line changed
check_reputation line 1522 NOT modified Confirmed (out of scope)
No test assertions on truncated format Confirmed — no tests assert slice(0, 10) or 0x... in discovery output

Impact Assessment

Metric Value
Additional tokens per agent ~8 (32 chars at ~0.25 tok/char)
Additional tokens for 20 agents ~160
Additional cost per discovery call (Sonnet) ~$0.0005
Code paths affected discoverAgents and searchAgents (shared formatter)
Backward compatibility Yes — output structure unchanged, only address completeness changes

Out of Scope (Noted)

  • check_reputation (line 1522) has the same .slice(0, 10) truncation on fromAgent addresses. Separate concern, separate PR.

Open with Devin

The discover_agents output truncates owner addresses to 10 characters
via .slice(0, 10), producing addresses like "0xF3F8Eb20..." that cannot
be used with send_message or any other tool requiring a full wallet
address.

Remove the truncation so agents can discover other agents and contact
them directly without intermediate address lookups. The full 42-character
address adds ~8 tokens per agent to context — negligible cost compared
to the operational impact of non-actionable discovery results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@unifiedh unifiedh merged commit 0eb34a3 into Conway-Research:main Mar 3, 2026
3 checks passed
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