Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/cvec/cvec.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,23 @@ def add_agent_post(
content: Optional[str] = None,
recommendations: Optional[List[AgentPostRecommendation]] = None,
tags: Optional[List[AgentPostTag]] = None,
is_private: bool = True,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The default value for is_private is True here, while the AgentPost model in src/cvec/models/agent_post.py defaults is_private to False. This inconsistency can be a source of confusion for developers using the SDK.

To make the behavior more predictable and consistent across the codebase, it's better to have the same default in both the method signature and the model. I'd recommend changing the default here to False to align with the model's default. Callers who need to create a private post can then explicitly pass is_private=True.

This makes the intention clearer and reduces the risk of accidentally creating private posts when the developer might expect public ones based on the model's definition.

Suggested change
is_private: bool = True,
is_private: bool = False,

Copy link
Contributor Author

@amy-nihao amy-nihao Feb 6, 2026

Choose a reason for hiding this comment

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

I think making the post visible should be a conscious choice, especially when the ai generated posts may not be good enough yet

) -> None:
"""
Add an agent post.

Note: If image_id is provided, the image must be uploaded to S3 beforehand.
The image_id should be the UUID used as the filename (without .png extension)
in the S3 bucket at the tenant's path.

Args:
title: Post title
author: Post author
image_id: Optional UUID of the uploaded image
content: Optional post content
recommendations: Optional list of recommendations
tags: Optional list of tags
is_private: Whether the post is private (only visible to superadmins). Defaults to True.
"""

post = AgentPost(
Expand All @@ -451,6 +461,7 @@ def add_agent_post(
content=content,
recommendations=recommendations,
tags=tags,
is_private=is_private,
)
payload = post.model_dump(mode="json", exclude_none=True)

Expand Down
1 change: 1 addition & 0 deletions src/cvec/models/agent_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ class AgentPost(BaseModel):
image_id: Optional[str] = None
recommendations: Optional[List[AgentPostRecommendation]] = None
tags: Optional[List[AgentPostTag]] = None
is_private: bool = False