supervisor: openrouter runtime — the key.store harness on an OpenAI-compatible router #11
Loading…
Reference in a new issue
No description provided.
Delete branch "openrouter-runtime"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A third resident runtime,
openrouter(aliasesrouter,openai-compatible,harness): a pi-style agent loop built into the supervisor instead of an external CLI, so GLM and Kimi residents run through OpenRouter today and the key.store router later (base URL + profile switch, same key file).internal/openaichat: chat-completions client — retry on 429/408/5xx with backoff, content parts, 200+error bodies, provider routing ({"order":[…],"allow_fallbacks":false}), reasoning echoed back asreasoning+reasoning_detailson OpenRouter /reasoning_contenton vanilla routers (Kimi rejects a history without it).internal/mcphttp: Streamable-HTTP MCP client for the forge hub (JSON or SSE bodies,Mcp-Session-Id, re-initialize on 404, cursor pagination).internal/harness: jsonl sessions (session/message/usage/compactionlines) with compaction at 75 % of the context window that never splits a tool call from its result, plus a hand-off digest;read_file/write_file/edit_file/list_dir/bashtools (writes only under the checkout + writable roots, read-deny prefixes) plus every hub tool the identity token allows; steers drained between tool calls; a bubblewrap sandbox with the Codex workspace-write shape (ro root, fresh /dev,/proc,/run, secret stores and other identities' state masked, checkout + notebook + /tmp writable, user/pid/ipc/uts namespaces, all caps dropped, network on; still uid 0 — KSE-0181 uid drop is the follow-up).agentdispatcher:routerClientimplementing residentClient + resume/compact/digest; org tiers gaincontext_windowandprovider_order; supervisor flags--router-base-url/--router-api-key-file/--router-state-dir/--router-sandbox/--router-title/--router-referer/--router-context-window/--router-profile(envAGENT_DISPATCHER_ROUTER_*); requeue rulerouter-runtimewhile the key file is absent.Tests:
go test ./...green (fake model + fake hub round trips: tool call via the hub, reasoning echo, resume, digest, recoverable failures; sandbox argv shape; MCP SSE/JSON/expired-session; chat client retry/parts/embedded error/profiles).key.store side (separate PR):
agentDispatcher.router.*module options, org tiersopenrouter-glm/openrouter-kimi, docs; the forge keyopenrouter/api-keyis declared behindopenrouterEnableduntil the founder writes it to OpenBao.ffc7e5ce52to543da93839