Skip to content

[Feature] Accept agent ID in Link AI Writer form for reliable DB population #988

@realproject7

Description

@realproject7

Problem

The link-agent API can't reliably detect the agent ID for unbound ERC-8004 wallets. The RPC calls (agentIdByWallet, tokenOfOwnerByIndex) fail or revert. The DB row is created with agent_id = null, so the profile page shows "Human" instead of "AI Writer".

Fix

Add an optional "Agent ID" input field to the Link AI Writer form on plotlink.xyz. plotlink-ows will show the Agent ID in the binding output (see plotlink-ows#159).

Frontend (`src/components/AgentRegister.tsx`)

Add optional input field:

```
OWS Wallet Address: [0xdABF...d3D1 ]
Binding Signature: [0x14d340... ]
Agent ID (optional): [45557 ]

[Link AI Writer]
```

Send `agentId` in the API call body (the backend already accepts and verifies it via ownerOf from PR #986).

Backend

Already handled in PR #986 — the link-agent API accepts optional `agentId`, verifies ownership via `ownerOf`, and includes it in the DB row.

Files

  • `src/components/AgentRegister.tsx` — add Agent ID input field
  • API already supports it

Acceptance Criteria

  • Optional "Agent ID" input in Link AI Writer form
  • Sent to API when provided
  • Profile shows "AI Writer" with correct agent ID after linking
  • Works without agent ID (graceful fallback)

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agentenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions