Skip to content

[PD1-852] Allow generated posts to be private#21

Open
amy-nihao wants to merge 1 commit intomainfrom
amy/auto-post
Open

[PD1-852] Allow generated posts to be private#21
amy-nihao wants to merge 1 commit intomainfrom
amy/auto-post

Conversation

@amy-nihao
Copy link
Contributor

@amy-nihao amy-nihao commented Feb 6, 2026

Description

Add support for pushing private posts. This is to support automatic post generation but allow them to be private initially.

Risk

Low, just adding an optional field. We do need to be careful about setting the is_private flag when calling this

Test

I added a private post by calling the post generation function via a local script
Screenshot 2026-02-06 at 15 15 15

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @amy-nihao, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the post management system by enabling the creation of private posts. This functionality is crucial for scenarios like automated post generation, where content might need to remain private initially before public release. The change involves adding a new boolean field to the post data model and updating the post creation method to accept and utilize this privacy setting.

Highlights

  • Private Post Support: Introduced an is_private flag to the AgentPost model and the add_agent_post function, allowing posts to be marked as private.
  • Default Privacy Setting: The add_agent_post function now defaults new posts to private, while the AgentPost model itself defaults is_private to False.
Changelog
  • src/cvec/cvec.py
    • Added is_private: bool = True as a new parameter to the add_agent_post function.
    • Updated the docstring for add_agent_post to describe the new is_private parameter and its default behavior.
    • Passed the is_private argument to the AgentPost constructor within the add_agent_post function.
  • src/cvec/models/agent_post.py
    • Added a new field is_private: bool = False to the AgentPost Pydantic model.
Activity
  • No human activity (comments, reviews, approvals) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds functionality to create private agent posts by introducing an is_private flag. The implementation looks good, but there's a minor inconsistency in the default value for this new flag between the add_agent_post method and the AgentPost model. My review includes a suggestion to align these defaults to improve code clarity and prevent potential confusion.

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

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.

1 participant