Skip to content
Merged
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
4 changes: 2 additions & 2 deletions colony_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,11 @@ def _check_replies_to_own_post(self, post: dict) -> None:
continue

comment_result = retry_api_call(
self.client.create_comment, post_id, reply
self.client.create_comment, post_id, reply, parent_id=comment_id,
)
if comment_result is not None:
self.state.mark_replied_to_comment(comment_id)
log.info(f"Replied to {c_author} on '{title[:40]}'")
log.info(f"Replied to {c_author} on '{title[:40]}' (threaded)")
time.sleep(API_DELAY)
else:
log.error(f"Failed to reply to {c_author} on '{title[:40]}'")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [
"colony-sdk>=1.2.0",
"colony-sdk>=1.3.0",
]

[project.optional-dependencies]
Expand Down
6 changes: 6 additions & 0 deletions tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ def test_votes_and_comments_in_single_response(self, mock_chat, agent):
agent.heartbeat()
agent.client.vote_post.assert_called_once_with("p1", 1)
agent.client.create_comment.assert_called_once()
# Browse comments should be top-level (no parent_id)
_call_args, call_kwargs = agent.client.create_comment.call_args
assert "parent_id" not in call_kwargs

@patch("colony_agent.agent.chat", return_value="VOTE: UPVOTE\nCOMMENT: SKIP")
def test_respects_vote_limit(self, mock_chat, tmp_path):
Expand Down Expand Up @@ -695,6 +698,9 @@ def test_replies_to_comment_on_own_post(self, mock_chat, agent):
}
agent.heartbeat()
agent.client.create_comment.assert_called_once()
# Should use parent_id for threaded reply
call_kwargs = agent.client.create_comment.call_args
assert call_kwargs == (("p1", "Thanks for the feedback, alice!"), {"parent_id": "c1"})

@patch("colony_agent.agent.chat", return_value="Thanks!")
def test_skips_own_comments(self, mock_chat, agent):
Expand Down
Loading