Skip to content

Conversation

@sg-s
Copy link
Collaborator

@sg-s sg-s commented Jan 2, 2026

No description provided.

if tool_key is not None:
import json

params["filter"] = json.dumps({"tool": {"toolManifest": {"key": tool_key}}})
Copy link

Choose a reason for hiding this comment

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

Thanks

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the ability to filter executions by tool key by introducing a new tool_key parameter to the executions.list() method. However, this change removes the existing filter parameter, which is a breaking change.

  • Replaced the generic filter parameter with a specific tool_key parameter in executions.list()
  • Added JSON-based filter construction to map tool_key to the API's filter format
  • Added tests to verify the new filtering functionality

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/platform/executions.py Replaced filter parameter with tool_key and added logic to construct JSON filter for tool manifest key matching
tests/test_executions.py Added new test file with tests for listing executions and filtering by tool key

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

params["filter"] = filter

if tool_key is not None:
import json
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The json module should be imported at the top of the file with other imports (after line 10) rather than inside the function. This is inconsistent with Python best practices and the import style used in most other files in the codebase (e.g., src/auth.py, src/config.py, src/platform/client.py).

Copilot uses AI. Check for mistakes.
page_size: int | None = None,
order: str | None = None,
filter: str | None = None,
tool_key: str | None = None,
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

This is a breaking API change. The filter parameter has been removed and replaced with tool_key. Existing code that uses the filter parameter (e.g., tests/test_tools_api.py:12 and src/platform/job.py:1647) will break with this change. Consider either keeping both parameters or providing a deprecation path.

Copilot uses AI. Check for mistakes.
data = client.executions.list(tool_key="deeporigin.bulk-docking")
executions = data.get("data", [])
assert isinstance(executions, list), "Expected a list"
assert len(executions) > 0, "Expected at least one execution"
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The test assumes that the API will return at least one execution with the tool key "deeporigin.bulk-docking". This assumption makes the test fragile - it will fail if no executions exist for this tool. Consider using a mock or creating test data, or handle the case where no executions exist more gracefully.

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +57
if tool_key is not None:
import json

params["filter"] = json.dumps({"tool": {"toolManifest": {"key": tool_key}}})
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The filter construction uses hardcoded nested structure without validation. If tool_key is an empty string or contains special characters that need escaping in JSON, this could lead to unexpected behavior. Consider adding validation for the tool_key parameter before constructing the filter.

Copilot uses AI. Check for mistakes.
@sg-s sg-s merged commit 9fa84f4 into main Jan 2, 2026
14 of 15 checks passed
@sg-s sg-s deleted the filtering-by-tool branch January 2, 2026 17:11
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.

3 participants