Skip to content

feat: support polling straight from auth login#78

Open
kreese-stripe wants to merge 1 commit intomainfrom
kreese/auth-polling
Open

feat: support polling straight from auth login#78
kreese-stripe wants to merge 1 commit intomainfrom
kreese/auth-polling

Conversation

@kreese-stripe
Copy link
Copy Markdown
Collaborator

We received feedback (from an agent using link-cli!) that the auth status --interval N --max-attempts M is a long-running blocking command that blocked the agent's I/O, and so they weren't able to relay the code to the human until they stopped polling.

To fix this, we instead allow starting the polling straight from the auth login command

Test Plan:

Old call usage: no change in behavior

Screen.Recording.2026-05-06.at.2.42.42.PM.mov

Polling straight from auth login:

Screen.Recording.2026-05-06.at.2.43.34.PM.mov

@kreese-stripe kreese-stripe requested a review from a team as a code owner May 6, 2026 18:44

```bash
link-cli auth login --client-name "<your-agent-name>"
link-cli auth login --client-name "<your-agent-name>" --interval 5 --timeout 300
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we should make this the default behavior. Agents seem good with the _next output?

const deadline = Date.now() + c.options.timeout * 1000;
let attempts = 0;

while (true) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this code repeated in the other auth polling command?


// Inline polling: emit code to stderr (visible immediately even while
// stdout is buffered), then yield it as structured output for MCP streaming.
process.stderr.write(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should be json output/respect the output format

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