improvement: add useful error message when attempting to use unauthenticated cursor-agent
Summary
Adds logic to check the authentication status of cursor-agent via cursor-agent status in get_authentication_status and adds a check in execute_command. Previous behaviour was to output an error of Some(1) when trying to use cursor-agent while unauthenticated.
Type of Change
- [x] Feature
- [ ] Bug fix
- [ ] Refactor / Code quality
- [ ] Performance improvement
- [ ] Documentation
- [ ] Tests
- [ ] Security fix
- [ ] Build / Release
- [ ] Other (specify below)
Testing
Manual testing with an unauthenticated cursor-agent, ran tests and linter.
Related Issues
Relates to #5298
@DOsinga implemented your refactored version, the logic is correct but error message appears to be coming via the chat rather than the error dialogue I first encountered so I'm unsure whether this is appropriate to commit as-is. Not super familiar with the codebase yet so very possible I'm not throwing the error in the correct way, feedback very much appreciated!
@DOsinga if this is still wanted I'm unable to run the required approving workflows to allow merging
thank you @alexeyre !