feat(comment-cli): default unattributed comments to the AI identity#565
Merged
Conversation
The `rw comment` CLI's primary user is an LLM agent, but with no env var or flag configured it stamped comments as the human `local:human`/"You" identity, indistinguishable in the browser from the reviewer's own comments. Default the CLI to the viewer-recognized `local:ai`/"AI" identity (sparkles avatar) instead; env vars and flags still override, and the browser/`rw serve` path is unchanged. Docs and CHANGELOG updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
rw commentCLI's primary user is an LLM agent, yet with no env var or flag configured it stamped new comments with the shared default identity{ id: "local:human", name: "You" }— indistinguishable in the browser from the human reviewer's own comments.This defaults the CLI to the viewer-recognized
{ id: "local:ai", name: "AI" }identity, which renders with a sparkles avatar. Env vars (RW_COMMENT_AUTHOR_ID/RW_COMMENT_AUTHOR_NAME) and--author-*flags still override.Scope
rw commentCLI default changes. The shared store fallback (Author::local_human()) and therw servebrowser write path staylocal:human— a browser comment is from a human.Author::local_ai()is added next tolocal_human()inrw-comments, sincelocal:aiis already a canonical viewer identity.resolve_authornow returnsAuthor(defaulting tolocal_ai()) instead ofResult<Option<Author>>; the two call sites wrap it inSome(..).NewComment.author/CreateComment.authorremainOption<Author>(HTTP deserialization relies on it).Tests
cargo test -p rw -p rw-comments— green (resolver unit tests updated to assert thelocal:aidefault; error-path tests unchanged).🤖 Generated with Claude Code