Expand description
HTTP helpers for calls to the sidecar srv. Split out of main.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.2).
Constants§
- SHELL_
CREATE_ 🔒TIMEOUT - How long a Shell or PtyShell create may take: one on an SSH host the user has not allowed yet waits for their answer in a consent dialog (srv gives them two minutes), well past the client’s usual 10 s.
Functions§
- describe_
http_ 🔒error - describe_
transport_ 🔒error - require_
agent_ 🔒env - Guard for the self-scoped agent-API verbs: they need the sidecar URL + auth key to reach it, and the caller’s block id to resolve “my own” tab/pane/window/workspace.
- srv_
get_ 🔒json - GET a srv route and return its JSON body, with every failure described by
what actually happened (#3473). reqwest’s own message for a refused
connection or a timeout is only “error sending request for url (…)”, which
reads like a network fault whatever the cause; and parsing the body before
checking the status loses the status whenever an error body isn’t JSON.
So: refused / timed out / other transport failures are told apart, the
status is checked first, and an error carries srv’s own
errormessage, else the raw body. - srv_
post_ 🔒json - POST a JSON body to a srv route and return its JSON answer, failures
described as
srv_get_jsondescribes them.