Skip to content

agents: stop waiting on expired or revoked connections (MARSOHS-2174) - #2054

Merged
DO-rrao merged 1 commit into
digitalocean:mainfrom
BadhriDO:marsohs-2174-connection-auth-wait-deadline
Oct 19, 2026
Merged

DO-rrao merged 1 commit into
digitalocean:mainfrom
BadhriDO:marsohs-2174-connection-auth-wait-deadline

Conversation

@BadhriDO

@BadhriDO BadhriDO commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

doctl harness-runtime connections create and auth <provider> wait for browser authorization with no limit. An abandoned or revoked authorization keeps them polling until someone kills the process, which hangs scripts and CI jobs. Both waits now end at the server's expiry, and the connections wait also ends on expired or revoked.
Jira: MARSOHS-2174

Scope

 connections create: poll GetConnection every 2 s
   active                       → success
+  expired | revoked            → exit 1, hint: connections create --actor <actor>
+  expires_at + 30 s            → exit 1, hint: connections get <id>   (15 min if no expires_at)
   Ctrl-C / SIGTERM             → "stopped waiting"
 auth <provider>: poll PollProviderAuth every 2 s
+  expires_at + 30 s            → exit 1, hint: re-run auth <provider>  (15 min if no expires_at)

Blast radius

🔴 Services: doctl (harness-runtime connections create, harness-runtime auth <provider>, the GitHub prompt in harness-runtime create and launch with --gh-repo) · Customers: an authorization that is not completed now exits 1 instead of waiting forever — verify that success, Ctrl-C and --no-wait output are unchanged.

Rollout

  • Rollback: revert; the change ships with the next doctl release and holds no state.

Decisions

  • Unrecognized statuses keep polling until the deadline, so a status the server adds later cannot end a wait early.
  • The 30 s grace absorbs clock skew and lets the next poll report the server's own expired; an expires_at in the past clamps to now. (authWaitDeadline)
  • An expired GitHub prompt fails create and launch instead of continuing: the user chose to connect, so a session without access would fail later.

Evidence

The new expired, revoked and deadline tests failed on main (an unexpected extra poll, or a hang until go test -timeout) and pass here; go test ./commands/... ./do/... passes except TestRegistryLogout, which fails the same way on main; a local build was validated against a live environment.

🤖 Generated with Claude Code

`harness-runtime connections create` waited for authorization with no
bound. It polled until the connection read active or the user pressed
Ctrl-C. harness-api marks an abandoned connection expired, and a revoked
one revoked, but doctl ignored both. It kept polling a connection that
could never complete, which hangs scripts and CI jobs. The legacy
`harness-runtime auth <provider>` wait had the same shape.

The connections wait now fails on the first poll that reads expired or
revoked, with a hint to re-run create. Both waits also end at the
server's expires_at plus a 30s grace, or after 15 minutes when the
server sends no expiry. Unrecognized statuses keep polling up to that
deadline. Success, Ctrl-C and --no-wait are unchanged.

Blast radius: doctl harness-runtime connections create and auth
<provider>, including the GitHub prompt in create --gh-repo; an
abandoned authorization now exits 1 instead of hanging.
Rollback: revert; no state or stored data is involved.

MARSOHS-2174

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BadhriDO BadhriDO closed this Oct 18, 2026
@BadhriDO BadhriDO reopened this Oct 18, 2026

@DO-rrao DO-rrao left a comment

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.

lgtm

@DO-rrao
DO-rrao merged commit 81c92a8 into digitalocean:main Oct 19, 2026
12 of 16 checks passed
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

⌂ 换网址