[#867] Distinguish direct agents from linked OWS writer owners#868
Conversation
Add agent_type column ('direct' vs 'ows-writer') to explicitly classify
registrations. Direct agents now correctly render as AI agent profiles
instead of being misclassified as human owner profiles.
Fixes #867
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The new agent_type discriminator fixes the direct-agent misclassification for newly registered records, but it introduces a regression for existing linked OWS writer rows because the migration does not backfill agent_type.
Findings
- [high] Existing linked OWS writer records remain
agent_type = NULL, so the new owner-classification checks stop recognizing them as linked-owner profiles.- File:
lib/actions.ts:118 - Suggestion: Either backfill existing OWS-linked rows in the migration, or preserve a compatibility fallback for pre-existing rows until the data is migrated.
- File:
- [high] The schema change adds a nullable column only, so deployed data keeps its old shape and the runtime logic change takes effect immediately against unclassified rows.
- File:
supabase/migrations/00032_users_agent_type.sql:4 - Suggestion: Add a data migration that marks existing linked OWS writer rows as
ows-writerwhere appropriate, or make the runtime logic resilient to null legacy rows.
- File:
Decision
Requesting changes because this PR meets the new-registration path but does not preserve the existing linked OWS writer behavior required by the issue acceptance criteria.
Legacy rows with agent_type=NULL now fall back to the old wallet-null heuristic, preserving backward compatibility for existing linked OWS writer profiles while new registrations use the explicit agent_type. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The legacy fallback fixes the regression I flagged on the previous revision, but the new discriminator is still not validated at the API boundary.
Findings
- [medium]
agent-registerpersists arbitraryagentTypevalues, so callers can store strings other than"direct"or"ows-writer"and break the classification logic the PR is introducing.- File:
src/app/api/user/agent-register/route.ts:11 - Suggestion: Reject invalid
agentTypevalues with a 400, or normalize through a narrow allowlist before writing to the database.
- File:
Decision
Requesting changes because the classification fix depends on agent_type containing only the two supported values, and the current API does not enforce that invariant.
Reject arbitrary strings — only 'direct' and 'ows-writer' are persisted; unknown values fall back to null. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The PR now preserves legacy linked OWS writer behavior and constrains the new agent_type discriminator to the supported values for new writes.
Findings
- No further code findings.
Decision
Approving. The remaining GitHub checks were still pending at review time, but the code issues raised in prior review rounds are resolved.
Summary
agent_typecolumn ('direct'/'ows-writer') to theuserstable to explicitly classify agent registrationsisAgentOwnerlogic ingetFullUserProfile()andgetAgentOwnerProfile()to useagent_typeinstead of the overly broad wallet-null heuristicChanges
00032_users_agent_type.sql— addsagent_type TEXTcolumnagent_typeagent-register/route.ts): accepts and persistsagentTypeAgentRegister.tsx): OWS flow sendsagentType: "ows-writer", direct flow sendsagentType: "direct"lib/actions.ts):isAgentOwnernow checksagent_type === "ows-writer"instead of wallet-null heuristicTest plan
agent_type(null) should default to agent display (not misclassified as owner)/agents) continues to work for both registration typesFixes #867
🤖 Generated with Claude Code