A Remote Coding Agent Can Deadlock on a Local Permission Dialog
The nastiest failure mode in a remote coding agent is not a bad patch. It is a permission prompt that nobody can see. You start a long-running job on a workstation, leave the desk, and check it from a phone later. The agent reaches a command that needs approval. If that request only exists as a modal in the desktop UI, the job has not technically failed. It has just stopped forever. That is worse. A failed job is observable. A hidden wait looks healthy until someone notices no work has moved. The permission prompt is protocol state The fix starts with a small change in how you model approval. A permission request is not UI state. It is durable state owned by the job that is doing the work. The lifecycle should look more like this: asked → persisted → surfaced → answered → applied → resolved The desktop dialog, phone screen, CLI, or web controller is only one view over that state. Closing a window must not erase it. Reconnecting must not create a second request. Two controllers must not be able to resolve different requests because a stale button happened to be on screen. This also changes what a remote-control protocol needs. A controller should be able to fetch job status with pending approvals, submit an answer for one request ID, and observe the resulting event. It should not become a filesystem or runtime proxy just to click “allow.” What needs to survive a disconnect At minimum, the pending request needs a stable request ID, its owning job/session, the requested action and resources, and enough ordering information to render concurrent requests deterministically. The answer also needs an identity. If request abc is pending, an answer for xyz must fail. Replaying the same answer for abc should be harmless. Replaying a different answer under the same ID should not quietly overwrite the first decision. That sounds fussy until a phone reconnects on a flaky network and retries the last command. Then it is the difference between idempotence and “the agent ran it twic