Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| @@ -0,0 +1,104 @@ | |||
| """ | |||
There was a problem hiding this comment.
Missing __init__.py breaks CLI package distribution
High Severity
The new envoy/cli/ directory has no __init__.py file. Since setup.py uses find_packages() (not find_namespace_packages()), setuptools requires __init__.py to recognize a directory as a package. Without it, envoy.cli and its modules (cleanup, status, prompt) won't be included in the pip-installed distribution, causing the CLI entry point (envoy=envoy.__main__:main) to fail with an import error at runtime.
Additional Locations (1)
envoy/client.py
Outdated
| raise ValueError(f"unhandled status code {rep.status_code}") | ||
|
|
||
| def _make_endpoint(self, *endpoint: tuple[str], params: dict = None) -> str: | ||
| def _make_endpoint(self, *endpoint, params: Optional[dict] = None) -> Literal[b""]: |
There was a problem hiding this comment.
Incorrect return type annotation Literal[b""] on _make_endpoint
Medium Severity
The _make_endpoint return type annotation was changed from the correct -> str to -> Literal[b""]. The function returns urlunparse(...) which produces a str, not a bytes literal. Literal[b""] claims the function always returns the exact empty bytes value b"", which is semantically nonsensical and will break any static type checking. This appears to be an accidental edit.
| "help": "the counterparty name or ID of the transactions to cleanup", | ||
| "type": str, | ||
| "required": True, | ||
| }, |
There was a problem hiding this comment.
Conflicting short flags between global and cleanup args
Medium Severity
The cleanup subparser defines -s/--status and -c/--counterparty, which collide with the global -s/--secret and -c/--client-id short flags. When a user places these flags after the cleanup subcommand, the subparser consumes them with different semantics. For example, envoy cleanup -s mysecret interprets mysecret as a status value (failing choices validation) instead of a secret. This makes the short flags unusable for credentials when using the cleanup command and produces confusing error messages.


Scope of changes
Implements an Envoy CLI command that can be pip installed and a cleanup command for dealing with UAB Raison messages.
Fixes SC-37567
Type of change
Acceptance criteria
This PR will be merged without review.
Author checklist
Note
Medium Risk
Adds a new installable CLI that can batch archive/delete transactions; mistakes in filtering/confirmation could lead to unintended data changes. Also tweaks client request typing/validation and adds a new transactions
archivecall path that should be verified against the API.Overview
Introduces a pip-installable
envoyCLI (envoy.__main__+console_scripts) that loads configuration from.env/env vars and dispatches subcommands.Adds
statusoutput and a newcleanupcommand to batch archive or delete transactions by counterparty and status, with interactive confirmation,--dry-run, and--yessafeguards.Extends the Python client with stricter URL validation, minor typing adjustments, and adds a transactions-level
archiveAPI call; bumps version to1.3.0.Written by Cursor Bugbot for commit cbf0bf8. Configure here.