Expand description
The steps of spawn_auth_cli: one login sessionβs state (Login), the piped-stdio run and the PTY run of the
provider CLI, and how each ends the session (success saved, failure, or ended meanwhile).
StructsΒ§
- Ended π
- The session ended (replaced, cancelled, timed out) before its login could be saved.
- Login π
- One login session: where it is recorded, where it saves, and the CLI that runs it and checks it.
- Started π
- The PTY, the child on it, and the ends of the PTY the run reads and writes.
FunctionsΒ§
- drain_
stderr π - Feed stderr into the session: some CLIs print the OAuth URL there.
- drain_
stdout π - Feed stdout into the session; on a login-success line that the auth check confirms, save the account.
- forward_
stdin π - Forward pasted callback URLs to the CLIβs stdin until the sender is dropped.
- open_
pty π - Allocate the PTY.
None(the session already failed) when the OS cannot give one. - pty_
drain π - Read the PTY line by line into the session. Returns the detached confirm-and-save task of a login-success line.
- run_
piped π - run_pty π
- save_
when_ πconfirmed - The detached half of a PTY login-success line: confirm it, save the account, and mark the success transitioned.
- settle_
piped_ πexit - End the session by how the CLI exited, when its output did not already:
Errwhen the session ended first. - settle_
pty_ πexit - End the session by how the PTY child exited, when its output did not already:
Errwhen the session ended first. - spawn_
auth_ πcli_ pty - PTY-backed variant of spawn_auth_cli. Used for providers whose auth
subcommand bails on
isatty()==0(currently OpenClaw). Mirrors the pipes pathβs lifecycle: spawn β drain β confirm β finish_success or finish_failure β detach. Stdout+stderr are merged on the PTY side;record_linedoesnβt care which stream a line came from. - spawn_
piped π - The piped-stdio run: the task is attached to the session so cancelling it aborts the CLI.
- spawn_
piped_ πchild - Spawn the provider CLI with piped stdio.
None(the session already failed) when it cannot be started. - start_
pty π - Allocate the PTY, spawn the provider CLI on it and register its PID.
None(the session already failed) when any of that cannot be done.