Urgent.News

What's breaking now, across thousands of outlets.

Tech

Don't call a login expired after one failed check

Styx connects to Vercel, AWS, Supabase and others through the logins you already have, and agents ask to use them. A login can expire without telling anyone, so Styx checks every connected target every 30 minutes, when you bring the app to the front, and when the computer wakes. The obvious version of that is easy to get wrong: a check fails, so mark the target expired. But a check also fails…

Connecting to various platforms, Styx uses existing logins and sends agents to use them. To keep track of these logins, the software checks every connected target every 30 minutes, when the app is brought to the front, and when the computer wakes up. At first glance, it might seem straightforward to mark a target as expired if a check fails.

However, this approach can lead to mistakes. For instance, if the wifi drops or the laptop wakes up without a network, that's not a failure of the login but a temporary network issue. To prevent falsely informing users that their login is broken, Styx differentiates between these two kinds of failures. A brief network failure is not considered a real failure, but a genuine authentication failure must appear in two consecutive checks.

There are a couple of exceptions. If the user presses Refresh or if a grant cannot be issued because the CLI is signed out, these are treated as real failures the first time they occur. This is because the user has just requested a login. When a target is marked expired, an agent attempting to use it will receive an error message from Styx, prompting it to reconnect.

Once the user signs in again, Styx rechecks all the other targets associated with the same account, ensuring that a single login can clear all of them. The trade-off of this system is that there might be a delay in noticing a real expiry, as the checks are conducted every 30 minutes. However, the author prefers this approach over the alternative of receiving false alarms that temporarily pause agents.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Your Compose Code, on More Screens and Less CPU

If Codename One didn't exist, Kotlin Multiplatform is probably the platform I'd choose. I prefer Java, but Kotlin is a good language, and KMP was one of the strongest platforms we measured against in…

More from Saturday 7 November →