fix: improve prompts, error messages, and workspace concurrency
- Externalize coordinator, notification, and planning prompts to separate files - Add workspace mutex for concurrent file operations - Improve error messages across file_tools, issue_tools, and pr_tools - Add logging to tool modules for better debugging - Update tests to match new error message strings
This commit is contained in:
@@ -56,7 +56,8 @@ def test_close_issue_failure() -> None:
|
||||
|
||||
issue_tools: IssueTools = IssueTools(mock_client)
|
||||
res: str = issue_tools.close_issue("owner", "repo", 1)
|
||||
assert "Error closing issue: API Error" in res
|
||||
assert "Could not close issue" in res
|
||||
assert "owner/repo" in res
|
||||
|
||||
|
||||
def test_get_issue_comments_success() -> None:
|
||||
@@ -77,7 +78,8 @@ def test_get_issue_comments_failure() -> None:
|
||||
|
||||
issue_tools: IssueTools = IssueTools(mock_client)
|
||||
res: str = issue_tools.get_issue_comments("owner", "repo", 1)
|
||||
assert "Error getting issue comments: API Error" in res
|
||||
assert "Could not retrieve comments" in res
|
||||
assert "owner/repo" in res
|
||||
|
||||
|
||||
def test_list_assigned_issues_success() -> None:
|
||||
@@ -120,7 +122,7 @@ def test_list_issues_empty() -> None:
|
||||
|
||||
issue_tools: IssueTools = IssueTools(mock_client)
|
||||
res: str = issue_tools.list_issues("owner", "repo")
|
||||
assert res == "No issues in owner/repo."
|
||||
assert res == "No open issues in owner/repo."
|
||||
|
||||
|
||||
def test_list_issues_failure() -> None:
|
||||
@@ -129,7 +131,8 @@ def test_list_issues_failure() -> None:
|
||||
|
||||
issue_tools: IssueTools = IssueTools(mock_client)
|
||||
res: str = issue_tools.list_issues("owner", "repo")
|
||||
assert "Error listing issues: API Error" in res
|
||||
assert "Could not list issues" in res
|
||||
assert "owner/repo" in res
|
||||
|
||||
|
||||
def test_create_issue_success() -> None:
|
||||
@@ -153,7 +156,8 @@ def test_create_issue_failure() -> None:
|
||||
|
||||
issue_tools: IssueTools = IssueTools(mock_client)
|
||||
res: str = issue_tools.create_issue("owner", "repo", "Title", "Body")
|
||||
assert "Error creating issue: API Error" in res
|
||||
assert "Could not create issue" in res
|
||||
assert "Title" in res
|
||||
|
||||
|
||||
def test_add_label_to_issue_success() -> None:
|
||||
@@ -171,7 +175,8 @@ def test_add_label_to_issue_failure() -> None:
|
||||
|
||||
issue_tools: IssueTools = IssueTools(mock_client)
|
||||
res: str = issue_tools.add_label_to_issue("owner", "repo", 1, "bug")
|
||||
assert "Error adding label to issue #1: API Error" in res
|
||||
assert "Could not add label" in res
|
||||
assert "bug" in res
|
||||
|
||||
|
||||
def test_add_comment_to_issue_success() -> None:
|
||||
@@ -189,4 +194,5 @@ def test_add_comment_to_issue_failure() -> None:
|
||||
|
||||
issue_tools: IssueTools = IssueTools(mock_client)
|
||||
res: str = issue_tools.add_comment_to_issue("owner", "repo", 1, "body")
|
||||
assert "Error adding comment to issue #1: API Error" in res
|
||||
assert "Could not add comment" in res
|
||||
assert "owner/repo" in res
|
||||
|
||||
Reference in New Issue
Block a user