Skip to content

fix: keep pieces run usable during login#445

Open
anthony-maio wants to merge 2 commits intopieces-app:mainfrom
anthony-maio:wt/issue-112-nonblocking-login
Open

fix: keep pieces run usable during login#445
anthony-maio wants to merge 2 commits intopieces-app:mainfrom
anthony-maio:wt/issue-112-nonblocking-login

Conversation

@anthony-maio
Copy link
Copy Markdown

Summary

  • add a background login path in BasicUser.login() for loop-mode auth flows
  • route pieces run login and reconnect calls through the non-blocking path
  • add regressions proving loop-mode login uses async auth and returns the prompt immediately

Testing

  • python -m pytest tests/auth_commands_test.py

Copilot AI review requested due to automatic review settings March 25, 2026 20:37
Copy link
Copy Markdown
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 updates the CLI login flow so that, when running in loop mode (pieces run), login/reconnect operations don’t block the prompt and can complete in the background.

Changes:

  • Add an async/background login option to BasicUser.login() via an async_req flag.
  • Route loop-mode pieces login (and loop-mode reconnect) through async login/connect paths and print a non-blocking sign-in message.
  • Add regression tests asserting loop-mode login uses async auth and that async login returns immediately with a live background thread.

Reviewed changes

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

File Description
src/pieces/command_interface/auth_commands.py Uses async login/connect when Settings.run_in_loop is enabled to keep the prompt responsive.
src/pieces/_vendor/pieces_os_client/wrapper/basic_identifier/user.py Adds async_req support to BasicUser.login() and refactors login completion into a helper.
tests/auth_commands_test.py Adds tests for loop-mode async login and for BasicUser.login(async_req=True) returning a background thread.

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f6c77fca5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants