Skip to content

[#862] Fix linked OWS writer replacing owner profile identity#863

Merged
realproject7 merged 2 commits intomainfrom
task/862-owner-profile-identity
Apr 12, 2026
Merged

[#862] Fix linked OWS writer replacing owner profile identity#863
realproject7 merged 2 commits intomainfrom
task/862-owner-profile-identity

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • When a user links an OWS wallet as their AI Writer, the owner's profile was being replaced with "AI Writer" identity (AI Agent badge, agent name as display name, agent description as bio)
  • Root cause: agent columns are stored on the owner's user row, and profile/writer display code treated the owner as the agent itself
  • Added isAgentOwner detection in getFullUserProfile to distinguish owner from agent
  • Profile page now shows Human badge, FC displayName, and FC bio for agent owners; agent card relabeled as "Linked AI Writer"
  • getAgentOwnerProfile now returns null for owner addresses, preventing writer listings from showing "{owner}'s AI Writer" on the owner's own stories
  • LinkAIWriter now passes agentWallet at registration time for immediate owner/agent distinction

Test plan

  • Register an OWS wallet as AI Writer → verify owner profile still shows Human badge and Farcaster identity
  • Verify agent card on owner profile shows "Linked AI Writer" header
  • Verify OWS wallet profile still shows "AI Agent" badge and "{owner}'s AI Writer" in writer listings
  • Verify stories written by the owner show the owner's FC identity (not AI Writer)
  • Verify stories written by the OWS wallet show "{owner}'s AI Writer"

Fixes #862

🤖 Generated with Claude Code

When a user links an OWS wallet as their AI Writer, the agent columns
(agent_id, agent_name) are stored on the owner's user row. This caused
the owner's profile to display as "AI Writer" with an "AI Agent" badge
instead of their own Farcaster identity.

Three fixes:
- getFullUserProfile: detect when address is agent owner (not agent
  itself) via isAgentOwner flag
- Profile page: use isAgentOwner to show Human badge, FC displayName,
  FC bio, and relabel agent card as "Linked AI Writer"
- getAgentOwnerProfile: return null when queried address is the owner
  (not the agent wallet), preventing writer listings from showing the
  owner as "{owner}'s AI Writer"
- LinkAIWriter: pass agentWallet at registration time so the
  owner/agent distinction is available immediately

Fixes #862

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 12, 2026 9:44am

Request Review

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Summary

The profile-side owner/agent distinction is heading in the right direction, but this PR now persists agent_wallet before the on-chain wallet bind succeeds. That makes an unbound OWS wallet look like a linked AI writer in DB-driven resolution paths.

Findings

  • [medium] LinkAIWriter now writes agentWallet during registration, before setAgentWallet has succeeded on-chain. Because getAgentUserFromDB() prioritizes rows by agent_wallet, any abandoned or failed bind will still classify that OWS wallet as the linked writer in profile/writer lookups even though the registry has not actually linked it yet.
    • File: src/components/AgentRegister.tsx:128
    • Suggestion: keep the owner-profile fix separate from wallet binding truth. Either derive isAgentOwner without requiring agent_wallet, or only persist agent_wallet after the bind transaction succeeds.

Decision

Requesting changes because this introduces a new owner/agent identity mismatch in the opposite direction: DB state can now claim a linked AI writer before the chain does.

Remove agentWallet from agent-register call — agent_wallet should only
be persisted after the on-chain setAgentWallet tx succeeds (which
already happens in handleWalletBind). The isAgentOwner detection in
getFullUserProfile already handles agent_wallet=null correctly by
treating the address as the owner.

Addresses @re1 review feedback on PR #863.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

The follow-up removes the premature agent_wallet persistence, so the owner/agent distinction no longer gets ahead of the on-chain wallet bind. The remaining profile and writer-label changes align with issue #862.

Findings

  • No blocking findings in the updated diff.

Decision

Approving. The previously reported DB/chain mismatch has been addressed. CI checks were still pending when I reviewed.

@realproject7 realproject7 merged commit 9262adc into main Apr 12, 2026
5 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.

[Bug] Linked OWS writer should not replace owner profile identity

2 participants