Documentation
¶
Overview ¶
Package codexrelay keeps the Codex threads open when magpie quits working until magpie is opened again or they end.
Codex signed in to ChatGPT sends its turns to magpie's gateway while magpie fails it over (agent.EndCodexFailover). At quit magpie takes that base URL out of Codex's config, but a thread already open, in the Codex app above all, keeps the URL it started with, and every turn after went to a closed port: "503 Service Unavailable: Unknown error" through a system proxy, "Connection refused" without one, until magpie was opened again (idkatbro on X). So at quit, with Codex running, magpie starts a small process of its own (`magpie codex-relay`) that takes the port up once the gateway lets go of it and passes those turns on to the ChatGPT backend on Codex's own sign-in (gateway.CodexRelay). It ends once every Codex process it was started for has, and leaves when the next magpie starts (Leave), finishing the turns it is streaming first: no running turn is cut.
Index ¶
Constants ¶
const ( LeavePath = "/.magpie-codex-relay/leave" TokenHeader = "X-Magpie-Relay-Token" )
LeavePath is where the next magpie tells the relay to leave; with TokenHeader holding the token the relay wrote in its state file.
const Command = "codex-relay"
Command is the magpie command a relay runs as.
Variables ¶
This section is empty.
Functions ¶
func Leave ¶
func Leave()
Leave tells a relay serving at the gateway's port to let go of it, for the magpie starting to serve there. It returns once the relay has closed its listener (its streams go on finishing), or at once when there is none.
Types ¶
This section is empty.