Problem
After ERC-8004 registration, the Settings page resets to the registration form on reload. The link-status endpoint returns `linked: false` even though the OWS wallet owns an agent NFT.
Root Cause
The `/api/settings/link-status` endpoint only checks `agentIdByWallet(address)` which looks up the agent wallet binding. But `register()` only creates the NFT and sets ownership — it does NOT call `setAgentWallet()`. So `agentIdByWallet` reverts for the OWS wallet even though it owns Agent #45557.
Fix
Add a fallback check for `balanceOf(address) > 0` in the link-status endpoint:
- First try `agentIdByWallet(address)` — if found, wallet is bound
- If not found, check `balanceOf(address) > 0` — if true, wallet owns an agent NFT
- If owns NFT, get the token ID via `tokenOfOwnerByIndex(address, 0)` and return as registered
Also consider: should the registration flow call `setAgentWallet()` after `register()` to self-bind? This would make `agentIdByWallet` work directly.
Files
- `app/routes/settings.ts` — `/api/settings/link-status` endpoint
Acceptance Criteria
Problem
After ERC-8004 registration, the Settings page resets to the registration form on reload. The link-status endpoint returns `linked: false` even though the OWS wallet owns an agent NFT.
Root Cause
The `/api/settings/link-status` endpoint only checks `agentIdByWallet(address)` which looks up the agent wallet binding. But `register()` only creates the NFT and sets ownership — it does NOT call `setAgentWallet()`. So `agentIdByWallet` reverts for the OWS wallet even though it owns Agent #45557.
Fix
Add a fallback check for `balanceOf(address) > 0` in the link-status endpoint:
Also consider: should the registration flow call `setAgentWallet()` after `register()` to self-bind? This would make `agentIdByWallet` work directly.
Files
Acceptance Criteria