02 / Answer

Answer

The Router reads each terminal as the screen you would see. Input goes in only at an empty prompt. Everything else waits for you.

The screen guard holding a queued prompt while a usage-limit dialog offering paid credits is on screen.
Fig. 01 Screen guard · a queued prompt waits while a limit dialog is open

Screen states

oh-router inspect ID returns the session’s state, its recent turns and the visible screen. screen_state is one of these:

screen_stateOn screenWhat input does
empty_input_boxAn idle promptGoes in
permission_promptA tool asking to runWaits for action ID approve or deny
folder_trust_dialogFirst launch in a folderWaits for action ID trust_folder
limit_dialogA usage limit offering credits, overage or an upgradeRefused (limit_dialog_blocked). Nothing the Router sends can accept a charge
client_reset_waitA countdown to the usage resetWaits
reset_ready_promptThe reset arrived; the CLI asks to resumeWaits
unrecognizedAnything elseWaits

Each write carries the screen generation it was checked against. If a dialog appears between the check and the write, the holder rejects it (screen_epoch_changed) before a byte reaches the terminal. Secrets on screen are masked before they leave the holder.

Steer

--modeBehaviour
auto (default)Sends at an idle prompt, otherwise queues
nowSends at an idle prompt, otherwise fails with the reason
queueAlways queues
interruptSends Ctrl+C, then the prompt once the screen allows
Reply to a session
$ oh-router steer term_01a2b3c4d5e6 "Run the linter and fix what it finds"
$ oh-router steer term_01a2b3c4d5e6 --mode interrupt "Stop. Revert the last change"

The prompt queue

Each session keeps its own queue. The Router delivers the next prompt when the session is back at an empty prompt.

Manage the queue
$ oh-router queue add term_01a2b3c4d5e6 "Then update the changelog"
$ oh-router queue list term_01a2b3c4d5e6
$ oh-router queue move term_01a2b3c4d5e6 PROMPT_ID 0
$ oh-router queue flush term_01a2b3c4d5e6

remove drops one prompt and clear empties the queue.

Dialogs and stopping

oh-router action ID takes approve, deny, trust_folder, ctrl_c or stop. An action applies to the dialog that is on screen when you send it; if that dialog has changed, the action is refused. stop ends the session; its conversation stays readable.

Continue a stopped turn

When a Codex turn stops at a usage limit, the session is marked. oh-router continue ID asks it to carry on in the same terminal, once, and only while the screen shows an empty prompt nobody has typed into. The Router also does this by itself when the account has room again. To move a limited session to another account instead, see Route.

Turns and usage

inspect lists recent turns. oh-router session-usage ID --started-at SECONDS adds up the tokens a conversation used, across every account it ran on.