Skip to content

fix: Harden devbox agent billing switches - #4793

Draft
maciaszczykm wants to merge 3 commits into
masterfrom
marcin/devbox-billing-recovery
Draft

maciaszczykm wants to merge 3 commits into
masterfrom
marcin/devbox-billing-recovery

Conversation

@maciaszczykm

@maciaszczykm maciaszczykm commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Harden devbox agent billing switches so Console, the gateway, and the daemon agree on the active billing mode before prompts resume.

  • Stage the requested billing before restarting the agent so it can fetch its subscription credential. Gate prompts during the switch and reject concurrent switches on the same instance.
  • Keep the switch pending when an RPC is interrupted or a rollback fails. The recovery job retries unfinished switches and waits for acknowledgement, including when falling back to proxy billing.
  • Restore the prior launch settings and egress policy when the daemon rejects a switch. For suspended or resuming devboxes, defer the switch until the daemon is running and can acknowledge it.

Test plan

  • Passed 226 devbox Elixir tests, including gRPC error mapping and billing recovery.
  • Passed the Go gateway, daemon, and agent suites.
  • Passed the gateway billing regression tests under the race detector.
  • Build fresh images and verify subscription ↔ proxy switching and recovery after suspend/resume on dev.

Plural Flow: console

@maciaszczykm maciaszczykm added the bug-fix This pull request fixes a bug label Dec 3, 2026
@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@greptile-apps

greptile-apps Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable regressions were established.

Summary

Hardens billing switches across Console, the gateway, and the daemon.

  • Console keeps billing switches pending until the gateway confirms them.
  • The gateway and daemon align billing policy with the agent restart.

No actionable regressions were established. Tests were reviewed but not run.

Reviews (1) · Last reviewed commit: "keep devbox billing switches pending unt..." · Reviewed by Greptile

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix This pull request fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant